llvm-project/lld/ELF
Fangrui Song 75e551e5d8 [ELF] Relax R_RISCV_CALL and R_RISCV_CALL_PLT
A pair of auipc+jalr relocated by R_RISCV_CALL or R_RISCV_CALL_PLT can be
converted to c.j, c.jal, or jal.

* c.j: RVC and displacement is representable as an int12
* c.jal: RV32C and displacement is representable as an int12
* jal: displacement is representable as an int21

Use the D127581 relaxation framework to implement the relaxation. If a shorter
sequence is satisfied, we record the new relocation type in `relocTypes` and
saves the new instruction into `writes`. Finally let `riscvFinalizeRelax` rewrite the
instruction by setting `skip`.

Differential Revision: https://reviews.llvm.org/D127611
2022-07-07 10:18:45 -07:00
..
Arch [ELF] Relax R_RISCV_CALL and R_RISCV_CALL_PLT 2022-07-07 10:18:45 -07:00
AArch64ErrataFix.cpp [ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC 2022-06-29 18:53:38 -07:00
AArch64ErrataFix.h [ELF] AArch64ErrataFix: replace std::map with DenseMap. NFC 2022-02-07 22:02:25 -08:00
ARMErrataFix.cpp [ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC 2022-06-29 18:53:38 -07:00
ARMErrataFix.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
CMakeLists.txt [ELF] Parallelize --compress-debug-sections=zlib 2022-01-25 10:29:04 -08:00
CallGraphSort.cpp [ELF] Don't rely on Symbols.h's transitive inclusion of InputFiles.h. NFC 2022-02-23 20:44:34 -08:00
CallGraphSort.h
Config.h [LTO][ELF] Add selective --save-temps= option 2022-07-06 10:06:18 -07:00
DWARF.cpp [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
DWARF.h [ELF] --gdb-index: skip SHF_GROUP .debug_info 2020-08-13 09:11:01 -07:00
Driver.cpp [LTO][ELF] Add selective --save-temps= option 2022-07-06 10:06:18 -07:00
Driver.h [ELF] Move whyExtract/backwardReferences from LinkerDriver to Ctx. NFC 2022-06-29 17:34:31 -07:00
DriverUtils.cpp [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
EhFrame.cpp [ELF] Support 'G' in .eh_frame 2022-06-08 14:28:58 -07:00
EhFrame.h [ELF] Simplify/optimize EhInputSection::split 2022-01-18 17:03:23 -08:00
ICF.cpp [ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC 2022-06-29 18:53:38 -07:00
ICF.h
InputFiles.cpp [ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC 2022-06-29 18:53:38 -07:00
InputFiles.h [ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC 2022-06-29 18:53:38 -07:00
InputSection.cpp [ELF] Relax R_RISCV_ALIGN 2022-07-07 10:16:09 -07:00
InputSection.h [ELF] Relax R_RISCV_ALIGN 2022-07-07 10:16:09 -07:00
LTO.cpp [LTO][ELF] Add selective --save-temps= option 2022-07-06 10:06:18 -07:00
LTO.h
LinkerScript.cpp Don't use Optional::hasValue (NFC) 2022-06-20 11:33:56 -07:00
LinkerScript.h [ELF] Don't use multiple inheritance for OutputSection. NFC 2022-03-08 11:23:42 -08:00
MapFile.cpp [ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC 2022-06-29 18:53:38 -07:00
MapFile.h [ELF] Move --print-archive-stats= and --why-extract= beside --warn-backrefs report 2022-02-27 20:23:09 +00:00
MarkLive.cpp [ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC 2022-06-29 18:53:38 -07:00
MarkLive.h
Options.td [LTO][ELF] Add selective --save-temps= option 2022-07-06 10:06:18 -07:00
OutputSections.cpp [ELF] Optimize getInputSections. NFC 2022-07-05 23:31:09 -07:00
OutputSections.h [ELF] Optimize getInputSections. NFC 2022-07-05 23:31:09 -07:00
README.md
Relocations.cpp [ELF] Relax R_RISCV_ALIGN 2022-07-07 10:16:09 -07:00
Relocations.h [ELF] Relax R_RISCV_ALIGN 2022-07-07 10:16:09 -07:00
ScriptLexer.cpp [ELF] Support -= *= /= <<= >>= &= |= in symbol assignments 2022-06-25 22:22:59 -07:00
ScriptLexer.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
ScriptParser.cpp [ELF] Improve compound assignment tests 2022-06-25 22:30:52 -07:00
ScriptParser.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00
SymbolTable.cpp [ELF] Drop unused original symbol after wrapping if not defined 2022-04-22 16:47:15 -07:00
SymbolTable.h [ELF] Symbols.h: remove #include "InputFiles.h" 2022-02-23 21:36:45 -08:00
Symbols.cpp [ELF] Move whyExtract/backwardReferences from LinkerDriver to Ctx. NFC 2022-06-29 17:34:31 -07:00
Symbols.h [ELF] Move whyExtract/backwardReferences from LinkerDriver to Ctx. NFC 2022-06-29 17:34:31 -07:00
SyntheticSections.cpp [ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC 2022-06-29 18:53:38 -07:00
SyntheticSections.h [ELF][MTE] Add --android-memtag-* options to synthesize ELF notes 2022-04-04 11:17:36 -07:00
Target.cpp [ELF] De-template getErrorPlace. NFC 2022-01-29 23:05:54 -08:00
Target.h [ELF] Relax R_RISCV_ALIGN 2022-07-07 10:16:09 -07:00
Thunks.cpp [ELF] Don't rely on Symbols.h's transitive inclusion of InputFiles.h. NFC 2022-02-23 20:44:34 -08:00
Thunks.h [lld] Add missing includes (NFC) 2021-06-03 18:55:18 +02:00
Writer.cpp [ELF] Relax R_RISCV_ALIGN 2022-07-07 10:16:09 -07:00
Writer.h [ELF] Clean up headers. NFC 2022-02-07 21:53:34 -08:00

README.md

See docs/NewLLD.rst