[PATCH] D59877: [llvm-readobj][WIP] Add GNU style dumper for .gnu.version section

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 15:31:11 PDT 2019


rupprecht accepted this revision.
rupprecht added a comment.
This revision is now accepted and ready to land.

Very cool. It looks like -V also prints a definition/needed section that this patch doesn't support yet. Is that coming in a later patch?

i.e.,

  $ readelf -V ~/src/llvm-project/llvm/test/tools/llvm-readobj/Inputs/verdef.elf-x86-64
  
  Version symbols section '.gnu.version' contains 8 entries:
   Addr: 000000000000024c  Offset: 0x00024c  Link: 1 (.dynsym)
    000:   0 (*local*)       1 (*global*)      1 (*global*)      3 (VERSION2)
    004:   1 (*global*)      2 (VERSION1)      2 (VERSION1)      3 (VERSION2)
  
  # This block is missing from this patch
  Version definition section '.gnu.version_d' contains 3 entries:
    Addr: 0x000000000000025c  Offset: 0x00025c  Link: 2 (.dynstr)
    000000: Rev: 1  Flags: BASE  Index: 1  Cnt: 1  Name: blah
    0x001c: Rev: 1  Flags: none  Index: 2  Cnt: 1  Name: VERSION1
    0x0038: Rev: 1  Flags: none  Index: 3  Cnt: 2  Name: VERSION2
    0x0054: Parent 1: VERSION1
  
  $ readelf -V ~/src/llvm-project/llvm/test/tools/llvm-readobj/Inputs/verneed.elf-x86-64 
  
  Version symbols section '.gnu.version' contains 4 entries:
   Addr: 0000000000010228  Offset: 0x000228  Link: 1 (.dynsym)
    000:   0 (*local*)       2 (v3)            3 (v2)            4 (v1)         
  
  # This block is missing from this patch
  Version needs section '.gnu.version_r' contains 2 entries:
   Addr: 0x0000000000010230  Offset: 0x000230  Link: 5 (.dynstr)
    000000: Version: 1  File: verneed1.so.0  Cnt: 2
    0x0020:   Name: v2  Flags: none  Version: 3
    0x0030:   Name: v3  Flags: none  Version: 2
    0x0010: Version: 1  File: verneed2.so.0  Cnt: 1
    0x0040:   Name: v1  Flags: none  Version: 4


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59877





More information about the llvm-commits mailing list