diff options
Diffstat (limited to 'lld/docs')
| -rw-r--r-- | lld/docs/ELF/linker_script.rst | 30 | ||||
| -rw-r--r-- | lld/docs/ReleaseNotes.rst | 43 | ||||
| -rw-r--r-- | lld/docs/WebAssembly.rst | 15 | ||||
| -rw-r--r-- | lld/docs/index.rst | 9 | ||||
| -rw-r--r-- | lld/docs/ld.lld.1 | 10 |
5 files changed, 64 insertions, 43 deletions
diff --git a/lld/docs/ELF/linker_script.rst b/lld/docs/ELF/linker_script.rst index af29996e92dd..bc2037595e5f 100644 --- a/lld/docs/ELF/linker_script.rst +++ b/lld/docs/ELF/linker_script.rst @@ -61,13 +61,16 @@ In the case where no linker script has been provided or every ``SECTIONS`` command is followed by ``INSERT``, LLD applies built-in rules which are similar to GNU ld's internal linker scripts. -- Align the first section in a ``PT_LOAD`` segment according to ``-z noseparate-code``, - ``-z separate-code``, or ``-z separate-loadable-segments`` -- Define ``__bss_start``, ``end``, ``_end``, ``etext``, ``_etext``, ``edata``, ``_edata`` -- Sort ``.ctors.*``/``.dtors.*``/``.init_array.*``/``.fini_array.*`` and PowerPC64 specific ``.toc`` +- Align the first section in a ``PT_LOAD`` segment according to + ``-z noseparate-code``, ``-z separate-code``, or + ``-z separate-loadable-segments`` +- Define ``__bss_start``, ``end``, ``_end``, ``etext``, ``_etext``, ``edata``, + ``_edata`` +- Sort ``.ctors.*``/``.dtors.*``/``.init_array.*``/``.fini_array.*`` and + PowerPC64 specific ``.toc`` - Place input ``.text.*`` into output ``.text``, and handle certain variants - (``.text.hot.``, ``.text.unknown.``, ``.text.unlikely.``, etc) in the precense of - ``-z keep-text-section-prefix``. + (``.text.hot.``, ``.text.unknown.``, ``.text.unlikely.``, etc) in the + presence of ``-z keep-text-section-prefix``. Output section description ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -94,6 +97,21 @@ The presence of ``address`` can cause the condition unsatisfied. LLD will warn. GNU ld from Binutils 2.35 onwards will reduce sh_addralign so that sh_addr=0 (modulo sh_addralign). +Output section type +------------------- + +When an *OutputSection* *S* has ``(type)``, LLD will set ``sh_type`` or +``sh_flags`` of *S*. ``type`` is one of: + +- ``NOLOAD``: set ``sh_type`` to ``SHT_NOBITS``. +- ``COPY``, ``INFO``, ``OVERLAY``: clear the ``SHF_ALLOC`` bit in ``sh_flags``. +- ``TYPE=<value>``: set ``sh_type`` to the specified value. ``<value>`` must be + an integer or one of ``SHT_PROGBITS, SHT_NOTE, SHT_NOBITS, SHT_INIT_ARRAY, + SHT_FINI_ARRAY, SHT_PREINIT_ARRAY``. + +When ``sh_type`` is specified, it is an error if an input section in *S* has a +different type. + Output section alignment ------------------------ diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst index 82683801fad9..527ab4fead38 100644 --- a/lld/docs/ReleaseNotes.rst +++ b/lld/docs/ReleaseNotes.rst @@ -26,38 +26,33 @@ Non-comprehensive list of changes in this release ELF Improvements ---------------- -* ``--export-dynamic-symbol-list`` has been added. - (`D107317 <https://reviews.llvm.org/D107317>`_) -* ``--why-extract`` has been added to query why archive members/lazy object files are extracted. - (`D109572 <https://reviews.llvm.org/D109572>`_) -* ``e_entry`` no longer falls back to the address of ``.text`` if the entry symbol does not exist. - Instead, a value of 0 will be written. - (`D110014 <https://reviews.llvm.org/D110014>`_) -* If ``-Map`` is specified, ``--cref`` will be printed to the specified file. - (`D114663 <https://reviews.llvm.org/D114663>`_) -* No longer deduplicate local symbol names at the default optimization level of ``-O1``. - This results in a larger ``.strtab`` (usually less than 1%) but a faster link - time. Use optimization level ``-O2`` to restore the deduplication. - -Architecture specific changes: - -* The x86-32 port now supports TLSDESC (``-mtls-dialect=gnu2``). - (`D112582 <https://reviews.llvm.org/D112582>`_) -* The x86-64 port now handles non-RAX/non-adjacent ``R_X86_64_GOTPC32_TLSDESC`` - and ``R_X86_64_TLSDESC_CALL`` (``-mtls-dialect=gnu2``). - (`D114416 <https://reviews.llvm.org/D114416>`_) -* For x86-64, ``--no-relax`` now suppresses ``R_X86_64_GOTPCRELX`` and - ``R_X86_64_REX_GOTPCRELX`` GOT optimization - (`D113615 <https://reviews.llvm.org/D113615>`_) +* ``-z pack-relative-relocs`` is now available to support ``DT_RELR`` for glibc 2.36+. + (`D120701 <https://reviews.llvm.org/D120701>`_) +* ``--no-fortran-common`` (pre 12.0.0 behavior) is now the default. Breaking changes ---------------- -* ... +* The GNU ld incompatible ``--no-define-common`` has been removed. +* The obscure ``-dc``/``-dp`` options have been removed. +* ``-d`` is now ignored. +* If a prevailing COMDAT group defines STB_WEAK symbol, having a STB_GLOBAL symbol in a non-prevailing group is now rejected with a diagnostic. + (`D120626 <https://reviews.llvm.org/D120626>`_) +* Support for the legacy ``.zdebug`` format has been removed. Run + ``objcopy --decompress-debug-sections`` in case old object files use ``.zdebug``. + (`D126793 <https://reviews.llvm.org/D126793>`_) +* ``--time-trace-file=<file>`` has been removed. + Use ``--time-trace=<file>`` instead. + (`D128451 <https://reviews.llvm.org/D128451>`_) COFF Improvements ----------------- +* Added autodetection of MSVC toolchain, a la clang-cl. Also added + ``/winsysroot:`` support for explicit specification of MSVC toolchain + location, similar to clang-cl's ``/winsysroot``. For now, + ``/winsysroot:`` requires also passing in an explicit ``/machine:`` flag. + (`D118070 <https://reviews.llvm.org/D118070>`_) * ... MinGW Improvements diff --git a/lld/docs/WebAssembly.rst b/lld/docs/WebAssembly.rst index ea8917ffc97d..c40d4b322080 100644 --- a/lld/docs/WebAssembly.rst +++ b/lld/docs/WebAssembly.rst @@ -92,6 +92,21 @@ WebAssembly-specific options: this is trivial. For direct function calls, the linker will generate a trapping stub function in place of the undefined function. + import-dynamic: + + Undefined symbols generate WebAssembly imports, including undefined data + symbols. This is somewhat similar to the --import-undefined option but + works all symbol types. This options puts limitations on the type of + relocations that are allowed for imported data symbols. Relocations that + require absolute data addresses (i.e. All R_WASM_MEMORY_ADDR_I32) will + generate an error if they cannot be resolved statically. For clang/llvm + this means inputs should be compiled with `-fPIC` (i.e. `pic` or + `dynamic-no-pic` relocation models). This options is useful for linking + binaries that are themselves static (non-relocatable) but whose undefined + symbols are resolved by a dynamic linker. Since the dynamic linking API is + experimental, this option currently requires `--experimental-pic` to also + be specified. + .. option:: --import-memory Import memory from the environment. diff --git a/lld/docs/index.rst b/lld/docs/index.rst index 50131bda54bd..0086d7ec14f9 100644 --- a/lld/docs/index.rst +++ b/lld/docs/index.rst @@ -18,15 +18,6 @@ Features - LLD is a drop-in replacement for the GNU linkers that accepts the same command line arguments and linker scripts as GNU. - We are currently working closely with the FreeBSD project to make - LLD default system linker in future versions of the operating - system, so we are serious about addressing compatibility issues. As - of February 2017, LLD is able to link the entire FreeBSD/amd64 base - system including the kernel. With a few work-in-progress patches it - can link approximately 95% of the ports collection on AMD64. For the - details, see `FreeBSD quarterly status report - <https://www.freebsd.org/news/status/report-2016-10-2016-12.html#Using-LLVM%27s-LLD-Linker-as-FreeBSD%27s-System-Linker>`_. - - LLD is very fast. When you link a large program on a multicore machine, you can expect that LLD runs more than twice as fast as the GNU gold linker. Your mileage may vary, though. diff --git a/lld/docs/ld.lld.1 b/lld/docs/ld.lld.1 index da43cf0ef7ab..b81eeb2232a2 100644 --- a/lld/docs/ld.lld.1 +++ b/lld/docs/ld.lld.1 @@ -144,8 +144,6 @@ to set the compression level to 6. Output cross reference table. If .Fl Map is specified, print to the map file. -.It Fl -define-common , Fl d -Assign space to common symbols. .It Fl -defsym Ns = Ns Ar symbol Ns = Ns Ar expression Define a symbol alias. .Ar expression @@ -326,8 +324,6 @@ Always set for shared libraries. .It Fl -no-color-diagnostics Do not use colors in diagnostics. -.It Fl -no-define-common -Do not assign space to common symbols. .It Fl -no-demangle Do not demangle symbol names. .It Fl -no-dynamic-linker @@ -811,6 +807,12 @@ processing. .It Cm pac-plt AArch64 only, use pointer authentication in PLT. .Pp +.It Cm pack-relative-relocs +Similar to +.Cm -pack-dyn-relocs=relr +, but synthesizes the GLIBC_ABI_DT_RELR version dependency if there is a GLIBC_2.* version dependency. +glibc ld.so rejects loading a dynamically linked object without the GLIBC_ABI_DT_RELR version dependency. +.Pp .It Cm rel Use REL format for dynamic relocations. .Pp |
