llvm-project/lld/ELF
Alexander Richardson f463042312 [ELF][MIPS] Fix crash in LLD when linking code that needs PIC thunks
Summary:
The bug triggers when the following conditions are met:
    - A thunk is created in a given input section S
    - A linker script is specified
    - There is at least one matcher in the linker script .text section output
      that does not match any of the sections in the input files, before the matcher
      that matches section S.

The issue was found when linking the FreeBSD kernel for MIPS when built
with -fPIC. Patch by Alfredo Mazzinghi.

Reviewers: ruiu, psmith, atanasyan

Reviewed By: ruiu

Subscribers: peter.smith, emaste, sdardis, krytarowski, llvm-commits

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

llvm-svn: 318653
2017-11-20 15:37:19 +00:00
..
Arch [MIPS] Set STO_MIPS_MICROMIPS flag and less-significant bit for microMIPS symbols 2017-11-13 22:40:36 +00:00
Bits.h Move bit operations to a new file, ELF/Bits.h. 2017-10-26 21:37:17 +00:00
CMakeLists.txt [lld] unified COFF and ELF error handling on new Common/ErrorHandler 2017-10-25 22:28:38 +00:00
Config.h Merge SymbolBody and Symbol into one class, SymbolBody. 2017-10-31 16:07:41 +00:00
Driver.cpp Delete dead code. 2017-11-07 23:12:41 +00:00
Driver.h Move new lld's code to Common subdirectory. 2017-10-02 21:00:41 +00:00
DriverUtils.cpp [lld] unified COFF and ELF error handling on new Common/ErrorHandler 2017-10-25 22:28:38 +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 [ELF] - Teach LLD to use information from .debug_str for error reporting. 2017-11-17 11:57:47 +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 ELF: Merge DefinedRegular and Defined. 2017-11-06 04:35:31 +00:00
ICF.h [ELF] - Apply clang-format. NFC. 2017-07-18 11:55:35 +00:00
InputFiles.cpp [ELF] - Allow applying SHF_MERGE optimization for relocatable output. 2017-11-17 11:27:57 +00:00
InputFiles.h Rename SymbolBody -> Symbol 2017-11-03 21:21:47 +00:00
InputSection.cpp [ELF] - Don't emit broken relocations for SHF_MERGE sections when --emit-relocs is used. 2017-11-16 12:33:36 +00:00
InputSection.h ELF: Merge DefinedRegular and Defined. 2017-11-06 04:35:31 +00:00
LTO.cpp Remove IsLocal. 2017-11-17 01:37:50 +00:00
LTO.h Move new lld's code to Common subdirectory. 2017-10-02 21:00:41 +00:00
LinkerScript.cpp [ELF] - Allow applying SHF_MERGE optimization for relocatable output. 2017-11-17 11:27:57 +00:00
LinkerScript.h ELF: Merge DefinedRegular and Defined. 2017-11-06 04:35:31 +00:00
MapFile.cpp ELF: Merge DefinedRegular and Defined. 2017-11-06 04:35:31 +00:00
MapFile.h Pass symbol attributes instead of ElfSym to Shared symbol ctor. 2017-10-28 20:15:56 +00:00
MarkLive.cpp ELF: Remove function Symbol::isInCurrentOutput(). 2017-11-06 04:39:07 +00:00
Memory.h [ELF] - Apply clang-format. NFC. 2017-07-18 11:55:35 +00:00
Options.td Ignore -no-ctors-in-init-array. 2017-11-17 08:17:36 +00:00
OutputSections.cpp Drop conflicting sh_entsize values. 2017-11-15 17:35:22 +00:00
OutputSections.h ELF: Merge DefinedRegular and Defined. 2017-11-06 04:35:31 +00:00
README.md
Relocations.cpp [ELF][MIPS] Fix crash in LLD when linking code that needs PIC thunks 2017-11-20 15:37:19 +00:00
Relocations.h Rename Body -> Sym. 2017-11-04 00:31:04 +00:00
ScriptLexer.cpp [lld] unified COFF and ELF error handling on new Common/ErrorHandler 2017-10-25 22:28:38 +00:00
ScriptLexer.h Move new lld's code to Common subdirectory. 2017-10-02 21:00:41 +00:00
ScriptParser.cpp [ELF] Support expressions with -defsym option 2017-11-04 02:03:58 +00:00
ScriptParser.h [ELF] Support expressions with -defsym option 2017-11-04 02:03:58 +00:00
Strings.cpp [lld] unified COFF and ELF error handling on new Common/ErrorHandler 2017-10-25 22:28:38 +00:00
Strings.h [ELF] - Update after LLVM r314883 change. NFC. 2017-10-04 08:50:34 +00:00
SymbolTable.cpp Remove IsLocal. 2017-11-17 01:37:50 +00:00
SymbolTable.h Remove IsLocal. 2017-11-17 01:37:50 +00:00
Symbols.cpp Move MIPS-specific code from Symbols.cpp to MIPS.cpp. 2017-11-07 00:04:22 +00:00
Symbols.h Remove IsLocal. 2017-11-17 01:37:50 +00:00
SyntheticSections.cpp Remove IsLocal. 2017-11-17 01:37:50 +00:00
SyntheticSections.h ELF: Remove DefinedCommon. 2017-11-06 04:33:58 +00:00
Target.cpp Rename SymbolBody -> Symbol 2017-11-03 21:21:47 +00:00
Target.h Move MIPS-specific code from Symbols.cpp to MIPS.cpp. 2017-11-07 00:04:22 +00:00
Thunks.cpp [MIPS] Setup less-significant bit in a symbol value in microMIPS thunks 2017-11-09 10:42:22 +00:00
Thunks.h ELF: Merge DefinedRegular and Defined. 2017-11-06 04:35:31 +00:00
Writer.cpp [ELF] - Allow applying SHF_MERGE optimization for relocatable output. 2017-11-17 11:27:57 +00:00
Writer.h [MIPS] Set STO_MIPS_MICROMIPS flag and less-significant bit for microMIPS symbols 2017-11-13 22:40:36 +00:00

README.md

See docs/NewLLD.rst