2009-06-16 07:39:03

by Tetsuo Handa

[permalink] [raw]
Subject: [x86] Build error at arch/x86/boot/bioscall.S

Hello.

I tried to build 03347e2592078a90df818670fddf97a33eec70fb and got this error.

(...snipped...)
WARNING: modpost: Found 2 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
/usr/src/all/linux/kernel/git/torvalds/linux-2.6.git/usr/include/linux/netfilter/xt_osf.h:40: found __[us]{8,16,32,64} type without #include <linux/types.h>
/usr/src/all/linux/kernel/git/torvalds/linux-2.6.git/usr/include/mtd/jffs2-user.h:21: userspace cannot call function or variable defined in the kernel
Documentation/accounting/getdelays.c: In function `main':
Documentation/accounting/getdelays.c:249: warning: `cmd_type' might be used uninitialized in this function
Documentation/spi/spidev_fdx.c: In function `do_msg':
Documentation/spi/spidev_fdx.c:61: warning: cast from pointer to integer of different size
Documentation/spi/spidev_fdx.c:64: warning: cast from pointer to integer of different size
arch/x86/boot/bioscall.S: Assembler messages:
arch/x86/boot/bioscall.S:68: Error: `68(%esp)' is not a valid 16 bit base/index expression
make[1]: *** [arch/x86/boot/bioscall.o] Error 1
make: *** [bzImage] Error 2

# gcc --version
gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Regards.


2009-06-16 08:12:53

by Cong Wang

[permalink] [raw]
Subject: Re: [x86] Build error at arch/x86/boot/bioscall.S

On Tue, Jun 16, 2009 at 04:38:54PM +0900, Tetsuo Handa wrote:
>Hello.
>
>I tried to build 03347e2592078a90df818670fddf97a33eec70fb and got this error.
>
>(...snipped...)
>WARNING: modpost: Found 2 section mismatch(es).
>To see full details build your kernel with:
>'make CONFIG_DEBUG_SECTION_MISMATCH=y'
>/usr/src/all/linux/kernel/git/torvalds/linux-2.6.git/usr/include/linux/netfilter/xt_osf.h:40: found __[us]{8,16,32,64} type without #include <linux/types.h>
>/usr/src/all/linux/kernel/git/torvalds/linux-2.6.git/usr/include/mtd/jffs2-user.h:21: userspace cannot call function or variable defined in the kernel
>Documentation/accounting/getdelays.c: In function `main':
>Documentation/accounting/getdelays.c:249: warning: `cmd_type' might be used uninitialized in this function
>Documentation/spi/spidev_fdx.c: In function `do_msg':
>Documentation/spi/spidev_fdx.c:61: warning: cast from pointer to integer of different size
>Documentation/spi/spidev_fdx.c:64: warning: cast from pointer to integer of different size
>arch/x86/boot/bioscall.S: Assembler messages:
>arch/x86/boot/bioscall.S:68: Error: `68(%esp)' is not a valid 16 bit base/index expression

Huh?
16 bit mode doesn't allow 'esp' to be used as a base/index register?

How about:

- movw 68(%esp), %di
+ movzwl %sp, %ebx
+ movw 68(%ebx), %di

? Does this work?

Thanks.

2009-06-16 08:25:52

by Tetsuo Handa

[permalink] [raw]
Subject: Re: [x86] Build error at arch/x86/boot/bioscall.S

Amerigo Wang wrote:
> How about:
>
> - movw 68(%esp), %di
> + movzwl %sp, %ebx
> + movw 68(%ebx), %di
>
> ? Does this work?
No.

arch/x86/boot/bioscall.S: Assembler messages:
arch/x86/boot/bioscall.S:69: Error: `68(%ebx)' is not a valid 16 bit base/index expression
make[1]: *** [arch/x86/boot/bioscall.o] Error 1
make: *** [bzImage] Error 2

Regards.

2009-06-16 09:28:51

by Cong Wang

[permalink] [raw]
Subject: Re: [x86] Build error at arch/x86/boot/bioscall.S

On Tue, Jun 16, 2009 at 05:25:34PM +0900, Tetsuo Handa wrote:
>Amerigo Wang wrote:
>> How about:
>>
>> - movw 68(%esp), %di
>> + movzwl %sp, %ebx
>> + movw 68(%ebx), %di
>>
>> ? Does this work?
>No.
>
>arch/x86/boot/bioscall.S: Assembler messages:
>arch/x86/boot/bioscall.S:69: Error: `68(%ebx)' is not a valid 16 bit base/index expression
>make[1]: *** [arch/x86/boot/bioscall.o] Error 1
>make: *** [bzImage] Error 2

