linking relocatable elf files

Programming, for all ages and all languages.
Post Reply
FlashBurn
Member
Member
Posts: 313
Joined: Fri Oct 20, 2006 10:14 am

linking relocatable elf files

Post by FlashBurn »

1st thing is it possible that I can say to ld, put only those symbols into the symbol table I made global?

The 2nd question is, is it possible to say ld, to put the relocation entry for every function call into the elf file? And I mean every function call not only the calls which are out of an object file. I need this for changing the functions at runtime. (so i needn´t to use indirect calls)
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post by frank »

Maybe these options may help a bit
--export-dynamic
When creating a dynamically linked executable, add all symbols to the dynamic symbol table. The dynamic symbol table is the set of symbols which are visible from dynamic objects at run time. If you do not use this option, the dynamic symbol table will normally contain only those symbols which are referenced by some dynamic object mentioned in the link. If you use dlopen to load a dynamic object which needs to refer back to the symbols defined by the program, rather than some other dynamic object, then you will probably need to use this option when linking the program itself.
-x
--discard-all
Delete all local symbols.

-X
--discard-locals
Delete all temporary local symbols. For most targets, this is all local symbols whose names begin with `L'.
Also take a look at the LD manual
Post Reply