linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] x86: relocs: Make per_cpu_load_addr static
@ 2014-09-24 12:30 Ben Hutchings
  2014-09-24 15:02 ` [tip:x86/boot] x86/relocs: " tip-bot for Ben Hutchings
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2014-09-24 12:30 UTC (permalink / raw)
  To: x86; +Cc: LKML, Michael Tautschnig, 748577

[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]

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@debian.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 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 bbb1d22..a5efb21 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -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)
 {


-- 
Ben Hutchings
Everything should be made as simple as possible, but not simpler.
                                                           - Albert Einstein

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:x86/boot] x86/relocs: Make per_cpu_load_addr static
  2014-09-24 12:30 [PATCH RESEND] x86: relocs: Make per_cpu_load_addr static Ben Hutchings
@ 2014-09-24 15:02 ` tip-bot for Ben Hutchings
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Ben Hutchings @ 2014-09-24 15:02 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, mt, torvalds, tglx, ben

Commit-ID:  eeeda4cd06e828b331b15741a204ff9f5874d28d
Gitweb:     http://git.kernel.org/tip/eeeda4cd06e828b331b15741a204ff9f5874d28d
Author:     Ben Hutchings <ben@decadent.org.uk>
AuthorDate: Wed, 24 Sep 2014 13:30:12 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
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
Reported-by: Michael Tautschnig <mt@debian.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: 748577@bugs.debian.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1411561812.3659.23.camel@decadent.org.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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 bbb1d22..a5efb21 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -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)
 {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-24 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-24 12:30 [PATCH RESEND] x86: relocs: Make per_cpu_load_addr static Ben Hutchings
2014-09-24 15:02 ` [tip:x86/boot] x86/relocs: " tip-bot for Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).