[PATCH] D112843: [aarch64/mac] Correctly disassemble @TLVPPAGE(OFF) relocs
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 9 10:26:03 PST 2021
MaskRay added a comment.
In D112843#3118529 <https://reviews.llvm.org/D112843#3118529>, @thakis wrote:
> Thanks! I moved the test over.
>
> `llvm-otool -tV` is basically the same as `llvm-objdump --macho -d --no-show-raw-insn` and shorter (cf parseOtoolOptions() in llvm/tools/llvm-objdump/llvm-objdump.cpp -- absence of `-j` is `--no-show-raw-insn`), so I kept the otool invocation. If you feel strongly about changing it to llvm-objdump, I'll change it.
Not strong. I don't know which of `llvm-otool` and `llvm-objdump` should be canonical now...
================
Comment at: llvm/test/tools/llvm-objdump/MachO/disassemble-arm64-tlv-modifers.test:1
+; %p/Inputs/macho-tlv.o was created with
+; `llvm-mc -triple=arm64-apple-ios7.0 -filetype=obj tlv.s` with this tlv.s:
----------------
For newer tests in many test/tools directories (and lld/test), comments start with two comment markers, i.e. `;; `
================
Comment at: llvm/test/tools/llvm-objdump/MachO/disassemble-arm64-tlv-modifers.test:7
+
+; RUN: llvm-objdump -r %p/Inputs/macho-tlv.o \
+; RUN: | FileCheck %s --check-prefix=CHECK-OBJ
----------------
Prefer using `llvm-mc` to create the object file. It does duplicate a bit of work which is tested in test/MC, but it makes the test much easier to update. For test/tools directories we try very hard to avoid prebuilt binaries.
================
Comment at: llvm/test/tools/llvm-objdump/MachO/disassemble-arm64-tlv-modifers.test:12
+
+; CHECK-OBJ: 8 ARM64_RELOC_TLVP_LOAD_PAGEOFF12 _var
+; CHECK-OBJ: 4 ARM64_RELOC_TLVP_LOAD_PAGEOFF12 _var
----------------
May be better checking the assembly as well to show that the relocation is attached to the correct instruction.
Then you'll need `-NEXT:`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112843/new/
https://reviews.llvm.org/D112843
More information about the llvm-commits
mailing list