This is the mail archive of the 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]
Other format: [Raw text]

Custom symbol table with linker plugin


I'm attempting to build a custom symbol table which I would like to include in the loadable segments of the executable. 

The only documentation I found about linker plugins is the GCC WHOPR @
Is there any other documentation available? I've also found some test plugins in the testsuites. (and the gcc lto plugin)

To access the linker's view of the symbol table I first assumed that I only had to subscribe to the "all symbols read" event and that I could access it from there.
I've tried to record the file handles from each input file (claim_file_hook) and tried to use get_symbols(), without success. (I didn't claim the file as I just want the linker to handle it)

My questions are:
a) how can I access the linker's view of the symbol table before it starts resolving relocations and starts building the output file (ie, in the "all symbols read" event) (after GC)
b) The symbol table format I need is an array of structs, holding a pointer to the symbol, a pointer to the name and some bitfields for symbol size/type. (I have litte and big endian targets)
   What would be the recommended way to get this data in the output file? (from within the plugin - and have the linker resolve relocations etc)  

This is for an embedded system which just loads up text/data. 
If there is another way make the standard SYMTAB/STRTAB loadable and place it in the data segment, before bss, that would work too and be a lot easier as well.

Thank you

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