Sample Header Ad - 728x90

ELF symbol: GLOBAL+HIDDEN

3 votes
1 answer
3462 views
Based on eg. this Oracle description : > STB_GLOBAL > Global symbols. **These symbols are visible to all object files** being combined. One file's definition of a global symbol will satisfy another file's undefined reference to the same global symbol. > ... > STV_HIDDEN > A symbol defined in the current component is hidden if its name **is not visible to other components**. Such a symbol is necessarily protected. This attribute is used to control the external interface of a component. An object named by such a symbol may still be referenced from another component if its address is passed outside. > **A hidden symbol contained in a relocatable object is either removed or converted to STB_LOCAL binding** by the link-editor when the relocatable object is included in an executable file or shared object. However, looking at readelf -s of some simple test program (compiled with GCC on x86-64 Linux), there are some global hidden symbols: FUNC GLOBAL HIDDEN 16 _fini OBJECT GLOBAL HIDDEN 25 __dso_handle OBJECT GLOBAL HIDDEN 25 __TMC_END__ According to the description above this should be both nonsensical and not allowed at all. What are the properties (visibility, interpositioning ability, ...) of this combination?
Asked by Moutaineer of Mariana trench (81 rep)
May 5, 2022, 07:14 PM
Last activity: Aug 2, 2022, 08:11 PM