Skip to content

Commit

Permalink
powerpc: Work around ld bug in older binutils
Browse files Browse the repository at this point in the history
Commit 549e815 ("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>
  • Loading branch information
paulusmack committed Oct 31, 2008
1 parent 8b8b0cc commit 2a4b9c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ SECTIONS
*(.machine.desc)
__machine_desc_end = . ;
}
#ifdef CONFIG_RELOCATABLE
. = ALIGN(8);
.dynsym : AT(ADDR(.dynsym) - LOAD_OFFSET) { *(.dynsym) }
.dynstr : AT(ADDR(.dynstr) - LOAD_OFFSET) { *(.dynstr) }
Expand All @@ -202,6 +203,7 @@ SECTIONS
__rela_dyn_start = .;
*(.rela*)
}
#endif

/* Fake ELF header containing RPA note; for addnote */
.fakeelf : AT(ADDR(.fakeelf) - LOAD_OFFSET) { *(.fakeelf) }
Expand Down

0 comments on commit 2a4b9c5

Please sign in to comment.