aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Bradbury <asb@lowrisc.org>2019-07-18 05:22:55 +0000
committerAlex Bradbury <asb@lowrisc.org>2019-07-18 05:22:55 +0000
commit31d5cdbe7714d545c7513b2587f56045f7ff3efb (patch)
treeb703ab9913ec04fa0774f062da61f15875fffa65
parentb882c8bae390b434129cff6acbf6ae7dff63ac69 (diff)
[DWARF][RISCV] Add support for RISC-V relocations needed for debug info
When code relaxation is enabled many RISC-V fixups are not resolved but instead relocations are emitted. This happens even for DWARF debug sections. Therefore, to properly support the parsing of DWARF debug info we need to be able to resolve RISC-V relocations. This patch adds: * Support for RISC-V relocations in RelocationResolver * DWARF support for two relocations per object file offset * DWARF changes to support relocations in more DIE fields The two relocations per offset change is needed because some RISC-V relocations (used for label differences) come in pairs. Relocations can also be emitted for DWARF fields where relocations were not yet evaluated. Adding relocation support for some of these fields is essencial. On the other hand, LLVM currently emits RISC-V relocations for fixups that could be safely evaluated, since they can never be affected by code relaxations. This patch also adds relocation support for the fields affected by those extraneous relocations (the DWARF unit entry Length, and the DWARF debug line entry TotalLength and PrologueLength), for testing purposes. Differential Revision: https://reviews.llvm.org/D62062 Patch by Luís Marques. git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@366402 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--ELF/DWARF.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/ELF/DWARF.cpp b/ELF/DWARF.cpp
index ab06d066b..1e4b36f71 100644
--- a/ELF/DWARF.cpp
+++ b/ELF/DWARF.cpp
@@ -110,7 +110,8 @@ LLDDwarfObj<ELFT>::findAux(const InputSectionBase &sec, uint64_t pos,
DataRefImpl d;
d.p = getAddend<ELFT>(rel);
return RelocAddrEntry{secIndex, RelocationRef(d, nullptr),
- LLDRelocationResolver<RelTy>::resolve, val};
+ val, Optional<object::RelocationRef>(),
+ 0, LLDRelocationResolver<RelTy>::resolve};
}
template <class ELFT>