Hello, Here is a suggestion to make --defsym / linker script defined symbols relevant in PIC binaries:
Having --defsym to define a relocated symbol in a PIC library/executable is pointless (it does not serve ANY purpose other than polluting the binary). Therefore, the only relevant use of --defsym in a PIC shared library or PIC executable should be to have a *non-relocated* "absolute address". Incidentally, that's the official purpose of --defsym: "Create a global symbol in the output file, containing the absolute address given by expression." Today's solution is to patch the relocation table after the binary image has been loaded by the Linux linker. Then, --defsym becomes useful in PIC libraries/executables (with this feature, a shared library can call a function located in a stripped executable). -- Pierre Gauthier | "Either find a way, or make one." pie...@trustleap.com | (Hannibal, 247-183 BC) --------------- http://trustleap.ch/ ------------------- Paradiesli 17 - CH-8842 Unteriberg, SZ - Switzerland Tel +41 (0)55 414 20 93 - Fax +41 (0)55 414 20 67 _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils