Skip to contentSkip to conversation

x86: relocs: Make per_cpu_load_addr static

PATCH RESEND New Ben Hutchings 2 participants 2 messages Sep 24, 2014 x86

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 x86: relocs: Make per_cpu_load_addr static

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

---
 arch/x86/tools/relocs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/tools/relocs.c +1 -1
index bbb1d22..a5efb21 100644
@@ -695,7 +695,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)
 {
Signature · 3 lines
Ben Hutchings
Everything should be made as simple as possible, but not simpler.
                                                           - Albert Einstein
#1 lore raw

[tip:x86/boot] x86/relocs: Make per_cpu_load_addr static

x86/relocs: Make per_cpu_load_addr static
Commit-ID:  eeeda4cd06e828b331b15741a204ff9f5874d28d
Gitweb:     http://git.kernel.org/tip/eeeda4cd06e828b331b15741a204ff9f5874d28d
Author:     Ben Hutchings <[email protected]>
AuthorDate: Wed, 24 Sep 2014 13:30:12 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 24 Sep 2014 15:17:47 +0200

x86/relocs: Make per_cpu_load_addr static

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

---
 arch/x86/tools/relocs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/tools/relocs.c +1 -1
index bbb1d22..a5efb21 100644
@@ -695,7 +695,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)
 {