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

Cary Coutant ccoutant@google.com
Wed Apr 18 19:12:00 GMT 2012

> What's happening is that the symbols it writes are later being overwritten
> with globals.  This is because first_global_index hasn't counted the
> generated_locals.  I tried a couple of different tacks to increment it
> but those ran afoul of other assertions.  I really don't understand the
> bookkeeping associated with first_global_index_ and output_count_.

first_global_index_ is kind of misleading -- it's actually the first
symbol index where symbols from the global symbol table get written,
and that includes symbols that have been forced local, and will also
include the generated locals that you're creating. All the symbols
below that point are locals that come directly from relocatable object

output_count_ is the total number of symbols written from the global
symbol table, which includes forced locals and generated locals.

During sized_write_globals(), the base pointer to the output file
corresponds to first_global_index_, which is why you see

	  sym_index -= first_global_index;

at the bottom of the loop that writes globals. I think you're missing
that adjustment in the loop you added to write generated locals.

If I get some time today, I'll apply your patch and try to diagnose
this a bit more deliberately. I think it's very close, though. Sorry
to be so trial-and-error.


More information about the Binutils mailing list