[PATCH] D58048: [llvm-readobj] - Simplify .gnu.version_r dumping a bit.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 12 01:50:13 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL353814: [llvm-readobj] - Simplify .gnu.version_r dumping a bit. (authored by grimar, committed by ).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D58048?vs=186233&id=186421#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D58048

Files:
  llvm/trunk/tools/llvm-readobj/ELFDumper.cpp


Index: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
===================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
@@ -711,19 +711,12 @@
   if (!Sec)
     return;
 
-  unsigned VerNeedNum = 0;
-  for (const typename ELFO::Elf_Dyn &Dyn : Dumper->dynamic_table()) {
-    if (Dyn.d_tag == DT_VERNEEDNUM) {
-      VerNeedNum = Dyn.d_un.d_val;
-      break;
-    }
-  }
-
   const uint8_t *SecData = (const uint8_t *)Obj->base() + Sec->sh_offset;
   const typename ELFO::Elf_Shdr *StrTab =
       unwrapOrError(Obj->getSection(Sec->sh_link));
 
   const uint8_t *P = SecData;
+  unsigned VerNeedNum = Sec->sh_info;
   for (unsigned I = 0; I < VerNeedNum; ++I) {
     const VerNeed *Need = reinterpret_cast<const VerNeed *>(P);
     DictScope Entry(W, "Dependency");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58048.186421.patch
Type: text/x-patch
Size: 861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190212/77e64e93/attachment.bin>


More information about the llvm-commits mailing list