You copied the Doc URL to your clipboard.

Automatic dynamic symbol table rules in the SysV memory model

There are rules that apply to dynamic symbol tables for the System V (SysV) memory model.

The following rules apply:

Executable

An undefined symbol reference is an undefined symbol error.

Global symbols with STV_HIDDEN or STV_INTERNAL visibility are never exported to the dynamic symbol table.

Global symbols with STV_PROTECTED or STV_DEFAULT visibility are not exported to the dynamic symbol table unless you specify the --export_all or --export_dynamic option.

Shared library

An undefined symbol reference with STV_DEFAULT visibility is treated as imported and is placed in the dynamic symbol table.

An undefined symbol reference without STV_DEFAULT visibility is an undefined symbol error.

Global symbols with STV_HIDDEN or STV_INTERNAL visibility are never exported to the dynamic symbol table.

Note

STV_HIDDEN or STV_INTERNAL global symbols that are required for relocation can be placed in the dynamic symbol table, however the linker changes them into local symbols to prevent them from being accessed from outside the shared library.

Global symbols with STV_PROTECTED or STV_DEFAULT visibility are always exported to the dynamic symbol table.

Symbol definitions defined for SysV compatibility with glibc

The linker defines the following symbols if the corresponding sections exist in an object:

  • for .init_array sections:

    • __init_array_start.

    • __init_array_end.

  • for .fini_array sections:

    • __fini_array_start.

    • __fini_array_end.

  • for ARM.exidx sections:

    • __exidx_start.

    • __exidx_end.

  • for .preinit_array sections:

    • __preinit_array_start.

    • __preinit_array_end.

  • __executable_start.

  • etext.

  • _etext .

  • __etext.

  • __data_start.

  • edata.

  • _edata.

  • __bss_start.

  • __bss_start__.

  • _bss_end__.

  • __bss_end__.

  • end.

  • _end.

  • __end.

  • __end__

Related information

Was this page helpful? Yes No