This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] PR ld/16467: Check incompatible existing default symbol definition
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 21 Jan 2014 15:10:09 +1030
- Subject: Re: [PATCH] PR ld/16467: Check incompatible existing default symbol definition
- Authentication-results: sourceware.org; auth=none
- References: <20140120013428 dot GA1497 at gmail dot com> <20140120065847 dot GM5390 at bubble dot grove dot modra dot org> <CAMe9rOpsU-_gTdby3KFvvOii2xC7B7yn3mBuhDmYeCMGK9WY9g at mail dot gmail dot com>
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