Ok, how about:

- movw 68(%esp), %di
+ addl $68, %esp
+ popw %di
+ subl $66, %esp

?

2009-06-16 10:00:03

by Michael S. Zick

[permalink] [raw]
Subject: Re: [x86] Build error at arch/x86/boot/bioscall.S

On Tue June 16 2009, Amerigo Wang wrote:
> On Tue, Jun 16, 2009 at 05:25:34PM +0900, Tetsuo Handa wrote:
> >Amerigo Wang wrote:
> >> How about:
> >>
> >> - movw 68(%esp), %di
> >> + movzwl %sp, %ebx
> >> + movw 68(%ebx), %di
> >>
> >> ? Does this work?
> >No.
> >
> >arch/x86/boot/bioscall.S: Assembler messages:
> >arch/x86/boot/bioscall.S:69: Error: `68(%ebx)' is not a valid 16 bit base/index expression
> >make[1]: *** [arch/x86/boot/bioscall.o] Error 1
> >make: *** [bzImage] Error 2
>
> Ok, how about:
>
> - movw 68(%esp), %di
> + addl $68, %esp
> + popw %di
> + subl $66, %esp
>

I do hope you have interrupts disabled around that chunk.
Just how old is the toolchain (some didn't do 16bit worth a sh..)?

Mike

> ?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>

2009-06-16 11:40:39

by Tetsuo Handa

[permalink] [raw]
Subject: Re: [x86] Build error at arch/x86/boot/bioscall.S

Amerigo Wang wrote:
> Ok, how about:
>
> - movw 68(%esp), %di
> + addl $68, %esp
> + popw %di
> + subl $66, %esp
>
> ?
Yes, that works.

Thank you.

2009-06-16 18:33:31

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [x86] Build error at arch/x86/boot/bioscall.S

Tetsuo Handa wrote:
> Hello.
>
> I tried to build 03347e2592078a90df818670fddf97a33eec70fb and got this error.
>
> (...snipped...)
> WARNING: modpost: Found 2 section mismatch(es).
> To see full details build your kernel with:
> 'make CONFIG_DEBUG_SECTION_MISMATCH=y'
> /usr/src/all/linux/kernel/git/torvalds/linux-2.6.git/usr/include/linux/netfilter/xt_osf.h:40: found __[us]{8,16,32,64} type without #include <linux/types.h>
> /usr/src/all/linux/kernel/git/torvalds/linux-2.6.git/usr/include/mtd/jffs2-user.h:21: userspace cannot call function or variable defined in the kernel
> Documentation/accounting/getdelays.c: In function `main':
> Documentation/accounting/getdelays.c:249: warning: `cmd_type' might be used uninitialized in this function
> Documentation/spi/spidev_fdx.c: In function `do_msg':
> Documentation/spi/spidev_fdx.c:61: warning: cast from pointer to integer of different size
> Documentation/spi/spidev_fdx.c:64: warning: cast from pointer to integer of different size
> arch/x86/boot/bioscall.S: Assembler messages:
> arch/x86/boot/bioscall.S:68: Error: `68(%esp)' is not a valid 16 bit base/index expression
> make[1]: *** [arch/x86/boot/bioscall.o] Error 1
> make: *** [bzImage] Error 2
>
> # gcc --version
> gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)
> Copyright (C) 2003 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>

What version of binutils do you have?

What you're seeing is a bug in gas.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

2009-06-16 18:33:42

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [x86] Build error at arch/x86/boot/bioscall.S

Amerigo Wang wrote:
>
> Ok, how about:
>
> - movw 68(%esp), %di
> + addl $68, %esp
> + popw %di
> + subl $66, %esp
>

This will destroy the stack if an untimely interrupt shows up.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

2009-06-16 18:33:52

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [x86] Build error at arch/x86/boot/bioscall.S

Amerigo Wang wrote:
>
> Huh?
> 16 bit mode doesn't allow 'esp' to be used as a base/index register?
>

16-bit mode does, but gas used to be utterly broken with regards to
32-bit address overrides. This has been fixed, but apparently these
old, broken versions of gas are still out there festering in the
environment.

One possible workaround is to switch .code16 to .code16gcc at the top of
the file; another is:

- movw 68(%esp), %di
+ movw %sp, %di
+ movw 68(%di), %di

Does changing .code16 to .code16gcc work for you?

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

2009-06-16 21:43:18

by Tetsuo Handa

[permalink] [raw]
Subject: Re: [x86] Build error at arch/x86/boot/bioscall.S

H. Peter Anvin wrote:
> Does changing .code16 to .code16gcc work for you?
Yes, that works.

Thank you.