Search code examples
c++cobjdump

What does ".hidden" mean in the output of output objdump -t?


Example:

$ objdump Logger.cpp.o  -t

00000000 g     F .text  00000000 .hidden __sti___10_Logger_cpp_0b2ae32b

Solution

  • It means that the visibility of the symbol is hidden: https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html

    Reasons for changing the visibility of symbols include:

    • Less risk of symbol collision.
    • Smaller binaries.
    • Reduced start-up time because the dynamic linker does not need to process as many symbols.
    • Opportunities for more efficient code because the compiler knows that a symbol cannot be overridden via an LD_PRELOAD-type system.
    • Prevention of third-party software calling into undocumented APIs.

    See http://www.gnu.org/software/gnulib/manual/html_node/Exported-Symbols-of-Shared-Libraries.html for more information.