llvm-project/lld/test
Peter Smith 0ae7990b60 [ELF][ARM] Support /DISCARD/ of subset of .ARM.exidx sections
Both the .ARM.exidx and .eh_frame sections have a custom SyntheticSection
that acts as a container for the InputSections. The InputSections are added
to the SyntheticSection prior to /DISCARD/ which limits the affect a
/DISCARD/ can have to the whole SyntheticSection. In the majority of cases
this is sufficient as it is not common to discard subsets of the
InputSections. The Linux kernel has one of these scripts which has something
like:
/DISCARD/ : { *(.ARM.exidx.exit.text) *(.ARM.extab.exit.text) ... }
The .ARM.exidx.exit.text are not discarded because the InputSection has been
transferred to the Synthetic Section. The *(.ARM.extab.exit.text) sections
have not so they are discarded. When we come to write out the .ARM.exidx
sections the dangling references from .ARM.exidx.exit.text to
.ARM.extab.exit.text currently cause relocation out of range errors, but
could as easily cause a fatal error message if we check for dangling
references at relocation time.

This patch attempts to respect the /DISCARD/ command by running it on the
.ARM.exidx InputSections stored in the SyntheticSection.

The .eh_frame is in theory affected by this problem, but I don't think that
there is a dangling reference problem that can happen with these sections.

Fixes remaining part of pr44824

Differential Revision: https://reviews.llvm.org/D79687
2020-05-11 14:27:13 +01:00
..
COFF [LLD] [COFF] Fix def file exporting of symbols containing periods 2020-05-10 23:30:14 +03:00
Driver/Inputs
ELF [ELF][ARM] Support /DISCARD/ of subset of .ARM.exidx sections 2020-05-11 14:27:13 +01:00
MachO [lld-macho] Delete dylink-lazy test for now 2020-05-10 02:22:33 -07:00
MinGW Use error instead of fatal to report usage errors 2019-10-10 09:46:41 +00:00
Unit Revert "Temporarily revert "build: use `find_package(Python3)` if available"" 2020-04-29 01:38:08 +00:00
darwin [Darwin] Do not error on '-lto_library' option 2018-06-13 18:59:14 +00:00
mach-o Reland D78837 [lld] Remove special cases from default ld driver mode. 2020-04-29 14:45:44 -07:00
wasm [WebAssembly] Disallow 'shared-mem' rather than 'atomics' 2020-05-08 13:52:39 -07:00
CMakeLists.txt [lld-macho] Use export trie instead of symtab when linking against dylibs 2020-05-09 20:56:22 -07:00
lit.cfg.py ELF: Change FileSize back to a uint64_t. 2019-03-01 18:53:41 +00:00
lit.site.cfg.py.in Revert "Temporarily revert "build: use `find_package(Python3)` if available"" 2020-04-29 01:38:08 +00:00