llvm-capstone/lld/ELF
Peter Smith 86d24193a9 [LLD][ELF][AArch64][ARM] When errata patching, round thunk size to 4KiB.
On some edge cases such as Chromium compiled with full instrumentation we
have a .text section over twice the size of the maximum branch range and
the instrumented code generation containing many examples of the erratum
sequence. The combination of Thunks and many erratum sequences causes
finalizeAddressDependentContent() to not converge. We end up with:
start
- Thunk Creation (disturbs addresses after thunks, creating more patches)
- Patch Creation (disturbs addresses after patches, creating more thunks)
- goto start

In most images with few thunks and patches the mutual disturbance does not
cause convergence problems. As the .text size and number of patches go up
the risk increases.

A way to prevent the thunk creation from interfering with patch creation is
to round up the size of the thunks to a 4KiB boundary when the
erratum patch is enabled. As the erratum sequence only triggers when an
instruction sequence starts at 0xff8 or 0xffc modulo (4 KiB) by making the
thunks not affect addresses modulo (4 KiB) we prevent thunks from
interfering with the patch.

The patches themselves could be aggregated in the same way that Thunks are
within ThunkSections and we could round up the size in the same way. This
would reduce the number of patches created in a .text section size >
128 MiB but would not likely help convergence problems.

Differential Revision: https://reviews.llvm.org/D71281

fixes (remaining part of) pr44071, other part in D71242
2019-12-11 14:09:15 +00:00
..
Arch [ELF][PPC64] Support long branch thunks with addends 2019-12-05 10:17:45 -08:00
AArch64ErrataFix.cpp [LLD][ELF][AArch64][ARM] Add missing classof to patch sections. 2019-12-11 14:09:15 +00:00
AArch64ErrataFix.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
ARMErrataFix.cpp [LLD][ELF][AArch64][ARM] Add missing classof to patch sections. 2019-12-11 14:09:15 +00:00
ARMErrataFix.h [ELF][ARM] Implement --fix-cortex-a8 to fix erratum 657417 2019-09-16 09:38:38 +00:00
CallGraphSort.cpp Fix a few typos in lld/ELF to cycle bots 2019-10-28 21:41:47 -04:00
CallGraphSort.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [ELF] Suggest extern "C" when an undefined reference is mangled while the definition is not 2019-11-08 09:42:50 -08:00
Config.h [ELF] Delete unused Configuration::zExecstack after D56554 2019-11-25 14:44:09 -08:00
Driver.cpp [ELF] Move a computeIsPreemptible() pass into ICF. NFC 2019-12-10 22:21:05 -08:00
Driver.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
DriverUtils.cpp LLD: Don't use the stderrOS stream in link before it's reassigned. 2019-11-21 10:55:03 -05:00
DWARF.cpp [ELF] Wrap things in namespace lld { namespace elf {, NFC 2019-10-07 08:31:18 +00:00
DWARF.h gdb-index: Wire up str_offsets section to avoid incorrect error message about offsets_base 2019-08-07 22:49:14 +00:00
EhFrame.cpp [ELF] Wrap things in namespace lld { namespace elf {, NFC 2019-10-07 08:31:18 +00:00
EhFrame.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
ICF.cpp [ELF] Move a computeIsPreemptible() pass into ICF. NFC 2019-12-10 22:21:05 -08:00
ICF.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InputFiles.cpp [ELF] Refine section group --gc-sections rules to not discard .debug_types 2019-12-10 09:00:58 -08:00
InputFiles.h Forward declare the DWARFCache to avoid including LLVM DWARF details 2019-11-14 14:17:49 -08:00
InputSection.cpp comment typo fix to cycle bots 2019-10-31 07:54:16 -04:00
InputSection.h [ELF] Improve --gc-sections compatibility with GNU ld regarding section groups 2019-11-19 08:54:06 -08:00
LinkerScript.cpp [ELF] Support input section description .rel[a].dyn in /DISCARD/ 2019-11-25 21:49:46 -08:00
LinkerScript.h Fix a few typos in lld/ELF to cycle bots 2019-10-28 21:41:47 -04:00
LTO.cpp [ELF] Replace SymbolTable::forEachSymbol with iterator_range symbols() 2019-11-26 09:09:32 -08:00
LTO.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
MapFile.cpp Make it possible to redirect not only errs() but also outs() 2019-11-18 11:18:06 +09:00
MapFile.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MarkLive.cpp [ELF] Replace SymbolTable::forEachSymbol with iterator_range symbols() 2019-11-26 09:09:32 -08:00
MarkLive.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Options.td [ELF] Error if -Ttext-segment is specified 2019-11-21 09:41:55 -08:00
OutputSections.cpp [LLD][ELF] - Make compression level be dependent on -On. 2019-11-26 11:50:22 +03:00
OutputSections.h [ELF] Make MergeInputSection merging aware of output sections 2019-09-24 11:48:31 +00:00
README.md
Relocations.cpp [ELF][PPC64] Support long branch thunks with addends 2019-12-05 10:17:45 -08:00
Relocations.h [ELF][AArch64] Support R_AARCH64_{CALL26,JUMP26} range extension thunks with addends 2019-12-02 10:07:24 -08:00
ScriptLexer.cpp [ELF] Wrap things in namespace lld { namespace elf {, NFC 2019-10-07 08:31:18 +00:00
ScriptLexer.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
ScriptParser.cpp [ELF] Wrap things in namespace lld { namespace elf {, NFC 2019-10-07 08:31:18 +00:00
ScriptParser.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
Symbols.cpp [ELF] --icf: do not fold preemptible symbols 2019-12-10 09:06:08 -08:00
Symbols.h [ELF] --icf: do not fold preemptible symbols 2019-12-10 09:06:08 -08:00
SymbolTable.cpp Fix a few typos in lld/ELF to cycle bots 2019-10-28 21:41:47 -04:00
SymbolTable.h [ELF] Replace SymbolTable::forEachSymbol with iterator_range symbols() 2019-11-26 09:09:32 -08:00
SyntheticSections.cpp [LLD][ELF][AArch64][ARM] When errata patching, round thunk size to 4KiB. 2019-12-11 14:09:15 +00:00
SyntheticSections.h [LLD][ELF][AArch64][ARM] When errata patching, round thunk size to 4KiB. 2019-12-11 14:09:15 +00:00
Target.cpp [ELF][AArch64] Support R_AARCH64_{CALL26,JUMP26} range extension thunks with addends 2019-12-02 10:07:24 -08:00
Target.h [ELF][AArch64] Support R_AARCH64_{CALL26,JUMP26} range extension thunks with addends 2019-12-02 10:07:24 -08:00
Thunks.cpp [ELF][PPC64] Support long branch thunks with addends 2019-12-05 10:17:45 -08:00
Thunks.h [ELF][AArch64] Support R_AARCH64_{CALL26,JUMP26} range extension thunks with addends 2019-12-02 10:07:24 -08:00
Writer.cpp [ELF] --icf: do not fold preemptible symbols 2019-12-10 09:06:08 -08:00
Writer.h Revert "Revert r370635, it caused PR43241." 2019-09-06 15:57:24 +00:00

See docs/NewLLD.rst