This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/13195: -ffunction-sections -Wl,--gc-sections failure with symbol versioning
- From: Matthias Klose <doko at ubuntu dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, binutils at sourceware dot org
- Date: Tue, 04 Oct 2011 12:49:46 +0200
- Subject: Re: PATCH: PR ld/13195: -ffunction-sections -Wl,--gc-sections failure with symbol versioning
- References: <20110916225729.GA29335@intel.com> <20110917224150.GA7754@intel.com> <20110928194418.GA14342@intel.com> <20110929001018.GQ10321@bubble.grove.modra.org>
On 09/29/2011 02:10 AM, Alan Modra wrote:
> On Wed, Sep 28, 2011 at 12:44:18PM -0700, H.J. Lu wrote:
>> bfd/
>>
>> 2011-09-28 H.J. Lu <hongjiu.lu@intel.com>
>>
>> PR ld/13195
>> * elflink.c (_bfd_elf_merge_symbol): Don't set dynamic_def when
>> clearing def_dynamic.
>> (elf_link_add_object_symbols): Likewise. Set dynamic_def when
>> setting def_dynamic.
>> (bfd_elf_gc_mark_dynamic_ref_symbol): Check if a symbol is
>> versioned.
>>
>> ld/testsuite/
>>
>> 2011-09-28 H.J. Lu <hongjiu.lu@intel.com>
>>
>> PR ld/13195
>> * ld-elf/elf.exp: Add a C link testcase for PR ld/13195.
>>
>> * ld-elf/pr13195.c: New.
>> * ld-elf/pr13195.d: Likewise.
>> * ld-elf/pr13195.s: Likewise.
>> * ld-elf/pr13195.t: Likewise.
>
> OK.
>
please apply this on the 2.22 branch as well, the branch currently fails with:
$ cat test.c
int main() {}
$ gcc -Wl,--gc-sections test.c
/usr/bin/ld: a.out: local symbol `_dl_argv@@GLIBC_PRIVATE' in
/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 is referenced by DSO
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status