ld: could PROVIDE_HIDDEN be replaced by PROVIDE in case of static linking?

Leonid Borisenko leo.borisenko@gmail.com
Mon Aug 15 13:42:00 GMT 2011


  Hi,

  [Please CC me on reply, as I am not subscribed to binutils list. Thanks.]

  I'm using ld for linking executable for Cortex-M3 mocrocontroller. All
vendor libraries are compiled from sources, resulting objects are
statically linked and .text section from final ELF is flashed into MCU.
It can be assumed that I'm using default linker script from vanilla GCC
or "standard" linker script provided by CodeSourcery (it doesn't matter
for the sake of my question) -- and some symbols in linker script are
defined with PROVIDE_HIDDEN.

  In curiosity for the semantic of PROVIDE_HIDDEN directive, I've read
binutils documentation. But PROVIDE_HIDDEN section just describes
behavior and doesn't reveals the possible purpose and usecases of
directive. In further lurking for the answer I've found two relevant
messages in binutils mailing list [1] [2], which are slightly clarified
the purpose of PROVIDE_HIDDEN.

  So, as far as I've understood, PROVIDE_HIDDEN is useful for linking
with shared objects, where some standard symbols could be clashed. But
in my case (static linking, single ELF) it could be converted to PROVIDE
without any consequences. Am I right?

[1] http://sourceware.org/ml/binutils/2005-08/msg00054.html
[2] http://sourceware.org/ml/binutils/2006-08/msg00126.html



More information about the Binutils mailing list