mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-17 17:06:59 +00:00
AArch64: print relocation addends if present on AArch64
llvm-objdump should provide some way of printing out the addends present in the .rela sections for debugging purposes if nothing else. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184072 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0187e7a9ba
commit
7338de37a8
@ -2270,7 +2270,16 @@ error_code ELFObjectFile<ELFT>::getRelocationValueString(
|
|||||||
res = "Unknown";
|
res = "Unknown";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ELF::EM_AARCH64:
|
case ELF::EM_AARCH64: {
|
||||||
|
std::string fmtbuf;
|
||||||
|
raw_string_ostream fmt(fmtbuf);
|
||||||
|
fmt << symname;
|
||||||
|
if (addend != 0)
|
||||||
|
fmt << (addend < 0 ? "" : "+") << addend;
|
||||||
|
fmt.flush();
|
||||||
|
Result.append(fmtbuf.begin(), fmtbuf.end());
|
||||||
|
break;
|
||||||
|
}
|
||||||
case ELF::EM_ARM:
|
case ELF::EM_ARM:
|
||||||
case ELF::EM_HEXAGON:
|
case ELF::EM_HEXAGON:
|
||||||
res = symname;
|
res = symname;
|
||||||
|
8
test/MC/AArch64/elf-reloc-addend.s
Normal file
8
test/MC/AArch64/elf-reloc-addend.s
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// RUN: llvm-mc -triple=aarch64-linux-gnu -filetype=obj -o - %s | llvm-objdump -triple=aarch64-linux-gnu -r - | FileCheck %s
|
||||||
|
|
||||||
|
add x0, x4, #:lo12:sym
|
||||||
|
// CHECK: 0 R_AARCH64_ADD_ABS_LO12_NC sym
|
||||||
|
add x3, x5, #:lo12:sym+1
|
||||||
|
// CHECK: 4 R_AARCH64_ADD_ABS_LO12_NC sym+1
|
||||||
|
add x3, x5, #:lo12:sym-1
|
||||||
|
// CHECK: 8 R_AARCH64_ADD_ABS_LO12_NC sym-1
|
Loading…
Reference in New Issue
Block a user