Summary: | ld segfault for microblaze when --gc-sections is used | ||
---|---|---|---|
Product: | binutils | Reporter: | wbx |
Component: | ld | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nickc |
Priority: | P2 | ||
Version: | 2.29 | ||
Target Milestone: | --- | ||
Host: | x86_64 | Target: | microblaze |
Build: | x86_64 | Last reconfirmed: | |
Attachments: | Proposed patch |
Description
wbx
2017-02-18 07:48:47 UTC
Would it be possible for you to provide us with a testcase that demonstrates this problem ? I do not have access to a microblaze system so I cannot just download and build nss. Also - is an assertion being triggered, and if so, what is the message and line number associated with the assertion failure ? You don't need microblaze hardware, the problem appear while cross-compiling from x86_64 to microblaze. The segfault happens without any assertion failure while trying to cross-compile libnss or kmod. You can reproduce using for example Buildroot or OpenADK buildsystem targeting Qemu system for microblaze. git clone git://buildroot.org/buildroot cd buildroot git revert fceb1afd5dda45cf180f22877a6ab0e51d1b3dac make qemu_microblazeel_mmu_defconfig make menuconfig --> choose Target Packages - Libraries - Crypto - libnss make V=1 Wait a while for the segfault happening. Created attachment 9849 [details]
Proposed patch
Thanks - I can reproduce the problem now.
Please could you try out the uploaded patch and let me know if it works - and if the resulting library actually executes properly...
The patch is more of a workaround than a fix, since it ends up creating a redundant entry in the GOT table. But I believe in keeping things simple, so if
it works I am happy to apply it as is.
Cheers
Nick
Works for me. No segfaults anymore, certutil application inside libnss shows no problems. Thanks for the bugfix, Waldemar The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bd757ca7bf5886a4025ca02093fca1b8c5ce11a2 commit bd757ca7bf5886a4025ca02093fca1b8c5ce11a2 Author: Nick Clifton <nickc@redhat.com> Date: Mon Feb 27 11:33:05 2017 +0000 Fix segfault in microblaze linker when garbage collection removes a symbol scheduled for a slot in the PLT. PR ld/21180 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid generating a seg-fault when encountering a symbol that has been deleted by garbage collection. Patch applied. |