This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: [PATCH] Properly handle relocs against absolute symbols
- 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: Tue, 15 Mar 2016 05:38:16 -0700
- Subject: Re: RFC: [PATCH] Properly handle relocs against absolute symbols
- Authentication-results: sourceware.org; auth=none
- References: <20160314002555 dot GA12078 at gmail dot com> <20160315091715 dot GB12055 at bubble dot grove dot modra dot org>
On Tue, Mar 15, 2016 at 2:17 AM, Alan Modra <amodra@gmail.com> wrote:
> On Sun, Mar 13, 2016 at 05:25:55PM -0700, H.J. Lu wrote:
>> + /* Symbol is defiend by linker. */
>> + unsigned int def_linker : 1;
>> + /* Symbol is defiend by linker and absolue. */
>> + unsigned int def_linker_abs : 1;
>
> Hmm, you need to add these because you want to make decisions at
> size_dynamic_sections time based on a symbol's section, and symbols
> defined in a linker script don't have their final section set until
> later. I don't see a practical way of setting a linker defined
> symbol's section and value before section vmas are finalized, so
> setting them early enough doesn't seem an option.
Yes, I am aware of it now.
> How about implementing a linker callback instead of adding yet more
> flags to struct elf_link_hash_entry? I'm thinking that you could add
> a rel_from_abs flag to struct definedness_hash_entry, set in
> update_definedness, then have the callback interrogate the
> definedness_table.
I will give it a try,
Thanks.
--
H.J.