Skip to contentSkip to conversation

gcc 4.1.1 issues with 2.6.17-rc5

DISCUSSION Con Kolivas 4 participants 7 messages May 28, 2006 – May 29, 2006

lore
Share & tools
lore
#0 lore raw

Funky new warnings on upgrading to gcc 4.1.1

gcc compiled locally with:
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1.1/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-clocale=gnu --disable-libunwind-exceptions --enable-languages=c,c++ --program-suffix=-4.1.1

warnings:
OBJCOPY arch/i386/boot/vmlinux.bin
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x0)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x4)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x8)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0xc)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x10)
BUILD arch/i386/boot/bzImage

config attached

Signature · 1 line
-ck
#1 lore raw
Quoted 11 lines · Con Kolivas

Funky new warnings on upgrading to gcc 4.1.1

gcc compiled locally with:
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1.1/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --enable-long-long --enable-__cxa_atexit --enable-clocale=gnu --disable-libunwind-exceptions --enable-languages=c,c++ --program-suffix=-4.1.1

Quoted 13 lines

warnings:
OBJCOPY arch/i386/boot/vmlinux.bin
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x0)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x4)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x8)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0xc)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x10)
BUILD arch/i386/boot/bzImage

Should also mention:
binutils-2.15.92.0.2-6.2.102mdk

and a missed one:
WARNING: drivers/usb/storage/usb-storage.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x40)

Signature · 1 line
-ck
#2 lore raw
Quoted 26 lines · On Sun, 28 May 2006 15:21:20 +1000 Con Kolivas wrote:
Quoted 11 lines · Con Kolivas

Funky new warnings on upgrading to gcc 4.1.1

gcc compiled locally with:
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1.1/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --enable-long-long --enable-__cxa_atexit --enable-clocale=gnu --disable-libunwind-exceptions --enable-languages=c,c++ --program-suffix=-4.1.1

Quoted 13 lines

warnings:
OBJCOPY arch/i386/boot/vmlinux.bin
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x0)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x4)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x8)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0xc)
WARNING: drivers/i2c/busses/scx200_acb.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x10)
BUILD arch/i386/boot/bzImage

Quoted 6 lines

Should also mention:
binutils-2.15.92.0.2-6.2.102mdk

and a missed one:
WARNING: drivers/usb/storage/usb-storage.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x40)

Yep, Jesper posted that one.
I also see it in ieee1394.o.

So where does the .smp_locks section come from?
Is this just a section checker bug/issue?

---
~Randy

#3 lore raw
Quoted 9 lines · Randy.Dunlap
Quoted 7 lines · On Sun, 28 May 2006 15:21:20 +1000 Con Kolivas wrote:

Should also mention:
binutils-2.15.92.0.2-6.2.102mdk

and a missed one:
WARNING: drivers/usb/storage/usb-storage.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x40)

Quoted 6 lines

Yep, Jesper posted that one.
I also see it in ieee1394.o.

So where does the .smp_locks section come from?
Is this just a section checker bug/issue?

It's not gcc 4.1.1 only, my system:

Gnu C                  4.0.1
Gnu make               3.80
binutils               2.16.91.0.2
util-linux             2.12q
mount                  2.12q
module-init-tools      3.2-pre8
e2fsprogs              1.38
nfs-utils              1.0.7
Linux C Library        2.3.5
Dynamic linker (ldd)   2.3.5
Procps                 3.2.5
Net-tools              1.60
Console-tools          0.2.3
Sh-utils               5.2.1
udev                   068
Modules Loaded         snd_pcm_oss snd_mixer_oss snd_emu10k1 snd_rawmidi 

snd_ac97_codec snd_ac97_bus snd_pcm snd_seq_device snd_timer snd_page_alloc snd_util_mem snd_hwdep snd soundcore tg3 i2c_isa i2c_viapro eth1394 ide_cd cdrom ohci1394 ieee1394 loop nls_iso8859_1 nls_cp437 vfat fat tuner bttv video_buf firmware_class ir_common compat_ioctl32 v4l2_common btcx_risc tveeprom videodev video thermal processor fan button ac ehci_hcd uhci_hcd usbcore sd_mod sata_via libata scsi_mod

I get theses

