[PATCH] D68066: [llvm-objdump] Further rearrange llvm-objdump sections for compatability

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 18:16:21 PDT 2019


rupprecht added inline comments.


================
Comment at: lld/test/ELF/mips-got16-relocatable.s:25-26
+# SO: SYMBOL TABLE
+# SO: 00020{{0*}}[[D1:[0-9a-f]+]] .data {{0+}} data
+# SO: 00020{{0*}}[[D2:[0-9a-f]+]] .data {{0+}} data
+
----------------
jhenderson wrote:
> What's the purpose of the new `00020{{0*}}`? I'm guessing the address printed by the disassembly is not the exact value? Could this be improved using some extra switches, so that the pattern is robust to future changes, e.g. different base addresses?
The instruction printed is: `addiu   $4, $25, 0x220`. This corresponds to symbol value 00020220.

I'm not familiar with this test (or mips in general), and I can't quite figure out where the 0002xxxx offset is coming from. Does this regex look better? It should get the last 4 digits, zeroes removed, so the base address can change (as long as the offset is a multiple of 00010000).

Alternatively, I could just force the old ordering by using an intermediate file, e.g.
llvm-objdump -d file.o > tmp
llvm-objdump -t file.o >> tmp
FileCheck --input-file=tmp


================
Comment at: llvm/test/tools/llvm-objdump/all-headers.test:15
 # CHECK: Dynamic Section:
+# CHECK:   INIT                 0x00000000000006a0
 # CHECK: Sections:
----------------
jhenderson wrote:
> What's the point of this line?
I suppose I don't need it anymore.

GNU objdump doesn't print "Dynamic Section:" if there is nothing there, but llvm-objdump does. To compare sections, I added it to the test data. I think it's still useful to keep in the test data, but we don't need to assert on it -- just the header.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68066





More information about the llvm-commits mailing list