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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 2 01:39:34 PDT 2019


jhenderson 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
+
----------------
rupprecht wrote:
> 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
> 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

Without looking in detail, I'd guess it's just the standard image base, so effectively the default value of '.' in the internal linker script.


================
Comment at: llvm/test/tools/llvm-objdump/output-ordering.test:9
+
+## Test the ordering of most of the headers. Note that --disassemble suppresses
+## --reloc, so we test them independently.
----------------
headers -> output


================
Comment at: llvm/test/tools/llvm-objdump/output-ordering.test:54-67
+  - Name:            .dynamic
+    Type:            SHT_DYNAMIC
+    Flags:           [ SHF_WRITE, SHF_ALLOC ]
+    EntSize:         0x0000000000000010
+    Entries:
+      - Tag:             DT_INIT
+        Value:           0x00000000000006A0
----------------
Get rid of the excessive spacing


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