Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion llvm/lib/Object/RelocationResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,8 @@ uint64_t resolveRelocation(RelocationResolver Resolver, const RelocationRef &R,
return Elf64BEObj->getRelSection(R.getRawDataRefImpl())->sh_type;
};

if (GetRelSectionType() == ELF::SHT_RELA) {
if (GetRelSectionType() == ELF::SHT_RELA ||
GetRelSectionType() == ELF::SHT_CREL) {
Addend = getELFAddend(R);
// LoongArch and RISCV relocations use both LocData and Addend.
if (Obj->getArch() != Triple::loongarch32 &&
Expand Down
5 changes: 5 additions & 0 deletions llvm/test/tools/llvm-dwarfdump/X86/debug_info_crel.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Test llvm-dwarfdump handles CREL relocation sections correctly.
RUN: echo "void foo(){}" | clang++ --target=x86_64-pc-linux -Wa,--crel,--allow-experimental-crel -g -c -x c++ - -o %t
RUN: llvm-dwarfdump --debug-info %t | FileCheck %s

CHECK: DW_AT_producer ("clang version