This is the mail archive of the
mailing list for the binutils project.
ld: could PROVIDE_HIDDEN be replaced by PROVIDE in case of static linking?
- From: Leonid Borisenko <leo dot borisenko at gmail dot com>
- To: binutils at sourceware dot org
- Date: Mon, 15 Aug 2011 16:41:49 +0300
- Subject: ld: could PROVIDE_HIDDEN be replaced by PROVIDE in case of static linking?
[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  , 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?