* [HOW] binutils-2.17 breaks the 2.6.26 kernel
@ 2008-07-16 16:21 Milton Miller
2008-07-16 23:41 ` Segher Boessenkool
2008-07-17 0:38 ` Jon Smirl
0 siblings, 2 replies; 6+ messages in thread
From: Milton Miller @ 2008-07-16 16:21 UTC (permalink / raw)
To: ppcdev; +Cc: Alan Modra
Hi.
I've been working with Debian bintuils 2.17-3 (which identifies
itself as 2.17) on my build box for some time.
When testing all-yes-config, I was getting warnings, but the
vmlinux was booting via kexec.
Since I was replicating the warnings from BFD about section lmas
overlapping in vmlinux.strip.$$, I was encouraged to actually try
booting the resulting stripped kernel. After a false start (getting
the old binary) I ended up replicating the fail-to-boot some people
have reported on linuxppc-dev.
Digging into the failure, we were trying to copy *way* too much data
in copy_and_flush from after_prom. I found the value loaded from
_klimit was something like 0x00002fea_00400000, not quite _end that
it was initialized.
I tracked this down to the .rodata and all sections following loosing
the inter-section alignment.
/DISCARD/ {
....
}
text: AT( .text - LOAD_OFFSET): {
....
}
. = ALIGN(0x1000) /* this align directive aparently gets lost
when stripping the file */
.rodata: AT (.rodata - LOAD_OFFSET): {
...
}
the effects of that align were dropped during strip, shifting all
following sections up in memory and the resulting failure.
I don't know if the fault is ld or strip.
The behavior came between 2.6.24 and -next-20080710, but others
have suggested their kernels don't boot in the 2.6.25 to 2.6.26
transition, and a likely candidate is the addition of AT(x) to
set the lma, although we also switched form TEXT_TEXT macro in
include/asm-generic.h to a hand-rolled .text section.
Can we come up with a workaround?
thanks,
milton
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [HOW] binutils-2.17 breaks the 2.6.26 kernel
2008-07-16 16:21 [HOW] binutils-2.17 breaks the 2.6.26 kernel Milton Miller
@ 2008-07-16 23:41 ` Segher Boessenkool
2008-07-17 0:38 ` Jon Smirl
1 sibling, 0 replies; 6+ messages in thread
From: Segher Boessenkool @ 2008-07-16 23:41 UTC (permalink / raw)
To: Milton Miller; +Cc: ppcdev, Alan Modra
> . = ALIGN(0x1000) /* this align directive aparently gets lost
> when stripping the file */
>
> .rodata: AT (.rodata - LOAD_OFFSET): {
> ...
> }
>
> the effects of that align were dropped during strip, shifting all
> following sections up in memory and the resulting failure.
The ELF headers show the .rodata section to have 256 byte alignment
only, but after the "bad" strip it isn't even aligned to that
anymore (file offset). Curious.
I still can't reproduce this, but getting the bad binary now (it's
huge, heh). We'll see.
Segher
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [HOW] binutils-2.17 breaks the 2.6.26 kernel
2008-07-16 16:21 [HOW] binutils-2.17 breaks the 2.6.26 kernel Milton Miller
2008-07-16 23:41 ` Segher Boessenkool
@ 2008-07-17 0:38 ` Jon Smirl
2008-07-17 0:49 ` Gabriel Paubert
2008-07-17 13:53 ` Segher Boessenkool
1 sibling, 2 replies; 6+ messages in thread
From: Jon Smirl @ 2008-07-17 0:38 UTC (permalink / raw)
To: Milton Miller; +Cc: ppcdev, Alan Modra
On 7/16/08, Milton Miller <miltonm@bga.com> wrote:
> Hi.
Previous threads have mentioned that binutil-2.17 is broken for
building powerpc kernels. It is fixed in binutils-2.18.
I have encountered this and upgrading to 2.18 fixed my build. The
symptom is large kernel sizes and a long time in gzip. In my case it
was gziping a 2GB file.
>
> I've been working with Debian bintuils 2.17-3 (which identifies
> itself as 2.17) on my build box for some time.
>
> When testing all-yes-config, I was getting warnings, but the
> vmlinux was booting via kexec.
>
> Since I was replicating the warnings from BFD about section lmas
> overlapping in vmlinux.strip.$$, I was encouraged to actually try
> booting the resulting stripped kernel. After a false start (getting
> the old binary) I ended up replicating the fail-to-boot some people
> have reported on linuxppc-dev.
>
> Digging into the failure, we were trying to copy *way* too much data
> in copy_and_flush from after_prom. I found the value loaded from
> _klimit was something like 0x00002fea_00400000, not quite _end that
> it was initialized.
>
> I tracked this down to the .rodata and all sections following loosing
> the inter-section alignment.
>
>
> /DISCARD/ {
> ....
> }
> text: AT( .text - LOAD_OFFSET): {
> ....
> }
>
> . = ALIGN(0x1000) /* this align directive aparently gets lost
> when stripping the file */
>
> .rodata: AT (.rodata - LOAD_OFFSET): {
> ...
> }
>
> the effects of that align were dropped during strip, shifting all
> following sections up in memory and the resulting failure.
>
> I don't know if the fault is ld or strip.
>
> The behavior came between 2.6.24 and -next-20080710, but others
> have suggested their kernels don't boot in the 2.6.25 to 2.6.26
> transition, and a likely candidate is the addition of AT(x) to
> set the lma, although we also switched form TEXT_TEXT macro in
> include/asm-generic.h to a hand-rolled .text section.
>
> Can we come up with a workaround?
>
> thanks,
> milton
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [HOW] binutils-2.17 breaks the 2.6.26 kernel
2008-07-17 0:38 ` Jon Smirl
@ 2008-07-17 0:49 ` Gabriel Paubert
2008-07-17 13:53 ` Segher Boessenkool
1 sibling, 0 replies; 6+ messages in thread
From: Gabriel Paubert @ 2008-07-17 0:49 UTC (permalink / raw)
To: Jon Smirl; +Cc: ppcdev, Alan Modra, Milton Miller
On Wed, Jul 16, 2008 at 08:38:14PM -0400, Jon Smirl wrote:
> On 7/16/08, Milton Miller <miltonm@bga.com> wrote:
> > Hi.
>
> Previous threads have mentioned that binutil-2.17 is broken for
> building powerpc kernels. It is fixed in binutils-2.18.
>
> I have encountered this and upgrading to 2.18 fixed my build. The
> symptom is large kernel sizes and a long time in gzip. In my case it
> was gziping a 2GB file.
Only? Mine was over 3GB :-)
I've not yet had time to update the binutils (the machine has
a standard Debian Etch and I have trouble when adding Lenny
sources).
I also bisected it for fun and got 366234f6 as the culprit.
Gabriel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [HOW] binutils-2.17 breaks the 2.6.26 kernel
2008-07-17 0:38 ` Jon Smirl
2008-07-17 0:49 ` Gabriel Paubert
@ 2008-07-17 13:53 ` Segher Boessenkool
2008-07-21 16:49 ` Rune Torgersen
1 sibling, 1 reply; 6+ messages in thread
From: Segher Boessenkool @ 2008-07-17 13:53 UTC (permalink / raw)
To: Jon Smirl; +Cc: ppcdev, Alan Modra, Milton Miller
> Previous threads have mentioned that binutil-2.17 is broken for
> building powerpc kernels. It is fixed in binutils-2.18.
Yes.
> I have encountered this and upgrading to 2.18 fixed my build. The
> symptom is large kernel sizes and a long time in gzip. In my case it
> was gziping a 2GB file.
Are you using a "binary" (non-ELF) image file? This sounds like a
different problem, caused by the kernel linker script not handling
the build-id section correctly -- it places it at 0, and the rest
of the kernel at 3GB, you can imagine the rest. I've seen this
on various embedded targets, but not on PowerPC iirc -- maybe I
don't build any affected defconfig, what's yours?
I have a working (tested! thanks Milton) workaround for the current
problem, will send it later today. This problem funnily is hidden
by the presence of build-id :-)
Segher
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [HOW] binutils-2.17 breaks the 2.6.26 kernel
2008-07-17 13:53 ` Segher Boessenkool
@ 2008-07-21 16:49 ` Rune Torgersen
0 siblings, 0 replies; 6+ messages in thread
From: Rune Torgersen @ 2008-07-21 16:49 UTC (permalink / raw)
To: Segher Boessenkool, Jon Smirl; +Cc: ppcdev, Milton Miller
> From: Segher Boessenkool
> > Previous threads have mentioned that binutil-2.17 is broken for
> > building powerpc kernels. It is fixed in binutils-2.18.
>=20
> I have a working (tested! thanks Milton) workaround for the current
> problem, will send it later today. This problem funnily is hidden
> by the presence of build-id :-)
Did you ever send this patch? I'd like to try it as I cannot compile a
arch/powerpc 2.6.265 kernel right now.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-07-21 16:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-16 16:21 [HOW] binutils-2.17 breaks the 2.6.26 kernel Milton Miller
2008-07-16 23:41 ` Segher Boessenkool
2008-07-17 0:38 ` Jon Smirl
2008-07-17 0:49 ` Gabriel Paubert
2008-07-17 13:53 ` Segher Boessenkool
2008-07-21 16:49 ` Rune Torgersen
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).