2003-05-02 17:01:55

by Adrian Bunk

[permalink] [raw]
Subject: 2.5.68-bk11: .text.exit errors in .altinstructions

Hi Andi,

I'm getting the following .text.exit errors in 2.5.68-bk11 (kernel
compiled with gcc 2.95 for a K6):

<-- snip -->

./drivers/hotplug/pci_hotplug.o(.altinstructions+0xa8): undefined
reference to `local symbols in discarded section .exit.text'
./drivers/hotplug/pci_hotplug.o(.altinstructions+0xb4): undefined
reference to `local symbols in discarded section .exit.text'
./drivers/hotplug/cpci_hotplug_core.o(.altinstructions+0x90): undefined
reference to `local symbols in discarded section .exit.text'
./drivers/hotplug/cpci_hotplug_core.o(.altinstructions+0x9c): undefined
reference to `local symbols in discarded section .exit.text'
./drivers/hotplug/built-in.o(.altinstructions+0xa8): undefined reference
to `local symbols in discarded section .exit.text'
./drivers/hotplug/built-in.o(.altinstructions+0xb4): more undefined
references to `local symbols in discarded section .exit.text' follow

<-- snip -->

The strange thing is that all errors are in .altinstructions, the files
seem to be OK, and the problem wasn't present in earlier kernel
versions.

Disassembled .altinstructions from drivers/hotplug/cpci_hotplug_core.o:

<-- snip -->

Disassembly of section .altinstructions:

00000000 <.altinstructions>:
0: df 0a (bad) (%edx)
2: 00 00 add %al,(%eax)
4: 00 00 add %al,(%eax)
6: 00 00 add %al,(%eax)
8: 19 04 03 sbb %eax,(%ebx,%eax,1)
b: 00 6e 0b add %ch,0xb(%esi)
e: 00 00 add %al,(%eax)
10: 03 00 add (%eax),%eax
12: 00 00 add %al,(%eax)
14: 19 04 03 sbb %eax,(%ebx,%eax,1)
17: 00 5e 0d add %bl,0xd(%esi)
1a: 00 00 add %al,(%eax)
1c: 06 push %es
1d: 00 00 add %al,(%eax)
1f: 00 19 add %bl,(%ecx)
21: 04 03 add $0x3,%al
23: 00 94 0d 00 00 09 00 add %dl,0x90000(%ebp,%ecx,1)
2a: 00 00 add %al,(%eax)
2c: 19 04 03 sbb %eax,(%ebx,%eax,1)
2f: 00 68 10 add %ch,0x10(%eax)
32: 00 00 add %al,(%eax)
34: 0c 00 or $0x0,%al
36: 00 00 add %al,(%eax)
38: 19 04 03 sbb %eax,(%ebx,%eax,1)
3b: 00 65 11 add %ah,0x11(%ebp)
3e: 00 00 add %al,(%eax)
40: 0f 00 00 sldtl (%eax)
43: 00 19 add %bl,(%ecx)
45: 04 03 add $0x3,%al
47: 00 87 13 00 00 12 add %al,0x12000013(%edi)
4d: 00 00 add %al,(%eax)
4f: 00 19 add %bl,(%ecx)
51: 04 03 add $0x3,%al
53: 00 3d 16 00 00 15 add %bh,0x15000016
59: 00 00 add %al,(%eax)
5b: 00 19 add %bl,(%ecx)
5d: 04 03 add $0x3,%al
5f: 00 88 19 00 00 18 add %cl,0x18000019(%eax)
65: 00 00 add %al,(%eax)
67: 00 19 add %bl,(%ecx)
69: 04 03 add $0x3,%al
6b: 00 dc add %bl,%ah
6d: 19 00 sbb %eax,(%eax)
6f: 00 1b add %bl,(%ebx)
71: 00 00 add %al,(%eax)
73: 00 19 add %bl,(%ecx)
75: 04 03 add $0x3,%al
77: 00 58 1c add %bl,0x1c(%eax)
7a: 00 00 add %al,(%eax)
7c: 1e push %ds
7d: 00 00 add %al,(%eax)
7f: 00 19 add %bl,(%ecx)
81: 04 03 add $0x3,%al
83: 00 ac 1c 00 00 21 00 add %ch,0x210000(%esp,%ebx,1)
8a: 00 00 add %al,(%eax)
8c: 19 04 03 sbb %eax,(%ebx,%eax,1)
8f: 00 b7 00 00 00 24 add %dh,0x24000000(%edi)
95: 00 00 add %al,(%eax)
97: 00 19 add %bl,(%ecx)
99: 04 03 add $0x3,%al
9b: 00 05 01 00 00 27 add %al,0x27000001
a1: 00 00 add %al,(%eax)
a3: 00 19 add %bl,(%ecx)
a5: 04 03 add $0x3,%al

<-- snip -->


cu
Adrian




2003-05-02 18:41:41

by Andi Kleen

[permalink] [raw]
Subject: Re: 2.5.68-bk11: .text.exit errors in .altinstructions

On Fri, May 02, 2003 at 07:13:56PM +0200, Adrian Bunk wrote:
> Hi Andi,
>
> I'm getting the following .text.exit errors in 2.5.68-bk11 (kernel
> compiled with gcc 2.95 for a K6):

That's what I feared. You have a prefetch or mb() in an __exit
function. Basically it's an binutils design bug, but hard to fix
according to the binutils hackers.

The only fix I know currently is to remove the .exit.text
discard from arch/i386/vmlinux.lds.S. It'll increase the kernel
text size slightly because functions that would only be needed
for module unload in some drivers will be compiled in too.
But it's probably not too bad, at worst a few KB.

