This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]