[Devel] [PATCH RH7] x86/relocs: Make per_cpu_load_addr static

Kirill Tkhai ktkhai at virtuozzo.com
Thu Feb 3 14:45:14 MSK 2022


From: Ben Hutchings <ben at decadent.org.uk>

ms commit eeeda4cd06e8

per_cpu_load_addr is only used for 64-bit relocations, but is
declared in both configurations of relocs.c - with different
types.  This has undefined behaviour in general.  GNU ld is
documented to use the larger size in this case, but other tools
may differ and some warn about this.

References: https://bugs.debian.org/748577
Reported-by: Michael Tautschnig <mt at debian.org>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
Cc: 748577 at bugs.debian.org
Cc: Linus Torvalds <torvalds at linux-foundation.org>
Link: http://lkml.kernel.org/r/1411561812.3659.23.camel@decadent.org.uk
Signed-off-by: Ingo Molnar <mingo at kernel.org>
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 arch/x86/tools/relocs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
index 8ff49e6a88fe..952ad1a13a2b 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -698,7 +698,7 @@ static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel,
  *
  */
 static int per_cpu_shndx	= -1;
-Elf_Addr per_cpu_load_addr;
+static Elf_Addr per_cpu_load_addr;
 
 static void percpu_init(void)
 {




More information about the Devel mailing list