[PATCH] D67094: [llvm-readelf] - Print unknown st_other value if present in GNU output.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 23:07:01 PDT 2019


MaskRay added a comment.

> In compare with GNU, this logic is simpler and seems more consistent. The details about the known differences were listed in the comments on a bug page.

We should summarize what GNU readelf does. IIRC it interprets certain bits for some archs

  0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
  1: 00000000     0 NOTYPE  GLOBAL DEFAULT [OPTIONAL]   UND a1
  2: 00000000     0 NOTYPE  GLOBAL DEFAULT [MIPS PLT]   UND a2
  3: 00000000     0 NOTYPE  GLOBAL DEFAULT [MIPS PIC]   UND a3
  4: 00000000     0 NOTYPE  GLOBAL DEFAULT [MICROMIPS]   UND a4
  5: 00000000     0 NOTYPE  GLOBAL DEFAULT [MIPS16]   UND a5
  6: 00000000     0 NOTYPE  GLOBAL DEFAULT [<other>: c]   UND b1
  7: 00000000     0 NOTYPE  GLOBAL DEFAULT [<other>: 28]   UND b2

On PPC64, it just leaves the field uninterpreted. We choose to print the raw st_other field, prefixed with `0x`.


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

https://reviews.llvm.org/D67094





More information about the llvm-commits mailing list