Sources Bugzilla – Bug 6058
Linker segfaults with undefined weak function descriptors.
Last modified: 2009-01-22 10:56:41 UTC
This test file segfaults ld:
# These should both end up zero.
sec is NULL at the top of _frvfdpic_emit_got_relocs_plt_entries. Discovered
while cribbing from the FRV port for SH FDPIC - presumably both should be zero
and have no relocations. That's what happens for the non-hidden one.
Created attachment 2694 [details]
Add checks for a NULL section pointer
Does the uploaded patch work for you ?
Subject: Re: Linker segfaults with undefined weak function
On Tue, Apr 15, 2008 at 02:18:14PM -0000, nickc at redhat dot com wrote:
> Hi Daniel,
> Does the uploaded patch work for you ?
It does fix the crash, but two unnecessary function descriptors appear
to be allocated. And I get an assertion failure on elf32-frv.c:5867
if I add -shared to the link command (along with a corrupt
relocation in .rel.dyn).
If I link the executable with a shared library I get a dynamic reloc
for the non-hidden undefweak symbol, which IMO is correct.