llvm-project/lld/ELF
James Henderson e1689689d8 [ELF] Compress debug sections after assignAddresses and support custom layout
Previously, in r320472, I moved the calculation of section offsets and sizes
for compressed debug sections into maybeCompress, which happens before
assignAddresses, so that the compression had the required information. However,
I failed to take account of relocations that patch such sections. This had two
effects:

1. A race condition existed when a debug section referred to a different debug
section (see PR35788).
2. References to symbols in non-debug sections would be patched incorrectly.
This is because the addresses of such symbols are not calculated until after
assignAddresses (this was a partial regression caused by r320472, but they
could still have been broken before, in the event that a custom layout was used
in a linker script).

assignAddresses does not need to know about the output section size of
non-allocatable sections, because they do not affect the value of Dot. This
means that there is no longer a reason not to support custom layout of
compressed debug sections, as far as I'm aware. These two points allow for
delaying when maybeCompress can be called, removing the need for the loop I
previously added to calculate the section size, and therefore the race
condition. Furthermore, by delaying, we fix the issues of relocations getting
incorrect symbol values, because they have now all been finalized.

llvm-svn: 321986
2018-01-08 10:17:03 +00:00
..
Arch Make it clear where is a placeholder for later binary patching. 2017-12-27 06:54:18 +00:00
AArch64ErrataFix.cpp Use references instead of pointers. NFC. 2017-12-19 23:59:35 +00:00
AArch64ErrataFix.h [ELF] Fix buildbot warning error. 2017-12-15 10:47:44 +00:00
Bits.h Move bit operations to a new file, ELF/Bits.h. 2017-10-26 21:37:17 +00:00
CMakeLists.txt [ELF] Implement scanner for Cortex-A53 Erratum 843419 2017-12-05 15:59:05 +00:00
Config.h [ELF] Remove Duplicate .ARM.exidx sections 2017-12-15 11:09:41 +00:00
Driver.cpp [ELF] Only scan executables for shlib undefined symbols 2017-12-30 08:00:44 +00:00
Driver.h [ELF] Fall back to search dirs for linker scripts specified with -T 2017-11-20 15:43:20 +00:00
DriverUtils.cpp Remove redundant local variables. 2017-12-11 23:19:11 +00:00
EhFrame.cpp De-template EhReader. NFC. 2017-10-27 03:14:09 +00:00
EhFrame.h De-template EhReader. NFC. 2017-10-27 03:14:09 +00:00
Filesystem.cpp Don't use llvm/Config/config.h. 2017-11-17 21:40:38 +00:00
Filesystem.h Add a missing #include. 2017-11-17 08:17:21 +00:00
GdbIndex.cpp Remove some includes from InputFiles.h. 2017-12-09 16:56:18 +00:00
GdbIndex.h [ELF] - Teach LLD to use information from .debug_str for error reporting. 2017-11-17 11:57:47 +00:00
ICF.cpp Add an option for ICFing data. 2017-12-12 01:36:24 +00:00
ICF.h [ELF] - Apply clang-format. NFC. 2017-07-18 11:55:35 +00:00
InputFiles.cpp Detemplate reportDuplicate. 2017-12-23 17:21:39 +00:00
InputFiles.h Detemplate reportDuplicate. 2017-12-23 17:21:39 +00:00
InputSection.cpp Simplify handling of size relocations. 2018-01-05 21:41:17 +00:00
InputSection.h Detemplate reportDuplicate. 2017-12-23 17:21:39 +00:00
LTO.cpp Use Symbol::File directly. 2017-11-29 22:47:35 +00:00
LTO.h Move new lld's code to Common subdirectory. 2017-10-02 21:00:41 +00:00
LinkerScript.cpp [ELF] Compress debug sections after assignAddresses and support custom layout 2018-01-08 10:17:03 +00:00
LinkerScript.h Delete dead code. NFC. 2017-11-29 01:55:03 +00:00
MapFile.cpp Remove some includes from InputFiles.h. 2017-12-09 16:56:18 +00:00
MapFile.h Pass symbol attributes instead of ElfSym to Shared symbol ctor. 2017-10-28 20:15:56 +00:00
MarkLive.cpp Use dyn_cast instead of dyn_cast_or_null. 2017-12-20 20:46:08 +00:00
Options.td [ELF] Remove Duplicate .ARM.exidx sections 2017-12-15 11:09:41 +00:00
OutputSections.cpp [ELF] Compress debug sections after assignAddresses and support custom layout 2018-01-08 10:17:03 +00:00
OutputSections.h Fix line endings. NFC. 2017-12-12 17:37:01 +00:00
README.md Update the documents of the new LLD. 2016-03-12 06:06:40 +00:00
Relocations.cpp Simplify handling of size relocations. 2018-01-05 21:41:17 +00:00
Relocations.h Rename Body -> Sym. 2017-11-04 00:31:04 +00:00
ScriptLexer.cpp Simplify script lexer. 2017-12-26 10:13:10 +00:00
ScriptLexer.h Move new lld's code to Common subdirectory. 2017-10-02 21:00:41 +00:00
ScriptParser.cpp Add a comment about subtracting two non abs symbols. NFC. 2017-12-26 18:11:14 +00:00
ScriptParser.h [ELF] Support expressions with -defsym option 2017-11-04 02:03:58 +00:00
Strings.cpp Factor out common code to Common/Strings.cpp. 2017-11-28 02:15:26 +00:00
Strings.h Factor out common code to Common/Strings.cpp. 2017-11-28 02:15:26 +00:00
SymbolTable.cpp [ELF] Drop unnecessary VersionId setting in scanShlibUndefined 2018-01-08 05:53:11 +00:00
SymbolTable.h Detemplate reportDuplicate. 2017-12-23 17:21:39 +00:00
Symbols.cpp Define isUndefWeak inline. 2017-12-21 22:26:44 +00:00
Symbols.h [ELF] - Fix mistype in comment. NFC. 2017-12-23 16:34:58 +00:00
SyntheticSections.cpp Centralize Config->IsRela handling. 2018-01-05 20:08:38 +00:00
SyntheticSections.h Centralize Config->IsRela handling. 2018-01-05 20:08:38 +00:00
Target.cpp Use dyn_cast instead of dyn_cast_or_null. 2017-12-20 20:46:08 +00:00
Target.h Use references instead of pointers. NFC. 2017-12-19 23:59:35 +00:00
Thunks.cpp Use references instead of pointers. NFC. 2017-12-19 23:59:35 +00:00
Thunks.h ELF: Merge DefinedRegular and Defined. 2017-11-06 04:35:31 +00:00
Writer.cpp [ELF] Compress debug sections after assignAddresses and support custom layout 2018-01-08 10:17:03 +00:00
Writer.h Detemplate reportDuplicate. 2017-12-23 17:21:39 +00:00

README.md

See docs/NewLLD.rst