[PATCH] gold/arm: define $a/$d markers in .plt

Cary Coutant ccoutant@google.com
Wed Apr 25 18:32:00 GMT 2012

> The three functions (do_define_in_output_data,
> do_define_in_output_segment, and do_define_as_constant) all need to act
> the same way.  You are keying off of binding == STB_LOCAL to omit adding
> the name to the global symbol table, but as you've discovered that mixes
> together two unrelated cases.  Your case is a symbol that is always
> local and is never referenced by name.  The other case, the one
> currently supported, is a symbol that is global but is forced local by a
> version script.  A symbol like _GLOBAL_OFFSET_TABLE_ is the latter.
> So I think your code needs to add a new value to the Defined enum,
> PREDEFINED_UNREFERENCED or something, to add a new local symbol with no
> globally visible name.
> Then you can handle that in define_special_symbol if you like, or via
> some other helper function that calls define_special_symbol.

How about instead adding a "force_local" flag to these three
functions, then using STB_GLOBAL with force_local == true for
_GLOBAL_OFFSET_TABLE_ and similar symbols? I think it's misleading to
use STB_LOCAL for a symbol that actually does have global scope
(within the link).


More information about the Binutils mailing list