iPXE - Open Source Boot Firmware

[librm] Ensure that inline code symbols are unique
authorMichael Brown <mcb30@ipxe.org>
Wed, 21 Mar 2018 14:47:33 +0000 (16:47 +0200)
committerMichael Brown <mcb30@ipxe.org>
Wed, 21 Mar 2018 15:00:53 +0000 (17:00 +0200)
commitbc85368cdd311fe68ffcf251e7e8e90c14f8a9dc
tree2966a5d8310f0b57e39a8db9dec202ea5823286d
parent6149e0af3ca21d8ea2a903dd555e6e5c4b6a630a
[librm] Ensure that inline code symbols are unique

Commit 6149e0a ("[librm] Provide symbols for inline code placed into
other sections") may cause build failures due to duplicate label names
if the compiler chooses to duplicate inline assembly code.

Fix by using the "%=" special format string to include a
guaranteed-unique number within the label name.

The "%=" will be expanded only if constraints exist for the inline
assembly.  This fix therefore requires that all REAL_CODE() fragments
use a (possibly empty) constraint list.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/x86/core/dumpregs.c
src/arch/x86/include/librm.h
src/arch/x86/interface/pcbios/bios_console.c
src/arch/x86/interface/pcbios/bios_reboot.c
src/arch/x86/interface/syslinux/comboot_call.c
src/arch/x86/transitions/librm_test.c