* Kernel build issues with upstream binutils
@ 2016-11-26 22:04 Anton Blanchard
2016-11-27 13:35 ` Nicholas Piggin
0 siblings, 1 reply; 4+ messages in thread
From: Anton Blanchard @ 2016-11-26 22:04 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Nicholas Piggin
Cc: linuxppc-dev
Hi,
A recent binutils commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=1a9ccd70f9a75dc6b48d340059f28ef3550c107b
has broken kernel builds:
/home/anton/gcc.install/bin/ld: arch/powerpc/boot/zImage.pseries: Not enough room for program headers, try linking with -N
/home/anton/gcc.install/bin/ld: final link failed: Bad value
I guess we have an issue with our linker script.
Anton
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Kernel build issues with upstream binutils
2016-11-26 22:04 Kernel build issues with upstream binutils Anton Blanchard
@ 2016-11-27 13:35 ` Nicholas Piggin
2017-07-17 12:57 ` Gustavo Romero
0 siblings, 1 reply; 4+ messages in thread
From: Nicholas Piggin @ 2016-11-27 13:35 UTC (permalink / raw)
To: Anton Blanchard
Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
linuxppc-dev
On Sun, 27 Nov 2016 09:04:30 +1100
Anton Blanchard <anton@samba.org> wrote:
> Hi,
>
> A recent binutils commit:
>
> https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=1a9ccd70f9a75dc6b48d340059f28ef3550c107b
>
> has broken kernel builds:
>
> /home/anton/gcc.install/bin/ld: arch/powerpc/boot/zImage.pseries: Not enough room for program headers, try linking with -N
> /home/anton/gcc.install/bin/ld: final link failed: Bad value
>
> I guess we have an issue with our linker script.
We may need something like this (not boot tested). I'll have a better look
tomorrow.
---
arch/powerpc/boot/zImage.lds.S | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/boot/zImage.lds.S b/arch/powerpc/boot/zImage.lds.S
index 861e721..8963544 100644
--- a/arch/powerpc/boot/zImage.lds.S
+++ b/arch/powerpc/boot/zImage.lds.S
@@ -7,6 +7,13 @@ OUTPUT_ARCH(powerpc:common)
#endif
ENTRY(_zimage_start)
EXTERN(_zimage_start)
+
+PHDRS
+{
+ text PT_LOAD FLAGS(5); /* R_E */
+ data PT_LOAD FLAGS(6); /* RW_ */
+}
+
SECTIONS
{
.text :
@@ -15,7 +22,7 @@ SECTIONS
*(.text)
*(.fixup)
_etext = .;
- }
+ } :text
. = ALIGN(4096);
.data :
{
@@ -25,7 +32,7 @@ SECTIONS
#ifndef CONFIG_PPC64_BOOT_WRAPPER
*(.got2)
#endif
- }
+ } :data
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.dynamic :
@@ -34,7 +41,6 @@ SECTIONS
*(.dynamic)
}
.hash : { *(.hash) }
- .interp : { *(.interp) }
.rela.dyn :
{
#ifdef CONFIG_PPC64_BOOT_WRAPPER
@@ -86,4 +92,9 @@ SECTIONS
*(COMMON)
_end = . ;
}
+
+ /DISCARD/ :
+ {
+ *(.interp)
+ }
}
--
2.10.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Kernel build issues with upstream binutils
2016-11-27 13:35 ` Nicholas Piggin
@ 2017-07-17 12:57 ` Gustavo Romero
2017-07-17 13:05 ` Gustavo Romero
0 siblings, 1 reply; 4+ messages in thread
From: Gustavo Romero @ 2017-07-17 12:57 UTC (permalink / raw)
To: linuxppc-dev
Hi,
On bissecting kernel on Debian (gcc version 6.3.0 20170516) I've got the same
error on linking kernels <= v4.9 as reported previously in this thread:
ld: arch/powerpc/boot/zImage.pseries: Not enough room for program headers, try linking with -N
ld: final link failed: Bad value
arch/powerpc/boot/Makefile:364: recipe for target 'arch/powerpc/boot/zImage.pseries' failed
make[1]: *** [arch/powerpc/boot/zImage.pseries] Error 1
arch/powerpc/Makefile:278: recipe for target 'zImage' failed
make: *** [zImage] Error 2
Applying the fix proposed by Nicholas resolved the issue.
However that patch is not present - afaics - in > v4.9 (where it builds fine).
Any clue on why that is happening on <= v4.9 but not on kernels above that?
Thank you.
Regards,
Gustavo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Kernel build issues with upstream binutils
2017-07-17 12:57 ` Gustavo Romero
@ 2017-07-17 13:05 ` Gustavo Romero
0 siblings, 0 replies; 4+ messages in thread
From: Gustavo Romero @ 2017-07-17 13:05 UTC (permalink / raw)
To: linuxppc-dev
No sure if in reply-to took correct effect, so I'm posting the thread ref explicit:
https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-November/151672.html
On 17-07-2017 09:57, Gustavo Romero wrote:
> Hi,
>
> On bissecting kernel on Debian (gcc version 6.3.0 20170516) I've got the same
> error on linking kernels <= v4.9 as reported previously in this thread:
>
> ld: arch/powerpc/boot/zImage.pseries: Not enough room for program headers, try linking with -N
> ld: final link failed: Bad value
> arch/powerpc/boot/Makefile:364: recipe for target 'arch/powerpc/boot/zImage.pseries' failed
> make[1]: *** [arch/powerpc/boot/zImage.pseries] Error 1
> arch/powerpc/Makefile:278: recipe for target 'zImage' failed
> make: *** [zImage] Error 2
>
> Applying the fix proposed by Nicholas resolved the issue.
>
> However that patch is not present - afaics - in > v4.9 (where it builds fine).
>
> Any clue on why that is happening on <= v4.9 but not on kernels above that?
>
> Thank you.
>
>
> Regards,
> Gustavo
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-07-17 13:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-26 22:04 Kernel build issues with upstream binutils Anton Blanchard
2016-11-27 13:35 ` Nicholas Piggin
2017-07-17 12:57 ` Gustavo Romero
2017-07-17 13:05 ` Gustavo Romero
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).