From: Mike F. <va...@ge...> - 2005-12-14 04:11:35
|
while trying to squash some TEXTRELs in a shared library which uses nasm code, i thought why not just make these functions hidden. after all, the TEXTRELs are being caused by code which is jumping to other functions without going through the PLT, but the functions are internal ones only, so exporting them to the PLT makes no sense. with GNU as, i could simply mark the functions as .hidden and the assembler/linker would take care of rewriting the addresses before producing the final shared object and bam, no TEXTRELs. back to my point ... i'm after extending the GLOBAL syntax some more, for example: GLOBAL _bar:function:hidden this would declare the _bar symbol as a function whose visibility is hidden ... in elf terms, the Elf32_Sym should have the st_other field set to STV_HIDDEN instead of the normal STV_DEFAULT (0). ive never looked at the nasm source before, but i managed to extend the output/outelf.c file such that the above syntax works, but now i cant seem to track down the place where all the symbols are written out ... can anyone give me a kick in the right direction ? ive added an 'other' member to the Symbol structure and it is set to the proper STV_XXX value inside of elf_deflabel() ... -mike |