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

Alan Modra amodra@gmail.com
Tue Jan 21 04:40:00 GMT 2014


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



More information about the Binutils mailing list