diff options
author | Michael Brown <mcb30@ipxe.org> | 2018-03-21 16:47:33 +0200 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2018-03-21 17:00:53 +0200 |
commit | bc85368cdd311fe68ffcf251e7e8e90c14f8a9dc (patch) | |
tree | 2966a5d8310f0b57e39a8db9dec202ea5823286d /src/arch/x86/include | |
parent | 6149e0af3ca21d8ea2a903dd555e6e5c4b6a630a (diff) | |
download | ipxe-bc85368cdd311fe68ffcf251e7e8e90c14f8a9dc.tar.gz |
[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>
Diffstat (limited to 'src/arch/x86/include')
-rw-r--r-- | src/arch/x86/include/librm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/arch/x86/include/librm.h b/src/arch/x86/include/librm.h index 6bad9c42b..5196d390f 100644 --- a/src/arch/x86/include/librm.h +++ b/src/arch/x86/include/librm.h @@ -255,7 +255,7 @@ extern void remove_user_from_rm_stack ( userptr_t data, size_t size ); #endif /* LINE_SYMBOL: declare a symbol for the current source code line */ -#define LINE_SYMBOL _S2 ( OBJECT ) "__line_" _S2 ( __LINE__ ) ":" +#define LINE_SYMBOL _S2 ( OBJECT ) "__line_" _S2 ( __LINE__ ) "__%=:" /* TEXT16_CODE: declare a fragment of code that resides in .text16 */ #define TEXT16_CODE( asm_code_str ) \ |