Commit 2a4b9c5af82035c591adca951a9af1665ad1a2b0

Authored by Paul Mackerras
1 parent 8b8b0cc1c7

powerpc: Work around ld bug in older binutils

Commit 549e8152de8039506f69c677a4546e5427aa6ae7 ("powerpc: Make the
64-bit kernel as a position-independent executable") added lines to
vmlinux.lds.S to add the extra sections needed to implement a
relocatable kernel.  However, those lines seem to trigger a bug in
older versions of GNU ld (such as 2.16.1) when building a
non-relocatable kernel.  Since ld 2.16.1 is still a popular choice for
cross-toolchains, this adds an #ifdef to vmlinux.lds.S so the added
lines are only included when building a relocatable kernel.

Signed-off-by: Paul Mackerras <paulus@samba.org>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

arch/powerpc/kernel/vmlinux.lds.S
... ... @@ -187,6 +187,7 @@
187 187 *(.machine.desc)
188 188 __machine_desc_end = . ;
189 189 }
  190 +#ifdef CONFIG_RELOCATABLE
190 191 . = ALIGN(8);
191 192 .dynsym : AT(ADDR(.dynsym) - LOAD_OFFSET) { *(.dynsym) }
192 193 .dynstr : AT(ADDR(.dynstr) - LOAD_OFFSET) { *(.dynstr) }
... ... @@ -202,6 +203,7 @@
202 203 __rela_dyn_start = .;
203 204 *(.rela*)
204 205 }
  206 +#endif
205 207  
206 208 /* Fake ELF header containing RPA note; for addnote */
207 209 .fakeelf : AT(ADDR(.fakeelf) - LOAD_OFFSET) { *(.fakeelf) }