-Andi

Index: linux/arch/i386/vmlinux.lds.S
===================================================================
RCS file: /home/cvs/linux-2.5/arch/i386/vmlinux.lds.S,v
retrieving revision 1.18
diff -u -u -r1.18 vmlinux.lds.S
--- linux/arch/i386/vmlinux.lds.S 30 Apr 2003 14:32:05 -0000 1.18
+++ linux/arch/i386/vmlinux.lds.S 2 May 2003 17:52:38 -0000
@@ -106,7 +106,6 @@

/* Sections to be discarded */
/DISCARD/ : {
- *(.exit.text)
*(.exit.data)
*(.exitcall.exit)
}






2003-05-03 18:30:06

by Ingo Oeser

[permalink] [raw]
Subject: Re: 2.5.68-bk11: .text.exit errors in .altinstructions

On Fri, May 02, 2003 at 08:52:29PM +0200, Andi Kleen wrote:
> The only fix I know currently is to remove the .exit.text
> discard from arch/i386/vmlinux.lds.S. It'll increase the kernel
> text size slightly because functions that would only be needed
> for module unload in some drivers will be compiled in too.
> But it's probably not too bad, at worst a few KB.

What is that .altinstructions stuff?

I'm having a hard time to understand, what it should do, and why
it is desperately needed.

Regards

Ingo Oeser

Subject: Re: 2.5.68-bk11: .text.exit errors in .altinstructions

I've got the same problem with 2.5.69:

ld -m elf_i386 -T arch/i386/vmlinux.lds.s arch/i386/kernel/head.o arch/i386/kernel/init_task.o
init/built-in.o --start-group usr/built-in.o arch/i386/kernel/built-in.o arch/i386/mm/built-in.o
arch/i386/mach-default/built-in.o kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o
security/built-in.o crypto/built-in.o lib/lib.a arch/i386/lib/lib.a drivers/built-in.o sound/built-in.o
arch/i386/pci/built-in.o net/built-in.o --end-group -o .tmp_vmlinux1
drivers/built-in.o(.altinstructions+0x123c): undefined reference to `local symbols in discarded section .exit.text'
drivers/built-in.o(.altinstructions+0x1248): undefined reference to `local symbols in discarded section .exit.text'
make: *** [.tmp_vmlinux1] Error 1

config attached, this is sony vaio thing.
gcc latest from unstable debian:
gj@nalesnik:~$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.3

binutils 2.13.90.0.18-1
(i guess that is problemmaker aka firestarter :] )

--
Grzegorz Jaskiewicz <[email protected]>
K4 labs


Attachments:
.config (29.23 kB)

2003-05-06 00:42:21

by Andi Kleen

[permalink] [raw]
Subject: Re: 2.5.68-bk11: .text.exit errors in .altinstructions

On Tue, May 06, 2003 at 01:04:55AM +0200, Grzegorz Jaskiewicz wrote:
> I've got the same problem with 2.5.69:

Use the same workaround. Remove .text.exit from the DISCARD
section in your vmlinux.lds.S

Really the problem is unfixable without binutils changes in other
ways, sorry.

-Andi

2003-05-06 02:00:00

by Andrew Morton

[permalink] [raw]
Subject: Re: 2.5.68-bk11: .text.exit errors in .altinstructions

Andi Kleen <[email protected]> wrote:
>
> On Tue, May 06, 2003 at 01:04:55AM +0200, Grzegorz Jaskiewicz wrote:
> > I've got the same problem with 2.5.69:
>
> Use the same workaround. Remove .text.exit from the DISCARD
> section in your vmlinux.lds.S
>
> Really the problem is unfixable without binutils changes in other
> ways, sorry.

How's about we drop .text.exit at runtime, along with .text.init?


2003-05-06 05:02:53

by Andi Kleen

[permalink] [raw]
Subject: Re: 2.5.68-bk11: .text.exit errors in .altinstructions

On Tue, May 06, 2003 at 04:14:09AM +0200, Andrew Morton wrote:
> Andi Kleen <[email protected]> wrote:
> >
> > On Tue, May 06, 2003 at 01:04:55AM +0200, Grzegorz Jaskiewicz wrote:
> > > I've got the same problem with 2.5.69:
> >
> > Use the same workaround. Remove .text.exit from the DISCARD
> > section in your vmlinux.lds.S
> >
> > Really the problem is unfixable without binutils changes in other
> > ways, sorry.
>
> How's about we drop .text.exit at runtime, along with .text.init?

Good idea :-) That could work.

-Andi

Subject: Re: 2.5.68-bk11: .text.exit errors in .altinstructions

On Tue, 2003-05-06 at 06:13, Andi Kleen wrote:
> On Tue, May 06, 2003 at 04:14:09AM +0200, Andrew Morton wrote:
> > Andi Kleen <[email protected]> wrote:
> > >
> > > On Tue, May 06, 2003 at 01:04:55AM +0200, Grzegorz Jaskiewicz wrote:
> > > > I've got the same problem with 2.5.69:
> > >
> > > Use the same workaround. Remove .text.exit from the DISCARD
> > > section in your vmlinux.lds.S
> > >
> > > Really the problem is unfixable without binutils changes in other
> > > ways, sorry.
> >
> > How's about we drop .text.exit at runtime, along with .text.init?
>
> Good idea :-) That could work.
works for me :)

--
Grzegorz Jaskiewicz <[email protected]>
K4 labs