From 13b1c6986d78fe0fc2389d4907b65e15c2425775 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Wed, 12 Feb 2020 09:15:33 -0800 Subject: [PATCH] x86: fix large Kconfig values on 64-bit Use the special x86 operand modifier 'p' to print the raw value. This fixes an issue on x86-64 where errors were generated if a constant larger than INT_MAX was used. Values larger than UINT_MAX are still unsupported (on any arch). Fixes: #22542 Signed-off-by: Andrew Boie --- include/toolchain/gcc.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/toolchain/gcc.h b/include/toolchain/gcc.h index dcaaea13dfe5db..7c1fd8b06bee44 100644 --- a/include/toolchain/gcc.h +++ b/include/toolchain/gcc.h @@ -398,7 +398,14 @@ do { \ ",%B0" \ "\n\t.type\t" #name ",%%object" : : "n"(~(value))) -#elif defined(CONFIG_X86) || defined(CONFIG_ARC) || defined(CONFIG_ARM64) +#elif defined(CONFIG_X86) + +#define GEN_ABSOLUTE_SYM(name, value) \ + __asm__(".globl\t" #name "\n\t.equ\t" #name \ + ",%p0" \ + "\n\t.type\t" #name ",@object" : : "n"(value)) + +#elif defined(CONFIG_ARC) || defined(CONFIG_ARM64) #define GEN_ABSOLUTE_SYM(name, value) \ __asm__(".globl\t" #name "\n\t.equ\t" #name \