forked from OSchip/llvm-project
4bbcd63eea
For one metadata section usage, each text section references a metadata section. The metadata sections have a C identifier name to allow the runtime to collect them via `__start_/__stop_` symbols. Since `__start_`/`__stop_` references are always present from live sections, the C identifier name sections appear like GC roots, which means they cannot be discarded by `ld --gc-sections`. To make such sections GCable, either SHF_LINK_ORDER or a section group is needed. SHF_LINK_ORDER is not suitable for the references can be inlined into other functions (See D97430: Function A (in the section .text.A) references its `__sancov_guard` section. Function B inlines A (so now .text.B references `__sancov_guard` - this is invalid with the semantics of SHF_LINK_ORDER). In the linking stage, if `.text.A` gets discarded, and `__sancov_guard` is retained via the reference from `.text.B`, the output will be invalid because `__sancov_guard` references the discarded `.text.A`. LLD errors "sh_link points to discarded section". ) A section group have size overhead, and is cumbersome when there is just one metadata section. Add `-z start-stop-gc` to drop the "__start_/__stop_ references retain non-SHF_LINK_ORDER non-SHF_GROUP C identifier name sections" rule. We reserve the rights to switch the default in the future. Reviewed By: phosek, jrtc27 Differential Revision: https://reviews.llvm.org/D96914 |
||
---|---|---|
.. | ||
ELF | ||
_static | ||
_templates | ||
llvm-theme | ||
AtomLLD.rst | ||
CMakeLists.txt | ||
Driver.rst | ||
NewLLD.rst | ||
Partitions.rst | ||
README.txt | ||
Readers.rst | ||
ReleaseNotes.rst | ||
WebAssembly.rst | ||
conf.py | ||
design.rst | ||
development.rst | ||
error_handling_script.rst | ||
getting_started.rst | ||
hello.png | ||
index.rst | ||
ld.lld.1 | ||
make.bat | ||
missingkeyfunction.rst | ||
open_projects.rst | ||
partitions.dot | ||
partitions.svg | ||
sphinx_intro.rst | ||
windows_support.rst |
README.txt
lld Documentation ================= The lld documentation is written using the Sphinx documentation generator. It is currently tested with Sphinx 1.1.3. We currently use the 'nature' theme and a Beaker inspired structure. See sphinx_intro.rst for more details.