Home Explore Blog CI



man-pages

32th chunk of `ld.man`
27f69029f8499e13154df2b3d3d2a031ae774912c0f6f5180000000100000fba
 address given by org.  You may use this option as many times as necessary to locate multiple sections in the command line.  org  must  be  a  single  hexadecimal
           integer; for compatibility with other linkers, you may omit the leading 0x usually associated with hexadecimal values.  Note: there should be no white space between sectionname, the equals sign ("="), and org.

       -Tbss=org
       -Tdata=org
       -Ttext=org
           Same as --section-start, with ".bss", ".data" or ".text" as the sectionname.

       -Ttext-segment=org
           When creating an ELF executable, it will set the address of the first byte of the text segment.

       -Trodata-segment=org
           When  creating  an  ELF  executable  or  shared object for a target where the read‐only data is in its own segment separate from the executable text, it will set the address of the first byte of the read‐only data
           segment.

       -Tldata-segment=org
           When creating an ELF executable or shared object for x86-64 medium memory model, it will set the address of the first byte of the ldata segment.

       --unresolved-symbols=method
           Determine how to handle unresolved symbols.  There are four possible values for method:

           ignore‐all
               Do not report any unresolved symbols.

           report‐all
               Report all unresolved symbols.  This is the default.

           ignore‐in‐object‐files
               Report unresolved symbols that are contained in shared libraries, but ignore them if they come from regular object files.

           ignore‐in‐shared‐libs
               Report unresolved symbols that come from regular object files, but ignore them if they come from shared libraries.  This can be useful when creating a dynamic binary  and  it  is  known  that  all  the  shared
               libraries that it should be referencing are included on the linker’s command line.

           The behaviour for shared libraries on their own can also be controlled by the --[no-]allow-shlib-undefined option.

           Normally the linker will generate an error message for each reported unresolved symbol but the option --warn-unresolved-symbols can change this to a warning.

       --dll-verbose
       --verbose[=NUMBER]
           Display the version number for ld and list the linker emulations supported.  Display which input files can and cannot be opened.  Display the linker script being used by the linker. If the optional NUMBER argument
           > 1, plugin symbol status will also be displayed.

       --version-script=version‐scriptfile
           Specify  the name of a version script to the linker.  This is typically used when creating shared libraries to specify additional information about the version hierarchy for the library being created.  This option
           is only fully supported on ELF platforms which support shared libraries; see VERSION.  It is partially supported on PE platforms, which can use version scripts to filter symbol visibility in auto‐export mode:  any
           symbols marked local in the version script will not be exported.

       --warn-common
           Warn  when  a  common  symbol is combined with another common symbol or with a symbol definition.  Unix linkers allow this somewhat sloppy practice, but linkers on some other operating systems do not.  This option
           allows you to find potential problems from combining global symbols.  Unfortunately, some C libraries use this practice, so you may get some warnings about symbols in the libraries as well as in your programs.

           There are three kinds of global symbols, illustrated here by C examples:

           int i = 1;
               A definition, which goes in the initialized data section of the output file.

           extern int i;
               An undefined reference, which does not allocate space.  There must be either a definition or a common symbol for the variable somewhere.

   

Title: LD (GNU Linker) Options: Section Placement, Unresolved Symbols, and Verbosity
Summary
This section outlines linker options for placing sections at specific addresses using -T options, managing unresolved symbols with --unresolved-symbols, controlling verbosity with --dll-verbose and --verbose, specifying version scripts with --version-script, and warning about common symbols with --warn-common. It details how to handle unresolved symbols from object files and shared libraries, and the implications of combining common symbols.