This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

.dynsym pain


I've a need to install certain STB_LOCAL symbols in the dynamic symbol
table.  I can't tell you the reason at the moment, but suffice to say
that they should act like STB_LOCAL symbols do in the normal symbol table.

There are multiple sources of pain here --

First, symbols that began life as local symbols do not have an
elf_link_hash_entry struct, so there's no existing place to record the
dynindx.  Further, they're not in the hash table to been seen in the
several _bfd_elf_link_adjust_dynindx traversals.

Second, symbols that begain life as global symbols, but which were hidden
by symbol versioning or whatnot, are supposed to have a dynindx of -1. 
Which gets in the way of the fact that I need it to have an index, but
to be pushed out with STB_LOCAL rather than whatever it had had before.

So I'm wondering how best to go about this.  My current thought is to 
add a table or linked list to elf_link_hash_table that keeps track of
the local symbols we want in the dynamic symbol table.  That, plus a
_bfd_elf_link_record_local_dynamic_symbol entry point, would add direct
support for this feature to the generic elf linker, and would avoid the
creation of yet more bed hooks (or alternately introduce yet more 
hidden order of evaluation fragility).

It would also necessitate the cleanup of the addition of the sections
to the dynamic symbol table, as currently happens scattered across all
the backends and elflink.h.  Because calls to record_dynamic_symbol
and record_local_dynamic_symbol would be interleaved, we'd need to make
a pass at the end of bfd_elf,size_dynamic_sections to renumber the 
dynindx of sections then local syms then global syms.  So we'd actually
make fewer passes across the data structures.

Comments?


r~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]