How to reclaim .rela.dyn entries for symbols that become hidden?

Carlos O'Donell carlos@systemhalted.org
Mon Jul 4 15:41:00 GMT 2005


On Mon, Jul 04, 2005 at 11:48:30AM +0930, Alan Modra wrote:
> On Fri, Jul 01, 2005 at 05:13:13PM -0400, Carlos O'Donell wrote:
> > I forgot .rela.got becomes part of the .rela.dyn section based on the
> > linker script. This accounts for the other 48 bytes, or 4 relocs that
> > appear in that section.
> 
> Yeah, it pays to debug this sort of problem with -z nocombreloc

I'm still stuck. At the point in allocate_dynrelocs the undefined
symbol is not marked dynamic, or hidden for matter. I am forced to
allocate space.

Now the question I don't clearly understand is: After having
allocated that space, can I go back and change the section size in
relocate_section, like this:

      sec = htab->sgot;
      sec->size -= GOT_ENTRY_SIZE;

And thus effect the final writeout of the section? It would seem like
the thing to do if the symbol becomes hidden and remains undefined
e.g. change the space allocated for the reloc.

Second question: Where do __init_array_start, __init_array_end,
__fini_array_start, and __fini_array_end resolve to?

Are these provided by the linker's internal script?

Thanks for all the newbie help.

c.




More information about the Binutils mailing list