This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR ld/16467: Check incompatible existing default symbol definition


On Mon, Jan 20, 2014 at 05:30:20AM -0800, H.J. Lu wrote:
>    if (pold_alignment == NULL
> -      && !info->shared
> -      && !info->export_dynamic
> -      && !h->ref_dynamic
>        && newdyn
>        && newdef
>        && !olddyn
> -      && (olddef || h->root.type == bfd_link_hash_common)
> -      && ELF_ST_TYPE (sym->st_info) != h->type
> -      && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
> -      && h->type != STT_NOTYPE
> -      && !(newfunc && oldfunc))
> +      && ((!info->shared
> +       && !info->export_dynamic
> +       && !h->ref_dynamic

I'd like to understand why you kept the above three lines.  I'm
inclined to think they ought to disappear.  If it is correct to omit
the default symbol for an executable, why not a shared library, and
why is it important to test ref_dynamic?  Try linking your pr2404
testcase as a pie.

> +       && (olddef || h->root.type == bfd_link_hash_common)
> +       && ELF_ST_TYPE (sym->st_info) != h->type
> +       && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
> +       && h->type != STT_NOTYPE
> +       && !(newfunc && oldfunc))
> +      || (olddef
> +          && ((h->type == STT_GNU_IFUNC)
> +          != (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)))))
>      {
>        *skip = TRUE;
>        return TRUE;

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]