Home Explore Blog CI



man-pages

15th chunk of `ld.man`
248c42cfac8faa0a80f48a0dc050f00a2c37f0d4b77d41510000000100000fc3
        nocombreloc
               Combine multiple dynamic relocation sections and sort to improve dynamic symbol lookup caching.  Do not do this if nocombreloc.

           common
           nocommon
               Generate common symbols with STT_COMMON type during a relocatable link.  Use STT_OBJECT type if nocommon.

           common-page-size=value
               Set the page size most commonly used to value.  Memory image layout will be optimized to minimize memory pages if the system is using pages of this size.

           defs
               Report unresolved symbol references from regular object files.  This is done even if the linker is creating a non‐symbolic shared library.  This option is the inverse of -z undefs.

           dynamic‐undefined‐weak
           nodynamic‐undefined‐weak
               Make undefined weak symbols dynamic when building a dynamic object, if they are referenced from a regular object file and not forced local by symbol visibility or versioning.   Do  not  make  them  dynamic  if
               nodynamic‐undefined‐weak.   If  neither  option  is  given,  a target may default to either option being in force, or make some other selection of undefined weak symbols dynamic.  Not all targets support these
               options.

           execstack
               Marks the object as requiring executable stack.

           global
               This option is only meaningful when building a shared object.  It makes the symbols defined by this shared object available for symbol resolution of subsequently loaded libraries.

           globalaudit
               This option is only meaningful when building a dynamic executable.  This option marks the executable as requiring global auditing by setting the "DF_1_GLOBAUDIT" bit in the "DT_FLAGS_1"  dynamic  tag.   Global
               auditing requires that any auditing library defined via the --depaudit or -P command‐line options be run for all dynamic objects loaded by the application.

           ibtplt
               Generate Intel Indirect Branch Tracking (IBT) enabled PLT entries.  Supported for Linux/i386 and Linux/x86_64.

           ibt Generate GNU_PROPERTY_X86_FEATURE_1_IBT in .note.gnu.property section to indicate compatibility with IBT.  This also implies ibtplt.  Supported for Linux/i386 and Linux/x86_64.

           indirect‐extern‐access
           noindirect‐extern‐access
               Generate  GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS in .note.gnu.property section to indicate that object file requires canonical function pointers and cannot be used with copy relocation.  This option also
               implies noextern‐protected‐data and nocopyreloc.  Supported for i386 and x86-64.

               noindirect‐extern‐access removes GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS from .note.gnu.property section.

           initfirst
               This option is only meaningful when building a shared object.  It marks the object so that its runtime initialization will occur before the runtime initialization of any other objects brought into the  process
               at the same time.  Similarly the runtime finalization of the object will occur after the runtime finalization of any other objects.

           interpose
               Specify that the dynamic loader should modify its symbol search order so that symbols in this shared library interpose all other shared libraries not so marked.

           unique
           nounique
               When  generating  a  shared  library  or  other  dynamically loadable ELF object mark it as one that should (by default) only ever be loaded once, and only in the main namespace (when using "dlmopen"). This is
               primarily used to mark fundamental libraries such as libc, libpthread et al which do not usually function correctly unless they are the sole instances of themselves. This behaviour can  be  overridden  by  the
               "dlmopen" caller and does not apply to certain

Title: LD (GNU Linker) - Keyword Options (Continued): Relocation, Symbols, Page Size, Definitions, Weak Symbols, Stack Execution, Global Symbols, Auditing, IBT, and More
Summary
This section continues detailing linker options related to the `-z` keyword: `combreloc` for dynamic relocation combination, `common` for symbol type during relocatable links, `common-page-size` for memory layout optimization, `defs` for reporting unresolved symbols, `dynamic-undefined-weak` for dynamic weak symbols, `execstack` for executable stack requirement, `global` for shared object symbol availability, `globalaudit` for global auditing requirement, `ibtplt` and `ibt` for Intel Indirect Branch Tracking, `indirect-extern-access` for canonical function pointers, `initfirst` for initialization order, `interpose` for symbol search order modification, and `unique` for marking dynamically loadable objects to be loaded only once.