This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Add a record_link_assignments hook to ldemul
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Nick Clifton <nickc at redhat dot com>, Binutils <binutils at sourceware dot org>
- Date: Fri, 29 Apr 2016 09:08:08 +0930
- Subject: Re: [PATCH] Add a record_link_assignments hook to ldemul
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOrA-N+EzYB=_vPMoUrO6_W6Otg54ceuTpH4ThJ1FVCt6A at mail dot gmail dot com>
On Thu, Apr 28, 2016 at 02:01:47PM -0700, H.J. Lu wrote:
> + /* Symbol is defined. Check if it is also defined in a regular
> + input file only when it is currently defined in a dynamic
> + object, since otherwise, it can't be a __start_<name> nor
> + __stop_<name> symbol. */
> + if (!h->def_dynamic)
> return NULL;
[snip]
> + if (s != NULL)
> + {
> + h->root.u.undef.section = s;
> + break;
> + }
You can't set u.undef here on a defined symbol. That's just too ugly,
even if you later set it to undefined. Better to force it
bfd_link_hash_undefined here.
This is getting quite messy, and I'm wondering if we even need
_bfd_elf_is_start_stop, except for gc-sections code.
--
Alan Modra
Australia Development Lab, IBM