Partial symbol export vs --export-dynamic

Jean-Francois Panisset panisset@discreet.com
Sun Jun 17 12:36:00 GMT 2001


 < m3n1771mhs.fsf@north-pole.nickc.cambridge.redhat.com >Nick Clifton writes
>Hi Jean-Francois,
>
>> - does the ELF format on Linux support exporting only some of the
>>   application symbols, or does it have to all-or-nothing?
>
>The ELF format does support exporting only some of an applications
>symbols.
>
>> - how painful would it be for me to add this functionality to
>>   ld/bfd, or is this a project way beyond the scope of a binutils
>>   novice? 
>
>BFD can be a tricky place for a novice, so I would not recommend it as
>a first project.  As an alternative though, you might like to consider
>using the OBJCOPY program.  A recent patch to this program gave it the
>ability to selectively convert global symbols into local symbols, (the
>--localize-symbols command line switch).  With this you could use
>--export-dynamic switch to ld first and then --localize-symbols to
>objcopy to remove those symbols that you do not want to be exported.
>
>Cheers
>        Nick

Unfortunately, there are about 100,000 symbols in the finaly binary,
so integrating objcopy into the Makefile to link the application
would probably not be a practical solution, I will try to play with
it though get a better understanding.

Thanks,
JF



More information about the Binutils mailing list