[PATCH] D75131: [llvm-objdump][XCOFF][AIX] Implement -r option

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 08:06:13 PDT 2020


jasonliu marked 2 inline comments as done.
jasonliu added inline comments.


================
Comment at: llvm/test/tools/llvm-objdump/XCOFF/disassemble-all.test:45-46
+CHECK:        00000090 <d>:
+ONLY-D-NEXT:      90: 00 00 00 00                  	<unknown>
+WITH-R-NEXT:      ...
+CHECK:        00000094 <func>:
----------------
jhenderson wrote:
> I find this behaviour difference confusing. What is causing it?
This block of code kicks in:

```
        if (!DisassembleZeroes) {
          uint64_t MaxOffset = End - Index;
          // For -reloc: print zero blocks patched by relocations, so that
          // relocations can be shown in the dump.
          if (RelCur != RelEnd)
            MaxOffset = RelCur->getOffset() - Index;

          if (size_t N =
                  countSkippableZeroBytes(Bytes.slice(Index, MaxOffset))) {
            outs() << "\t\t..." << '\n';
            Index += N;
            continue;
          }
        }
```
The MaxOffset is larger when we have relocation. So we start to print '...' for that. 

In this file, you might think there is no relocation showing up after line 25. But it's actually there if we check the new print-reloc.test. The reason llvm-objdump is not printing them is because of this patch: https://reviews.llvm.org/D73531. Since we could not disassemble those instructions in the data section, we decide not to analysis them and skipped the relocation printing. This skip printing relocation is not ideal for XCOFF as you could see, but I would like to address it in a different patch.


================
Comment at: llvm/test/tools/llvm-objdump/XCOFF/print-reloc.test:30
+ CHECK-NEXT:00000014 R_POS                    .func
+ CHECK-NEXT:00000018 R_POS                    TOC
----------------
jhenderson wrote:
> Still need a `CHECK-EMPTY:` at the end here.
Thanks. I will address it in the commit if there is no other comment. 


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

https://reviews.llvm.org/D75131





More information about the llvm-commits mailing list