[PATCH] D77580: [llvm-objdump] Fix incomplete relocation output for -D -r mode

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 14:44:48 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/test/tools/llvm-objdump/XCOFF/disassemble-all.test:1
 # REQUIRES: powerpc-registered-target
 
----------------
I would suggest adding an x86_64 test file (`llvm/test/tools/llvm-objdump/MachO/disassemble-relocs-data-x86_64.test`) for another object file format that can expose similar issues.

The following, compiled for `x86_64-apple-darwin` would seem to fit:
```
extern char s[];
void *p = s + 0x60606060606060;
```

`yaml2obj`/`obj2yaml` does not seem to preserve relocation information for Mach-O, but the output seems to be good enough for the test.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1590
+            // instruction/data. Note that it's possible the disassembled data
+            // is not the complete data, and we would see relocation prints in
+            // the middle of the complete data. But this matches the binutils
----------------
Split the sentence using a period instead of using ", and".
s/relocation prints/the relocation print/;



================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1591
+            // is not the complete data, and we would see relocation prints in
+            // the middle of the complete data. But this matches the binutils
+            // objdump output.
----------------
s/. But this matches/, but this is what matches/;


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77580/new/

https://reviews.llvm.org/D77580





More information about the llvm-commits mailing list