This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] PR ld/19579/21306 Properly turn common symbol into definition
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 6 Apr 2017 07:38:54 -0700
- Subject: Re: [PATCH] PR ld/19579/21306 Properly turn common symbol into definition
- Authentication-results: sourceware.org; auth=none
- References: <20170405164638.GA9413@intel.com> <20170406104357.GM16711@bubble.grove.modra.org>
On Thu, Apr 6, 2017 at 3:43 AM, Alan Modra <amodra@gmail.com> wrote:
> On Wed, Apr 05, 2017 at 09:46:38AM -0700, H.J. Lu wrote:
>> +bfd_boolean
>> +_bfd_elf_define_common_symbol (bfd *output_bfd,
>> + struct bfd_link_info *info,
>> + struct bfd_link_hash_entry *h)
>> +{
>> + bfd_boolean ret
>> + = bfd_generic_define_common_symbol (output_bfd, info, h);
>> + if (ret)
>> + {
>> + /* Since def_regular may not be set if it is overridden by a
>> + dynamic definition, we need to set def_regular when it is
>> + converted to a defined symbol. */
>> + struct elf_link_hash_entry *eh
>> + = (struct elf_link_hash_entry *) h;
>> + eh->def_regular = 1;
>> + }
>> + return TRUE;
>> +}
>
> This fails for ELF targets using the generic linker, like d30v-elf.
Does such target support shared object, which is the issue here?
> Isn't the real bug that somewhere we have code lacking an
> ELF_COMMON_DEF_P test?
ELF targets check def_regular for definition in relocatable object.
It should be set for all definitions in relocatable objects
--
H.J.