[PATCH] D89094: [objdump][macho] Check arch before formating reloc name as arm64 addend
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 9 00:40:33 PDT 2020
jhenderson added a comment.
This is outside my area of expertise to review, but regarding testing, you should use yaml2obj to create a Mach-O input with AARCH64 type (and also one with the big-endian version too), and then also one with a different machine type to show the opposite behaviour happens. There are plenty of examples of Mach-O yaml2obj inputs in various places. Take a look in existing tests to find them.
================
Comment at: llvm/tools/llvm-objdump/MachODump.cpp:454
bool isExtern = O->getPlainRelocationExternal(RE);
+ bool isArm64 =
+ O->getArch() == Triple::aarch64 || O->getArch() == Triple::aarch64_be;
----------------
Alternatively, I'd just inline the check as it's only used in one place.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89094/new/
https://reviews.llvm.org/D89094
More information about the llvm-commits
mailing list