Working: 2.18.50.0.7 Broken: 2.18.50.0.8 Several arm configurations of the Linux kernel fail to build due to an ld segfault: $ arm-linux-ld -EL -r -o init/main.o init/.tmp_main.o -T init/.tmp_main.ver Segmentation fault $ Backtrace: #0 0x0808c8b4 in elf32_arm_output_arch_local_syms () #1 0x080b3171 in bfd_elf_final_link () #2 0x0805e4a3 in ldwrite () #3 0x0805d82c in main () My first guess (that might be wrong) is that the 2008-05-22 bfd change might cause it.
Created attachment 2831 [details] .tmp_main.o
Created attachment 2832 [details] .tmp_main.ver
I can't reproduce it on Fedora 9/x86-64 [hjl@gnu-6 ld]$ ./ld-new -EL -r /tmp/tmp_main.o -T /tmp/tmp_main.ver -V GNU ld (Linux/GNU Binutils) 2.18.50.0.8.20080709 Supported emulations: armelf_linux armelf armelfb armelfb_linux [hjl@gnu-6 ld]$
Perhaps since I have a 32bit userspace (I verbatim copied Host/Build from the configure output, but although I have a 64bit kernel it's a 32bit userspace)? After compiling with "-O0 -g" it becomes clear the problem is in the following code: /* Long calls stubs. */ if (htab->stub_bfd && htab->stub_bfd->sections) { gdb says: (gdb) print htab->stub_bfd $1 = (bfd *) 0xf5 (gdb) print htab->stub_bfd->sections Cannot access memory at address 0x159 (gdb)
A patch is posted at http://sourceware.org/ml/binutils/2008-07/msg00214.html
Thanks, I can confirm that your patch fixes the segfault.
Fixed.