[RFC] Allow user to filter symbols in the object file produced by --out-implib

Nick Clifton nickc@redhat.com
Wed Dec 15 17:25:38 GMT 2021


Hi Torbjorn,

> If the bootloader would use the "--out-implib" flag, then there would be a lot more symbols exposed than the symbols that were intended to be shared between the bootloader application and the user application.

> So, what I think could be beneficial for the general ld is to let the user define a set of symbols to expose in the implib without affecting the main output of the linker step (the ELF file).
> 
> I would like to get your opinion on this topic before I start implementing something like this.
> Does it make sense to do this or is there some other way to reduce the number of symbols exposed in the implib without affecting the ELF file?

Could you use objcopy's --keep-symbols option to take the
over populated out-implib file and just keep the symbols
that you wanted ?

If that will not work and you do want to implement a linker
enhancement then I think that you find it easier if you make
it ARM specific, rather than a general feature.  You could
probably implement a new option in ld/scripttempl/armelf.em
and process it in bfd/elf32-arm.c.

Cheers
   Nick



More information about the Binutils mailing list