This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [nonworking patch] gold/arm: define $a/$d markers in .plt
> Currently, local symbols can come only from relocatable objects or
> from globals that have been forced local.
>
> I haven't tried this, but I think you might be able to add a method to
> class Symbol_table that adds a bare Sized_symbol (that is not in the
> global symbol table) to the forced_locals_ list. Then
> Symbol_table::sized_finalize() will take care of adding the symbol to
> the output symbol table as a local.
>
> You might even be able to just create a new Sized_symbol and call
> Symbol_table::force_local() with it.
Looking at this more closely, I see that we do in fact already call
define_in_output_data() to create STB_LOCAL symbols (e.g.,
_GLOBAL_OFFSET_TABLE, _DYNAMIC).
I'm thinking the right thing to do here is to pass the binding to
Symbol_table::define_special_symbol(). If the binding is STB_LOCAL, it
should create a new Sized_symbol and add it to the forced_locals_ list
instead of to the global symbol table.
-cary