[PATCH v7 3/5] dev: export driver information with MSVC

Andre Muezerie andremue at linux.microsoft.com
Wed Jun 11 15:27:19 CEST 2025


On Wed, Jun 11, 2025 at 11:45:30AM +0200, David Marchand wrote:
> From: Andre Muezerie <andremue at linux.microsoft.com>
> 
> DPDK uses GCC attribute "used" through macro __rte_used to indicate
> that a variable not referenced in the code should be assumed being
> used and therefore not be optimized away. This technique is used to embed
> information in the binaries, by having crafted information stored in
> them.
> 
> MSVC offers similar functionality, but it differs significantly: MSVC
> requires a pragma to be used to send a command to the linker telling it
> explicitly the name of the symbol that should be included (even if not
> referenced). As a side-effect, variables called out to be included cannot
> be static, otherwise their symbols are not "seen" by the linker. This
> restriction requires some DPDK code to be refactored.
> 
> To assimilate these requirements/restrictions, a new macro
> RTE_PMD_EXPORT_SYMBOL is added in this patch to ensure these special
> variables make it to the final binaries.
> 
> Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---

Acked-by: Andre Muezerie <andremue at linux.microsoft.com>


More information about the dev mailing list