[PATCH] D88468: [llvm-readobj] Fix error when printing out stabs symbols of type N_OSO

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 00:13:16 PDT 2020


grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/MachO/stabs.yaml:180
+      n_desc:          0
+      n_value:         4294971296
+  StringTable:
----------------
2 points:

1) There are a few symbols with duplicating types. E.g. there are 3 that have type == `0x64`. It does not make sense to test the same type again and again. This makes the test larger for no reason.

You've previously said that "symbols are harder to remove", but I've tried and found it is actually very easy: all you need is to remove a symbol and adjust the `nsyms` value. E.g in the piece below I've removed duplicated symbols with type == `0x64`:


```
    nsyms:           7
    stroff:          4328
    strsize:         104
LinkEditData:
  NameList:
    - n_strx:          45
      n_type:          0x64
      n_sect:          0
      n_desc:          0
      n_value:         0
    - n_strx:          72
      n_type:          0x66
      n_sect:          3
      n_desc:          1
      n_value:         1601361378
    - n_strx:          1
      n_type:          0x2E
      n_sect:          1
      n_desc:          0
      n_value:         4294971296
    - n_strx:          96
      n_type:          0x24
      n_sect:          1
      n_desc:          0
      n_value:         4294971296
    - n_strx:          1
      n_type:          0x24
      n_sect:          0
      n_desc:          0
      n_value:         15
    - n_strx:          1
      n_type:          0x4E
      n_sect:          1
      n_desc:          0
      n_value:         15
    - n_strx:          22
      n_type:          0x0F
      n_sect:          1
      n_desc:          0
      n_value:         4294971296

```

2) It is not clear what each `n_type` means. Probably worth adding comments:

```
    - n_strx:          72
      n_type:          0x66 ## N_OSO
      n_sect:          3
      n_desc:          1
      n_value:         1601361378
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88468



More information about the llvm-commits mailing list