aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-10-16 02:43:14 -0400
committerIngo Molnar <mingo@kernel.org>2013-10-18 02:45:09 -0400
commitaec58bafaf89279522c44ec8ca9211eabb2b6976 (patch)
treea22c5bfa255d386d9ec658c554cd6cd7ac3621b6
parent6e6a4932b0f569b1a5bb4fcbf5dde1b1a42f01bb (diff)
x86/relocs: Add percpu fixup for GNU ld 2.23
The GNU linker tries to put __per_cpu_load into the percpu area, resulting in a lack of its relocation. Force this symbol to be relocated. Seen starting with GNU ld 2.23 and later. Reported-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Michael Davidson <md@google.com> Cc: Cong Ding <dinggnu@gmail.com> Link: http://lkml.kernel.org/r/20131016064314.GA2739@www.outflux.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/tools/relocs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
index 71a2533c90d3..11f9285a2ff6 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -729,6 +729,7 @@ static void percpu_init(void)
729 * 729 *
730 * The GNU linker incorrectly associates: 730 * The GNU linker incorrectly associates:
731 * __init_begin 731 * __init_begin
732 * __per_cpu_load
732 * 733 *
733 * The "gold" linker incorrectly associates: 734 * The "gold" linker incorrectly associates:
734 * init_per_cpu__irq_stack_union 735 * init_per_cpu__irq_stack_union
@@ -738,6 +739,7 @@ static int is_percpu_sym(ElfW(Sym) *sym, const char *symname)
738{ 739{
739 return (sym->st_shndx == per_cpu_shndx) && 740 return (sym->st_shndx == per_cpu_shndx) &&
740 strcmp(symname, "__init_begin") && 741 strcmp(symname, "__init_begin") &&
742 strcmp(symname, "__per_cpu_load") &&
741 strncmp(symname, "init_per_cpu_", 13); 743 strncmp(symname, "init_per_cpu_", 13);
742} 744}
743 745