[PATCH] D91152: [obj2yaml] - Dump section offsets in some cases.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 01:47:09 PST 2020


grimar added inline comments.


================
Comment at: llvm/test/Object/obj2yaml.test:365
 # ELF-MIPSEL-NEXT:     AddressAlign:    0x0000000000000004
+# ELF-MIPSEL-NEXT:     Offset:          0x0000000000000434
 # ELF-MIPSEL-NEXT:     Info:            .text
----------------
jhenderson wrote:
> Just trying to understand why this and the .data Offsets are needed explicitly here, when they weren't prior to this patch?
1) Before this patch we never dumped the "Offset" field.
2) This is the case when we unable to properly derive the offset of the `.rel.text` and `.data` because they
are not sorted by the file offset in the section header table:

```
Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        00000000 000034 00004c 00  AX  0   0  4
  [ 2] .rel.text         REL             00000000 000434 000030 08     10   1  4
  [ 3] .data             PROGBITS        00000000 000080 000000 00  WA  0   0  4
  [ 4] .bss              NOBITS          00000000 000080 000004 00  WA  0   0  4
  [ 5] .mdebug.abi32     PROGBITS        00000000 000080 000000 00      0   0  1

```


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

https://reviews.llvm.org/D91152



More information about the llvm-commits mailing list