RFC: [PATCH] Properly handle relocs against absolute symbols
Alan Modra
amodra@gmail.com
Tue Mar 15 09:17:00 GMT 2016
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
More information about the Binutils
mailing list