llvm-project/lld/ELF
Peter Smith 29c1361557 [LLD][ELF][ARM] Do not substitute BL/BLX for non STT_FUNC symbols.
Recommit of 0b4a047bfb
(reverted in c29003813a) to incorporate
subsequent fix and add a warning when LLD's interworking behavior has
changed.

D73474 disabled the generation of interworking thunks for branch
relocations to non STT_FUNC symbols. This patch handles the case of BL and
BLX instructions to non STT_FUNC symbols. LLD would normally look at the
state of the caller and the callee and write a BL if the states are the
same and a BLX if the states are different.

This patch disables BL/BLX substitution when the destination symbol does
not have type STT_FUNC. This brings our behavior in line with GNU ld which
may prevent difficult to diagnose runtime errors when switching to lld.

This change does change how LLD handles interworking of symbols that do not
have type STT_FUNC from previous versions including the 10.0 release. This
brings LLD in line with ld.bfd but there may be programs that have not been
linked with ld.bfd that depend on LLD's previous behavior. We emit a warning
when the behavior changes.

A summary of the difference between 10.0 and 11.0 is that for symbols
that do not have a type of STT_FUNC LLD will not change a BL to a BLX or
vice versa. The table below enumerates the changes
| relocation     | STT_FUNC | bit(0) | in  | 10.0- out | 11.0+ out |
| R_ARM_CALL     | no       | 1      | BL  | BLX       | BL        |
| R_ARM_CALL     | no       | 0      | BLX | BL        | BLX       |
| R_ARM_THM_CALL | no       | 1      | BLX | BL        | BLX       |
| R_ARM_THM_CALL | no       | 0      | BL  | BLX       | BL        |

Differential Revision: https://reviews.llvm.org/D73542
2020-02-13 09:40:21 +00:00
..
Arch [LLD][ELF][ARM] Do not substitute BL/BLX for non STT_FUNC symbols. 2020-02-13 09:40:21 +00:00
AArch64ErrataFix.cpp [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it 2020-01-25 12:00:18 -08:00
AArch64ErrataFix.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
ARMErrataFix.cpp [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it 2020-01-25 12:00:18 -08:00
ARMErrataFix.h [ELF][ARM] Implement --fix-cortex-a8 to fix erratum 657417 2019-09-16 09:38:38 +00:00
CMakeLists.txt [ThinLTO] Pass CodeGenOpts like UnrollLoops/VectorizeLoop/VectorizeSLP 2020-01-09 21:13:11 -08: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
Config.h [LLD][ELF] Add time-trace to ELF LLD 2020-02-06 12:14:13 +00: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
Driver.cpp [ELF] Support INSERT [AFTER|BEFORE] for orphan sections 2020-02-12 08:21:52 -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] Replace SmallStr.str().str() with std::string conversion operator. 2020-01-29 21:30:21 -08: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 [LLD][ELF] Add time-trace to ELF LLD 2020-02-06 12:14:13 +00: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 Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
InputFiles.h Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
InputSection.cpp [ELF][Mips] Drop an unneeded config->relocatable check 2020-01-31 21:00:28 -08:00
InputSection.h [ELF] Improve --gc-sections compatibility with GNU ld regarding section groups 2019-11-19 08:54:06 -08:00
LTO.cpp [LLD][ELF] Add time-trace to ELF LLD 2020-02-06 12:14:13 +00:00
LTO.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
LinkerScript.cpp [ELF] Support INSERT [AFTER|BEFORE] for orphan sections 2020-02-12 08:21:52 -08:00
LinkerScript.h [ELF] Support INSERT [AFTER|BEFORE] for orphan sections 2020-02-12 08:21:52 -08: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 [LLD][ELF] Add time-trace to ELF LLD 2020-02-06 12:14:13 +00: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 [LLD][ELF] Add time-trace to ELF LLD 2020-02-06 12:14:13 +00:00
OutputSections.cpp [ELF] Refactor uses of getInputSections to improve efficiency NFC 2020-01-21 12:27:52 +00:00
OutputSections.h [ELF] Refactor uses of getInputSections to improve efficiency NFC 2020-01-21 12:27:52 +00:00
README.md
Relocations.cpp [ELF] Mention symbol name in reportRangeError() 2020-01-29 09:38:25 -08:00
Relocations.h [ELF] Delete the RelExpr member R_HINT. NFC 2020-01-14 10:56:53 -08:00
ScriptLexer.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01: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] Support INSERT [AFTER|BEFORE] for orphan sections 2020-02-12 08:21:52 -08:00
ScriptParser.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
SymbolTable.cpp [lld/ELF] PR44498: Support input filename in double quote 2020-01-22 12:03:10 +00:00
SymbolTable.h [ELF] Replace SymbolTable::forEachSymbol with iterator_range symbols() 2019-11-26 09:09:32 -08:00
Symbols.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Symbols.h [ELF] --icf: do not fold preemptible symbols 2019-12-10 09:06:08 -08:00
SyntheticSections.cpp [LLD][ELF] Add time-trace to ELF LLD 2020-02-06 12:14:13 +00:00
SyntheticSections.h [ELF][PPC32] Support canonical PLT 2020-01-25 17:56:37 -08:00
Target.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Target.h [ELF] Mention symbol name in reportRangeError() 2020-01-29 09:38:25 -08:00
Thunks.cpp [ELF][PPC32] Support range extension thunks with addends 2020-01-25 22:32:42 -08:00
Thunks.h [ELF][PPC32] Implement IPLT code sequence for non-preemptible IFUNC 2019-12-29 22:42:53 -08:00
Writer.cpp [ELF] Support INSERT [AFTER|BEFORE] for orphan sections 2020-02-12 08:21:52 -08:00
Writer.h Revert "Revert r370635, it caused PR43241." 2019-09-06 15:57:24 +00:00

README.md

See docs/NewLLD.rst