Skip to contentSkip to conversation

Compiling kernel 2.4.17 fails at link stage

Linux-ia64 Grant Grundler 2 participants 4 messages Jan 5, 2002 – Jan 7, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines · Alan Modra

It's a kernel bug exposed by recent binutils. You can either fix the kernel by making the references weak, or hack around the problem by adding -fnoinhibit-exec to the ld command line.

I had added "-fnoinhibit-exec" to LINKFLAGS in linux/arch/ia64/Makefile and got:

	ld -f may not be used without -shared
	make: *** [vmlinux] Error 1

So how do I "make references weak"?

thanks,
grant

#1 lore raw
Quoted 7 lines · Grant Grundler
Quoted 3 lines · Alan Modra

It's a kernel bug exposed by recent binutils. You can either fix the kernel by making the references weak, or hack around the problem by adding -fnoinhibit-exec to the ld command line.

I had added "-fnoinhibit-exec" to LINKFLAGS in linux/arch/ia64/Makefile and got:

Sorry, typo. --noinhibit-exec

Quoted 1 line

So how do I "make references weak"?

extern int foo __attribute__ ((weak));

#2 lore raw
In reply to Grant Grundler
Quoted 1 line · H . J . Lu

Use --noinhibit-exec.

It didn't complain. But it didn't help either:

ld -static -T arch/ia64/vmlinux.lds --noinhibit-exec arch/ia64/kernel/head.o arch/ia64/kernel/init_task.o init/main.o init/version.o \
        --start-group \
        arch/ia64/kernel/kernel.o arch/ia64/mm/mm.o arch/ia64/ia32/ia32.o arch/ia64/dig/dig.a kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o \
         drivers/acpi/acpi.o drivers/char/char.o drivers/block/block.o drivers/misc/misc.o drivers/net/net.o drivers/media/media.o drivers/char/agp/agp.o drivers/char/drm/drm.o drivers/net/fc/fc.o drivers/ide/idedriver.o drivers/scsi/scsidrv.o drivers/cdrom/driver.o drivers/sound/sounddrivers.o drivers/pci/driver.o drivers/video/video.o drivers/usb/usbdrv.o drivers/input/inputdrv.o \
        net/network.o \
        /usr/src/2.4.17/arch/ia64/lib/lib.a /usr/src/2.4.17/lib/lib.a /usr/src/2.4.17/arch/ia64/lib/lib.a \
        --end-group \
        -o vmlinux

arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x0): undefined reference to local symbols in discarded section .text.exit' arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x8): undefined reference to local symbols in discarded section .text.exit' arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x18): undefined reference to local symbols in discarded section .text.exit' arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x20): undefined reference to local symbols in discarded section .text.exit' arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x30): undefined reference to local symbols in discarded section .text.exit' arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x38): more undefined references to local symbols in discarded section .text.exit' follow arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x0): unsupported reloc arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x8): unsupported reloc arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x18): unsupported reloc arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x20): unsupported reloc arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x30): unsupported reloc arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x38): unsupported reloc arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x48): unsupported reloc arch/ia64/kernel/kernel.o(.IA_64.unwind.text.exit+0x50): unsupported reloc
make: *** [vmlinux] Error 1
grundler <511>

More info appended.
BTW, binaries I'm using are Debian "woody".

thanks,
grant

hpntcv6:/home/grundler \<521\>ld -v
GNU ld version 2.11.92.0.12.3 20011121 Debian/GNU Linux

hpntcv6:/var/cache/apt/archives# dpkg -l binutils
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercaseºd)
||/ Name           Version        Description
+++-=======-=======-======================
ii  binutils       2.11.92.0.12.3 The GNU assembler, linker and binary utiliti
hpntcv6:/var/cache/apt/archives# ls -l binutils_*
-rw-r--r--    1 root     root      1993810 Nov 25 17:27 binutils_2.11.92.0.10-4_ia64.deb
-rw-r--r--    1 root     root      2221132 Dec  6 11:35 binutils_2.11.92.0.12.3-2_ia64.deb
-rw-r--r--    1 root     root      2221386 Dec  9 16:06 binutils_2.11.92.0.12.3-3_ia64.deb
-rw-r--r--    1 root     root      2221136 Dec 27 00:54 binutils_2.11.92.0.12.3-4_ia64.deb
#3 lore raw
In reply to Grant Grundler
Quoted 1 line · H . J . Lu

Did you get the output, vmlinux? If yes, does it work?

no vmlinux resulted.
Sorry - I hadn't check once I got the output and error.

thanks,
grant

Grant Grundler
+1.408.447.7253