The current binutils failed to build working ia64 kernel. Machine stops as soon as entering user space. 20090929 binutils is bad and 20090614 binutils is OK.
Binutils 20090831 is OK.
20090923 linker is OK and 20090929 linker is bad. Alan, I think your "ld -r" patch may be the cause.
Do you have a good and a bad kernel image for me to look at?
(In reply to comment #3) > Do you have a good and a bad kernel image for me to look at? Please get ftp://ftp.intel.com/pub/incoming/ia64.tar.bz2 It will disappear in a few hours. Thanks.
readelf -a shows symbol differences which I guess are real problems. --- dump.good 2009-10-09 13:50:23.000000000 +1030 +++ dump.bad 2009-10-09 13:50:09.000000000 +1030 @@ -40,7 +40,7 @@ [16] .opd PROGBITS a000000100678a30 688a30 017160 00 A 0 0 16 [17] .init.text PROGBITS a000000100690000 6a0000 0429f0 00 AX 0 0 32 [18] .init.data PROGBITS a0000001006d29f0 6e29f0 01c460 00 WA 0 0 8 - [19] .init.ramfs PROGBITS a0000001006eee50 6fee50 000086 00 A 0 0 1 + [19] .init.ramfs PROGBITS a0000001006eee50 6fee50 000085 00 A 0 0 1 [20] .init.setup PROGBITS a0000001006eeee0 6feee0 000840 00 WA 0 0 8 [21] .initcall.init PROGBITS a0000001006ef720 6ff720 000548 00 WA 0 0 8 [22] .con_initcall.init PROGBITS a0000001006efc68 6ffc68 000018 00 WA 0 0 8 @@ -125923,7 +125923,7 @@ 16927: a00000010016db00 496 FUNC GLOBAL DEFAULT 1 inode_init_once 16928: a0000001002e5420 208 FUNC GLOBAL DEFAULT 1 acpi_ut_execute_STA 16929: a0000001007e4c48 8 OBJECT GLOBAL DEFAULT 31 sighand_cachep - 16930: a00000000000050c 0 NOTYPE GLOBAL DEFAULT ABS __end_gate_brl_fsys_bubble_down_patchlist + 16930: 000000000000000c 0 NOTYPE GLOBAL DEFAULT ABS __end_gate_brl_fsys_bubble_down_patchlist 16931: 000000002f262839 0 NOTYPE GLOBAL DEFAULT ABS __crc___module_put_and_exit 16932: a0000001002dc440 192 FUNC GLOBAL DEFAULT 1 acpi_rs_get_crs_method_data 16933: a0000001002bb9e0 1104 FUNC GLOBAL DEFAULT 1 acpi_ex_resolve_object_to_value @@ -126711,7 +126711,7 @@ 17715: 000000003717dbf9 0 NOTYPE GLOBAL DEFAULT ABS __crc_ia64_pfn_valid 17716: a0000001001a4500 2496 FUNC GLOBAL DEFAULT 1 vfs_quota_off 17717: a000000100270260 80 FUNC GLOBAL DEFAULT 1 pci_do_scan_bus - 17718: a000000000010640 192 FUNC GLOBAL DEFAULT ABS __kernel_syscall_via_epc + 17718: 0000000000000020 192 FUNC GLOBAL DEFAULT ABS __kernel_syscall_via_epc 17719: a0000001003d20a0 384 FUNC GLOBAL DEFAULT 1 ata_output_data 17720: 00000000faf1daa7 0 NOTYPE GLOBAL DEFAULT ABS __crc_pci_find_device_reverse 17721: a000000100253400 336 FUNC GLOBAL DEFAULT 1 __bitmap_subset [snip]
Please get http://sourceware.org/bugzilla/attachment.cgi?id=4260&action=view and do [hjl@gnu-14 kernel]$ ld -r -o gate-syms.o -T gate.lds gate.o 20090929 linker generates bad gate-syms.o.
kernel/Makefile.gate has GATECFLAGS_gate-syms.o = -r, and gate-syms.o is built with a custom linker script. So, yes, the ld -r change is responsible for breaking the ia64 kernel.
This patch http://sourceware.org/ml/binutils/2009-09/msg00365.html may be the cause.
Subject: Bug 10749 CVSROOT: /cvs/src Module name: src Changes by: amodra@sourceware.org 2009-10-09 05:19:37 Modified files: ld : ChangeLog ldlang.c Log message: PR ld/10749 * ldlang.c (lang_size_sections_1): Zero section vmas only for COFF. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&r1=1.2060&r2=1.2061 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ldlang.c.diff?cvsroot=src&r1=1.322&r2=1.323
Subject: Bug 10749 CVSROOT: /cvs/src Module name: src Branch: binutils-2_20-branch Changes by: amodra@sourceware.org 2009-10-09 05:43:07 Modified files: ld : ChangeLog ldlang.c ld/scripttempl : aix.sc armbpabi.sc avr.sc elf.sc elf32cr16.sc elf32cr16c.sc elf32crx.sc elf32msp430.sc elf32msp430_3.sc elf32sh-symbian.sc elf64hppa.sc elf_chaos.sc elfd10v.sc elfd30v.sc elfi370.sc elfm68hc11.sc elfm68hc12.sc elfmicroblaze.sc elfxtensa.sc iq2000.sc mep.sc nw.sc psos.sc tic54xcoff.sc xstormy16.sc Log message: PR ld/10749 * ldlang.c (lang_size_sections_1): Zero section vmas only for COFF. * scripttempl/elf32cr16.sc: Revert 2009-09-28 change. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. 2009-10-03 Alan Modra <amodra@bigpond.net.au> * emultempl/ppc32elf.em (emit_stub_syms): Init to -1. (ppc_after_open): Set emit_stubs_syms by default when shared. (OPTION_NO_STUBSYMS): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Handle --no-emit-stub-syms. * emultempl/ppc64elf.em (emit_stub_syms): Init to -1. (gld${EMULATION_NAME}_finish): Set emit_stubs_syms by default. (OPTION_NO_STUBSYMS): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Handle --no-emit-stub-syms. 2009-09-30 Matthias Klose <doko@ubuntu.com> PR ld/9863 * emulparams/armelf_linux.sh (DATA_START_SYMBOLS): Use PROVIDE with __data_start. 2009-09-29 Joel Sherrill <joel.sherrill@oarcorp.com> * emulparams/m68kelf.sh (NOP): Use 0x4e71 (nop) rather than 0x4e75 (rts). 2009-09-29 Alan Modra <amodra@bigpond.net.au> * ldlang.c (lang_size_sections_1): Allow scripts to specify a non-zero vma even when relocatable. 2009-09-28 Alan Modra <amodra@bigpond.net.au> * scripttempl/elf32cr16.sc: Emit empty script for ld -r and ld -Ur. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/aix.sc: Delete ${RELOCATING-0}. * scripttempl/avr.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/armbpabi.sc: Delete ${RELOCATING-0} and ${CONSTRUCTING-0}. * scripttempl/elf.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.2039.2.12&r2=1.2039.2.13 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/ldlang.c.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.317.2.2&r2=1.317.2.3 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/aix.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.4.28.2&r2=1.4.28.3 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/armbpabi.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.16.2.1&r2=1.16.2.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/avr.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.7.4.1&r2=1.7.4.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elf.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.95.2.1&r2=1.95.2.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elf32cr16.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.3.2.2&r2=1.3.2.3 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elf32cr16c.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.3.2.2&r2=1.3.2.3 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elf32crx.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.7.2.2&r2=1.7.2.3 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elf32msp430.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.5.20.1&r2=1.5.20.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elf32msp430_3.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.3.28.1&r2=1.3.28.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elf32sh-symbian.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.10.2.1&r2=1.10.2.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elf64hppa.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.2.2.1&r2=1.2.2.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elf_chaos.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.8.8.1&r2=1.8.8.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elfd10v.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.11.8.1&r2=1.11.8.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elfd30v.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.9.10.1&r2=1.9.10.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elfi370.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.6.8.1&r2=1.6.8.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elfm68hc11.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.13.8.1&r2=1.13.8.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elfm68hc12.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.15.8.1&r2=1.15.8.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elfmicroblaze.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.1.2.2&r2=1.1.2.3 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elfxtensa.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.18.2.1&r2=1.18.2.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/iq2000.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.7.8.1&r2=1.7.8.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/mep.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.5.2.1&r2=1.5.2.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/nw.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.3.32.1&r2=1.3.32.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/psos.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.1.1.1.36.1&r2=1.1.1.1.36.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/tic54xcoff.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.2.34.2&r2=1.2.34.3 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/scripttempl/xstormy16.sc.diff?cvsroot=src&only_with_tag=binutils-2_20-branch&r1=1.11.8.1&r2=1.11.8.2
Subject: Bug 10749 CVSROOT: /cvs/src Module name: src Changes by: hjl@sourceware.org 2009-10-09 13:32:50 Modified files: ld/testsuite : ChangeLog Added files: ld/testsuite/ld-elf: relocatable.d relocatable.t simple.s Log message: 2009-10-09 H.J. Lu <hongjiu.lu@intel.com> PR ld/10749 * ld-elf/relocatable.d: New. * ld-elf/relocatable.t: Likewise. * ld-elf/simple.s: Likewise. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1180&r2=1.1181 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-elf/relocatable.d.diff?cvsroot=src&r1=NONE&r2=1.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-elf/relocatable.t.diff?cvsroot=src&r1=NONE&r2=1.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-elf/simple.s.diff?cvsroot=src&r1=NONE&r2=1.1
Fixed.
On hppa-unknown-linux-gnu: Executing on host: sh -c {/home/dave/gnu/binutils/objdir/ld/../binutils/readelf -S --wide tmpdir/dump > tmpdir/dump.out 2>ld.tmp} /dev/null (timeout = 300) extra regexps in /home/dave/gnu/binutils/src/ld/testsuite/ld-elf/relocatable.d s tarting with "^ \[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t]+0+800000[ \t0-9a-f]+AX. *$" EOF from tmpdir/dump.out FAIL: relocatable with script
(In reply to comment #13) > On hppa-unknown-linux-gnu: > > Executing on host: sh -c {/home/dave/gnu/binutils/objdir/ld/../binutils/readelf > -S --wide tmpdir/dump > tmpdir/dump.out 2>ld.tmp} /dev/null (timeout = 300) > extra regexps in /home/dave/gnu/binutils/src/ld/testsuite/ld-elf/relocatable.d s > tarting with "^ \[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t]+0+800000[ \t0-9a-f]+AX. > *$" > EOF from tmpdir/dump.out > FAIL: relocatable with script > It looks like a linker bug: [ 1] .text PROGBITS 00000000 000034 000004 00 AX 0 0 1 [ 2] .data PROGBITS 00900000 000038 000004 00 WA 0 0 1 The address of .text is wrong. I think you should open a separate bug.
I guess the hppa test failure is due to hppaelf_after_parse if (link_info.relocatable) lang_add_unique (".text"); I'd be inclined just to xfail the test for hppa.
Subject: Re: Linker failed to build working ia64 kernel > I guess the hppa test failure is due to hppaelf_after_parse > if (link_info.relocatable) > lang_add_unique (".text"); > > I'd be inclined just to xfail the test for hppa. I see the following section headers: dave@mx3210:~/gnu/binutils/objdir/ld$ readelf -S --wide tmpdir/dump|less There are 6 section headers, starting at offset 0x64: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text PROGBITS 00000000 000034 000004 00 AX 0 0 1 [ 2] .data PROGBITS 00900000 000038 000004 00 WA 0 0 1 [ 3] .shstrtab STRTAB 00000000 00003c 000027 00 0 0 1 [ 4] .symtab SYMTAB 00000000 000154 000030 10 5 3 4 [ 5] .strtab STRTAB 00000000 000184 000001 00 0 0 1 The match seems to have failed because of the Addr value. Dave
Exactly. The reason is that .text is made a unique section, so doesn't match the .text in the script. See unique_section_p, in particular the one in output_section_callback. So .text is treated as an orphan, and orphans have their vma set to zero.
(In reply to comment #17) > Exactly. The reason is that .text is made a unique section, so doesn't match > the .text in the script. See unique_section_p, in particular the one in > output_section_callback. So .text is treated as an orphan, and orphans have > their vma set to zero. Linker script has --- SECTIONS { . = 0x800000; .text : { *(.text) } . = 0x900000; .data : { *(.data) } /DISCARD/ : { *(.*) } } --- Shouldn't the orphaned sections be discarded?
Created attachment 4265 [details] ld --unique tweak It might be reasonable to change the behaviour of unique sections so that the script can match one input section. This fixes the testcase and doesn't do too much violence to the meaning of ld --unique.
Sorry, I shouldn't have said .text is treated as an orphan. That isn't quite correct. .text obviously isn't an orphan since .text is mentioned in the linker script, so we don't hit the /DISCARD/. .text is treated *like* an orphan.
Subject: Re: Linker failed to build working ia64 kernel On Sun, 11 Oct 2009, amodra at bigpond dot net dot au wrote: > Created an attachment (id=4265) > --> (http://sourceware.org/bugzilla/attachment.cgi?id=4265&action=view) > ld --unique tweak Works for me.
Unfortunately the patch isn't correct. We might map a unique section to an output section that later has some other section or data mapped.