$ echo "int main() { return 1; }" >t.c
$ gcc -Wl,--verbose t.c >script.lds

Edit script.lds like this

-  .note.gnu.build-id : { *(.note.gnu.build-id) }
+  /DISCARD/ : { *(.note.gnu.build-id) }

(and remove everything except linker script, of course)

Now try to link with --build-id:

$ gcc -Wl,--build-id -Wl,-T -Wl,script.lds  t.c
collect2: ld terminated with signal 11 [Segmentation fault]

$ ld -v
GNU ld (GNU Binutils) 2.18

-- 
           Summary: SEGV with ld --build-id + "/DISCARD/ : {
                    *(.note.gnu.build-id) }"
           Product: binutils
           Version: 2.18
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: vda dot linux at googlemail dot com
                CC: bug-binutils at gnu dot org
 GCC build triplet: i386-pc-linux-gnu
  GCC host triplet: i386-pc-linux-gnu
GCC target triplet: i386-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=5025

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to