forked from OSchip/llvm-project
[objdump][macho] Check arch before formating reloc name as arm64 addend
Before formating ARM64_RELOC_ADDEND relocation target name as a hex number, the architecture need to be checked since other architectures can define a different relocation type with the same integer as ARM64_RELOC_ADDEND. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D89094
This commit is contained in:
parent
f16cecf375
commit
109113015e
|
@ -453,7 +453,8 @@ static void printRelocationTargetName(const MachOObjectFile *O,
|
|||
bool isExtern = O->getPlainRelocationExternal(RE);
|
||||
uint64_t Val = O->getPlainRelocationSymbolNum(RE);
|
||||
|
||||
if (O->getAnyRelocationType(RE) == MachO::ARM64_RELOC_ADDEND) {
|
||||
if (O->getAnyRelocationType(RE) == MachO::ARM64_RELOC_ADDEND &&
|
||||
(O->getArch() == Triple::aarch64 || O->getArch() == Triple::aarch64_be)) {
|
||||
Fmt << format("0x%0" PRIx64, Val);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue