Bug 5025 - SEGV with ld --build-id + "/DISCARD/ : { *(.note.gnu.build-id) }"
Summary: SEGV with ld --build-id + "/DISCARD/ : { *(.note.gnu.build-id) }"
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-12 19:15 UTC by Denis Vlasenko
Modified: 2007-09-15 06:21 UTC (History)
1 user (show)

See Also:
Host: i386-pc-linux-gnu
Target: i386-pc-linux-gnu
Build: i386-pc-linux-gnu
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Vlasenko 2007-09-12 19:15:55 UTC
$ 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