Home Explore Blog CI



man-pages

23th chunk of `ld.man`
0fadbb791f3162b4efc2cfbe1be4eb5b7d2d2d16eb5ab1820000000100000fa6
 are referenced from a shared library to be assigned addresses only in the main program.  This eliminates the unused duplicate space in the
           shared library, and also prevents any possible confusion over resolving to the wrong duplicate when there are many dynamic modules with specialized search paths for runtime symbol resolution.

       --force-group-allocation
           This option causes the linker to place section group members like normal input sections, and to delete the section groups.  This is the default behaviour for a final link but this option can be used to change  the
           behaviour of a relocatable link (-r).  The script command "FORCE_GROUP_ALLOCATION" has the same effect.

       --defsym=symbol=expression
           Create  a  global symbol in the output file, containing the absolute address given by expression.  You may use this option as many times as necessary to define multiple symbols in the command line.  A limited form
           of arithmetic is supported for the expression in this context: you may give a hexadecimal constant or the name of an existing symbol, or use "+" and "-" to add or subtract hexadecimal constants or symbols.  If you
           need more elaborate expressions, consider using the linker command language from a script.  Note: there should be no white space between symbol, the equals sign ("="), and expression.

           The linker processes --defsym arguments and -T arguments in order, placing --defsym before -T will define the symbol before the linker script from -T is processed, while placing --defsym after -T will  define  the
           symbol  after  the  linker  script  has  been processed.  This difference has consequences for expressions within the linker script that use the --defsym symbols, which order is correct will depend on what you are
           trying to achieve.

       --demangle[=style]
       --no-demangle
           These options control whether to demangle symbol names in error messages and other output.  When the linker is told to demangle, it tries  to  present  symbol  names  in  a  readable  fashion:  it  strips  leading
           underscores  if they are used by the object file format, and converts C++ mangled symbol names into user readable names.  Different compilers have different mangling styles.  The optional demangling style argument
           can be used to choose an appropriate demangling style for your compiler.  The linker will demangle by default unless the environment variable COLLECT_NO_DEMANGLE is set.  These options may be used to override  the
           default.

       -Ifile
       --dynamic-linker=file
           Set the name of the dynamic linker.  This is only meaningful when generating dynamically linked ELF executables.  The default dynamic linker is normally correct; don’t use this unless you know what you are doing.

       --no-dynamic-linker
           When  producing  an  executable  file, omit the request for a dynamic linker to be used at load‐time.  This is only meaningful for ELF executables that contain dynamic relocations, and usually requires entry point
           code that is capable of processing these relocations.

       --embedded-relocs
           This option is similar to the --emit-relocs option except that the relocs are stored in a target‐specific section.  This option is only supported by the BFIN, CR16 and M68K targets.

       --disable-multiple-abs-defs
           Do not allow multiple definitions with symbols included in filename invoked by -R or --just-symbols

       --fatal-warnings
       --no-fatal-warnings
           Treat all warnings as errors.  The default behaviour can be restored with the option --no-fatal-warnings.

       -w
       --no-warnings
           Do not display any warning or error messages.  This overrides --fatal-warnings if it has been enabled.  This option can be used when it is known that the output binary will not work, but there is still a  need  to
  

Title: LD (GNU Linker) - Options: Symbol Definition, Demangling, Dynamic Linker, Relocations, and Warnings
Summary
This section details several linker options, including defining symbols with expressions (--defsym), controlling symbol demangling (--demangle, --no-demangle), setting or omitting the dynamic linker (-Ifile, --dynamic-linker, --no-dynamic-linker), specifying the storage of relocations (--embedded-relocs), disabling multiple absolute definitions (--disable-multiple-abs-defs), and managing warnings (--fatal-warnings, --no-fatal-warnings, -w, --no-warnings).