WARNING: drivers/acpi/processor.o - Section mismatch: reference to .init.data:
from .text.acpi_processor_power_init after 'acpi_processor_power_init' (at offset 0x1d)
WARNING: drivers/char/ipmi/ipmi_msghandler.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x10)
WARNING: drivers/char/ipmi/ipmi_si.o - Section mismatch: reference to .exit.text : from .smp_locks after '' (at offset 0x8)
WARNING: drivers/ieee1394/ieee1394.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x10)
WARNING: drivers/input/joystick/db9.o - Section mismatch: reference to .init.tex t: from .smp_locks after '' (at offset 0x0)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x0)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x8)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x10)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x18)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x20)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x28)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x30)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x38)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x40)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x48)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x50)
WARNING: drivers/input/joystick/gamecon.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x58)
WARNING: drivers/input/joystick/turbografx.o - Section mismatch: reference to .init.text: from .smp_locks after '' (at offset 0x0)
WARNING: drivers/usb/storage/usb-storage.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x80)
WARNING: net/802/psnap.o - Section mismatch: reference to .exit.text:
from .smp_ locks after '' (at offset 0x0)
WARNING: net/bluetooth/rfcomm/rfcomm.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x8)
WARNING: net/bluetooth/rfcomm/rfcomm.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x10)

#4 lore raw
In reply to Randy.Dunlap
Quoted 9 lines · Randy.Dunlap
Quoted 3 lines

and a missed one:
WARNING: drivers/usb/storage/usb-storage.o - Section mismatch: reference to .exit.text: from .smp_locks after '' (at offset 0x40)

Yep, Jesper posted that one.
I also see it in ieee1394.o.

So where does the .smp_locks section come from?
Is this just a section checker bug/issue?

The .smp_locks section comes from LOCK_PREFIX on x86. I think the warnings was not shown previously just because the modpost did not check SHT_REL sections.

Maybe we should fix the modpost to ignore it, but I'm not sure. Is it really safe to ignore? I'm not a x86 expert ...

---
Atsushi Nemoto

#5 lore raw
Quoted 1 line · Atsushi Nemoto

On Sat, 27 May 2006 22:39:45 -0700, "Randy.Dunlap" <[email protected]>

Quoted 10 lines · wrote:
Quoted 9 lines
Quoted 3 lines

and a missed one:
WARNING: drivers/usb/storage/usb-storage.o - Section mismatch:
reference to .exit.text: from .smp_locks after '' (at offset 0x40)

Yep, Jesper posted that one.
I also see it in ieee1394.o.

So where does the .smp_locks section come from?
Is this just a section checker bug/issue?

Quoted 6 lines

The .smp_locks section comes from LOCK_PREFIX on x86. I think the warnings was not shown previously just because the modpost did not check SHT_REL sections.

Maybe we should fix the modpost to ignore it, but I'm not sure. Is it really safe to ignore? I'm not a x86 expert ...

A "scary but harmless" comment from someone in the know would be nice.

--
-ck

#6 lore raw
Quoted 13 lines · On Mon, 29 May 2006 14:52:25 +1000 Con Kolivas wrote:
Quoted 1 line · Atsushi Nemoto

On Sat, 27 May 2006 22:39:45 -0700, "Randy.Dunlap" <[email protected]>

Quoted 10 lines · wrote:
Quoted 9 lines
Quoted 3 lines

and a missed one:
WARNING: drivers/usb/storage/usb-storage.o - Section mismatch:
reference to .exit.text: from .smp_locks after '' (at offset 0x40)

Yep, Jesper posted that one.
I also see it in ieee1394.o.

So where does the .smp_locks section come from?
Is this just a section checker bug/issue?

Quoted 8 lines
Quoted 6 lines

The .smp_locks section comes from LOCK_PREFIX on x86. I think the warnings was not shown previously just because the modpost did not check SHT_REL sections.

Maybe we should fix the modpost to ignore it, but I'm not sure. Is it really safe to ignore? I'm not a x86 expert ...

A "scary but harmless" comment from someone in the know would be nice.

Yes, I understand your remark.
I have looked at the twisty maze of alternatives code, but Gerd (added to To:) is really who needs to reply IMO.

Based on my source code reading, it is just scary but harmless. alternatives_smp_unlock() and alternatives_smp_lock() are passed beginning and end addresses of text sections and they ignore (init/exit) code addresses that are outside of the text code range.
One comment says:

	/* .text segment, needed to avoid patching init code ;) */

and the code does appear to implement that.

I would make one small change to the code, however.
In alternatives_smp_lock() and alternatives_smp_unlock(), change

		if (*ptr > text_end)
			continue;
to
		if (*ptr >= text_end)
			continue;

because text_end is text_start + text_size, so text_end could be the beginning of the next section. However, in practice this may not matter.

---
~Randy