abrt version: 1.1.18 architecture: x86_64 Attached file: backtrace, 19242 bytes cmdline: ld -m elf_i386 --script foo.lds hello.o -lc component: binutils Attached file: coredump, 2838528 bytes crash_function: __mempcpy_sse2 executable: /usr/bin/ld.bfd kernel: 2.6.35.13-91.fc14.x86_64 package: binutils-2.20.51.0.7-8.fc14 rating: 4 reason: Process /usr/bin/ld.bfd was killed by signal 11 (SIGSEGV) release: Fedora release 14 (Laughlin) time: 1307638218 uid: 500 How to reproduce ----- 1. Custom loader script, based on default script; will attach to BZ report if I can. 2. 3.
Created attachment 503941 [details] File: backtrace
Created attachment 503942 [details] custom loader script "foo.lds" Customer linker script foo.lds was created by modifying the default script that was generated by "ld -m elf_i386 --verbose".
Package: binutils-2.20.51.0.7-8.fc14 Architecture: x86_64 OS Release: Fedora release 14 (Laughlin) How to reproduce ----- 1. custom linker script 2. 3.
One of the instances of this crash is associated with statement order in SECTIONS. The order: .note.gnu.build-id : { *(.note.gnu.build-id) } :note :text .interp : { *(.interp) } :interp :text works. The reverse order: .interp : { *(.interp) } :interp :text .note.gnu.build-id : { *(.note.gnu.build-id) } :note :text crashes.
(In reply to comment #4) > The order: > .note.gnu.build-id : { *(.note.gnu.build-id) } :note :text > .interp : { *(.interp) } :interp :text > works. > > The reverse order: > .interp : { *(.interp) } :interp :text > .note.gnu.build-id : { *(.note.gnu.build-id) } :note :text > crashes. Both orders work when the _next_ statement is .hash : { *(.hash) } :text instead of .hash : { *(.hash) } with no ":text" on the end.
Hi John, The underlying problem here is that your custom linker script is broken - it is using the ":note" syntax to assign the .note.gnu.build-id section to the "note" segment, but then it is not resetting the segment assignment for the sections that follow. So they are all also put into the "note" segment as well, which changes their behaviour and generally breaks things. As you noted adding ":text" to the .hash section assignment fixes this. The linker itself should not seg-fault upon such occurrence however, so I have applied a patch to the F14 and F15 binutils releases to fix this: binutils-2.20.51.0.7-9.fc14 binutils-2.21.51.0.6-4.fc15 The patch is a slimmed down version of a larger patch that I have applied to the FSF binutils sources: http://sources.redhat.com/ml/binutils/2011-06/msg00142.html I have not applied a patch to the rawhide version of binutils since the FSF version will appear in the next release of H.J.'s binutils tarball. Cheers Nick