This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: force symbol to local
Hi Noah,
How can I force a symbol to be local when using "ld -r",
The linker does not have this functionality but the objcopy program does.
a typically use is that I have a lists of global symbol
> provided to the ld and want all else are local,
This is slightly tricker. The easiest way would be to use the "nm"
program to obtain the full list of global symbols in the object file(s)
and then use a script to extract all the ones you want to keep as
global. Then use the "--localize-symbols" switch supported by objcopy
to take the remaining symbols and convert them into local symbols.
Cheers
Nick