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: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 15 Mar 2016 19:47:16 +1030
- Subject: Re: RFC: [PATCH] Properly handle relocs against absolute symbols
- Authentication-results: sourceware.org; auth=none
- References: <20160314002555 dot GA12078 at gmail dot com>
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.
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.
--
Alan Modra
Australia Development Lab, IBM