* Re: non-modular 2.6 ppc kernels miscompiled by gcc-3.3.1?
@ 2003-10-12 21:45 Mikael Pettersson
0 siblings, 0 replies; 7+ messages in thread
From: Mikael Pettersson @ 2003-10-12 21:45 UTC (permalink / raw)
To: sam; +Cc: benh, linux-kernel, linuxppc-dev
On Sun, 12 Oct 2003 21:53:55 +0200, Sam Ravnborg wrote:
>On Sun, Oct 12, 2003 at 09:47:48PM +0200, Mikael Pettersson wrote:
>> Notice __start___ex_table[]'s address: it's not 4-byte aligned.
>> With gcc-3.2.3 it got an 8-byte aligned address in my 2.6 kernel.
>>
>> vmlinux.lds.S doesn't explicitly align __start___ex_table, so I
>> simply put ". = ALIGN(4);" before it and Voila! now it works.
>
>ld will aling the section according to alingment requirements
>of the symbols inside the section.
>So what happens in your case is that . (current address) is
>un-even. But ld alings the section to a 4-byte boundary,
>due to one of the symbols inside the section.
>
>So the better fix is to define the lables inside the section,
>(read: inside the two '{}').
>
>Care to give my patch a check and report back.
Yes, your patch also works.
/Mikael
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: non-modular 2.6 ppc kernels miscompiled by gcc-3.3.1?
2003-10-12 18:19 ` Sam Ravnborg
@ 2003-10-13 16:05 ` Tom Rini
0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2003-10-13 16:05 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Mikael Pettersson, Linux Kernel list,
linuxppc-dev list, Sam Ravnborg
On Sun, Oct 12, 2003 at 08:19:50PM +0200, Sam Ravnborg wrote:
>
> On Sun, Oct 12, 2003 at 03:19:22PM +0200, Benjamin Herrenschmidt wrote:
> > Smells like some section alignement issues. Can you check
> > how the __ex_table section is aligned and where __start___ex_table
> > points to ? (using objdump)
>
> Or you could try to apply the following patch - it will fix mis-
> alignmnet of above section.
Applied. Thanks.
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: non-modular 2.6 ppc kernels miscompiled by gcc-3.3.1?
2003-10-12 19:47 Mikael Pettersson
@ 2003-10-12 19:53 ` Sam Ravnborg
0 siblings, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2003-10-12 19:53 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: benh, linux-kernel, linuxppc-dev, sam
On Sun, Oct 12, 2003 at 09:47:48PM +0200, Mikael Pettersson wrote:
> Notice __start___ex_table[]'s address: it's not 4-byte aligned.
> With gcc-3.2.3 it got an 8-byte aligned address in my 2.6 kernel.
>
> vmlinux.lds.S doesn't explicitly align __start___ex_table, so I
> simply put ". = ALIGN(4);" before it and Voila! now it works.
ld will aling the section according to alingment requirements
of the symbols inside the section.
So what happens in your case is that . (current address) is
un-even. But ld alings the section to a 4-byte boundary,
due to one of the symbols inside the section.
So the better fix is to define the lables inside the section,
(read: inside the two '{}').
Care to give my patch a check and report back.
Sam
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: non-modular 2.6 ppc kernels miscompiled by gcc-3.3.1?
@ 2003-10-12 19:47 Mikael Pettersson
2003-10-12 19:53 ` Sam Ravnborg
0 siblings, 1 reply; 7+ messages in thread
From: Mikael Pettersson @ 2003-10-12 19:47 UTC (permalink / raw)
To: benh; +Cc: linux-kernel, linuxppc-dev, sam
On Sun, 12 Oct 2003 15:19:22 +0200, Benjamin Herrenschmidt wrote:
>On Sun, 2003-10-12 at 15:10, Mikael Pettersson wrote:
>> When I compile a non-modular 2.6 kernel for ppc with gcc-3.3.1,
>> it oopses in __copy_tofrom_user() [copy_mount_options()] in
>> user-space's first mount /proc call. User-space limps along
>> for a while, oopsing in every mount call, and then hangs.
>>
>> This occurs with 2.6.0-test5, test6, and the test7-based
>> linuxppc-2.5 tree (rsync:ed today).
>>
>> Enabling CONFIG_MODULES=y but still keeping everything built-in
>> prevents the oopses.
>
>Smells like some section alignement issues. Can you check
>how the __ex_table section is aligned and where __start___ex_table
>points to ? (using objdump)
You're right, it turned out to be an alignment issue. Here's what
my System.map looks like with gcc-3.3.1 and CONFIG_MODULES=n:
c017ba4d ? __start___kcrctab
c017ba4d ? __start___kcrctab_gpl
c017ba4d ? __start___ksymtab
c017ba4d ? __start___ksymtab_gpl
c017ba4d ? __stop___kcrctab
c017ba4d ? __stop___kcrctab_gpl
c017ba4d ? __stop___ksymtab
c017ba4d ? __stop___ksymtab_gpl
c017ba4d A __start___ex_table
c017cf08 A __start___bug_table
c017cf08 A __stop___ex_table
c01801c8 A __stop___bug_table
Notice __start___ex_table[]'s address: it's not 4-byte aligned.
With gcc-3.2.3 it got an 8-byte aligned address in my 2.6 kernel.
vmlinux.lds.S doesn't explicitly align __start___ex_table, so I
simply put ". = ALIGN(4);" before it and Voila! now it works.
/Mikael
--- linuxppc-2.5/arch/ppc/kernel/vmlinux.lds.S.~1~ 2003-09-28 12:19:36.000000000 +0200
+++ linuxppc-2.5/arch/ppc/kernel/vmlinux.lds.S 2003-10-12 21:16:24.121283928 +0200
@@ -47,6 +47,7 @@
.fixup : { *(.fixup) }
+ . = ALIGN(4);
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__stop___ex_table = .;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: non-modular 2.6 ppc kernels miscompiled by gcc-3.3.1?
2003-10-12 13:19 ` Benjamin Herrenschmidt
@ 2003-10-12 18:19 ` Sam Ravnborg
2003-10-13 16:05 ` Tom Rini
0 siblings, 1 reply; 7+ messages in thread
From: Sam Ravnborg @ 2003-10-12 18:19 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Mikael Pettersson, Linux Kernel list, linuxppc-dev list
On Sun, Oct 12, 2003 at 03:19:22PM +0200, Benjamin Herrenschmidt wrote:
> Smells like some section alignement issues. Can you check
> how the __ex_table section is aligned and where __start___ex_table
> points to ? (using objdump)
Or you could try to apply the following patch - it will fix mis-
alignmnet of above section.
Sam
===== arch/ppc/kernel/vmlinux.lds.S 1.24 vs edited =====
--- 1.24/arch/ppc/kernel/vmlinux.lds.S Fri Sep 12 18:26:52 2003
+++ edited/arch/ppc/kernel/vmlinux.lds.S Sun Oct 12 20:17:25 2003
@@ -47,13 +47,17 @@
.fixup : { *(.fixup) }
- __start___ex_table = .;
- __ex_table : { *(__ex_table) }
- __stop___ex_table = .;
+ __ex_table : {
+ __start___ex_table = .;
+ *(__ex_table)
+ __stop___ex_table = .;
+ }
- __start___bug_table = .;
- __bug_table : { *(__bug_table) }
- __stop___bug_table = .;
+ __bug_table : {
+ __start___bug_table = .;
+ *(__bug_table)
+ __stop___bug_table = .;
+ }
/* Read-write section, merged into data segment: */
. = ALIGN(4096);
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: non-modular 2.6 ppc kernels miscompiled by gcc-3.3.1?
2003-10-12 13:10 Mikael Pettersson
@ 2003-10-12 13:19 ` Benjamin Herrenschmidt
2003-10-12 18:19 ` Sam Ravnborg
0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2003-10-12 13:19 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: Linux Kernel list, linuxppc-dev list
On Sun, 2003-10-12 at 15:10, Mikael Pettersson wrote:
> When I compile a non-modular 2.6 kernel for ppc with gcc-3.3.1,
> it oopses in __copy_tofrom_user() [copy_mount_options()] in
> user-space's first mount /proc call. User-space limps along
> for a while, oopsing in every mount call, and then hangs.
>
> This occurs with 2.6.0-test5, test6, and the test7-based
> linuxppc-2.5 tree (rsync:ed today).
>
> Enabling CONFIG_MODULES=y but still keeping everything built-in
> prevents the oopses.
Smells like some section alignement issues. Can you check
how the __ex_table section is aligned and where __start___ex_table
points to ? (using objdump)
Ben.
^ permalink raw reply [flat|nested] 7+ messages in thread
* non-modular 2.6 ppc kernels miscompiled by gcc-3.3.1?
@ 2003-10-12 13:10 Mikael Pettersson
2003-10-12 13:19 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 7+ messages in thread
From: Mikael Pettersson @ 2003-10-12 13:10 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev
When I compile a non-modular 2.6 kernel for ppc with gcc-3.3.1,
it oopses in __copy_tofrom_user() [copy_mount_options()] in
user-space's first mount /proc call. User-space limps along
for a while, oopsing in every mount call, and then hangs.
This occurs with 2.6.0-test5, test6, and the test7-based
linuxppc-2.5 tree (rsync:ed today).
Enabling CONFIG_MODULES=y but still keeping everything built-in
prevents the oopses.
With gcc-3.2.3 there are no problems.
I don't have a serial console to the ppc box (weird mac serial
port), but I can try to manually type down and decode the first
oops if necessary.
/Mikael
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-10-13 16:05 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-12 21:45 non-modular 2.6 ppc kernels miscompiled by gcc-3.3.1? Mikael Pettersson
-- strict thread matches above, loose matches on Subject: below --
2003-10-12 19:47 Mikael Pettersson
2003-10-12 19:53 ` Sam Ravnborg
2003-10-12 13:10 Mikael Pettersson
2003-10-12 13:19 ` Benjamin Herrenschmidt
2003-10-12 18:19 ` Sam Ravnborg
2003-10-13 16:05 ` Tom Rini
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).