linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Work around ld bug in older binutils
@ 2008-10-23  4:43 Paul Mackerras
  2008-10-28  0:58 ` Sean MacLennan
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Mackerras @ 2008-10-23  4:43 UTC (permalink / raw)
  To: linuxppc-dev

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>
---
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index b39c27e..384dca5 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -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) }
@@ -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) }

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

* Re: [PATCH] Work around ld bug in older binutils
  2008-10-23  4:43 [PATCH] Work around ld bug in older binutils Paul Mackerras
@ 2008-10-28  0:58 ` Sean MacLennan
  2008-10-28  3:05   ` Paul Mackerras
  0 siblings, 1 reply; 3+ messages in thread
From: Sean MacLennan @ 2008-10-28  0:58 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

On Thu, 23 Oct 2008 15:43:45 +1100
Paul Mackerras <paulus@samba.org> wrote:

> 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.

I'd like to try this. I did a git revert to back out the aforementioned
commit. How do I get it back? Do I git revert again?

Cheers,
   Sean

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

* Re: [PATCH] Work around ld bug in older binutils
  2008-10-28  0:58 ` Sean MacLennan
@ 2008-10-28  3:05   ` Paul Mackerras
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Mackerras @ 2008-10-28  3:05 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev

Sean MacLennan writes:

> I'd like to try this. I did a git revert to back out the aforementioned
> commit. How do I get it back? Do I git revert again?

You could revert the reversion, or else rebase any patches you have on
top of the reversion onto the commit before the reversion.

Paul.

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

end of thread, other threads:[~2008-10-28  3:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-23  4:43 [PATCH] Work around ld bug in older binutils Paul Mackerras
2008-10-28  0:58 ` Sean MacLennan
2008-10-28  3:05   ` Paul Mackerras

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).