[PATCH] D70495: [llvm-readobj/llvm-readelf] - Reimplement dumping of the SHT_GNU_verdef section.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 18:52:59 PST 2019


MaskRay added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/elf-versioninfo.test:290
+
+## Check that we report when a SHT_GNU_verdef section is linked with a section that do not exist.
+
----------------
How about "report an error ... sh_link references a non-existent section"


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3953
+                         "of the section");
+    const Elf_Verdaux *Verdaux =
+        reinterpret_cast<const Elf_Verdaux *>(VerdauxBuf);
----------------
Probably just `auto *`


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3982
+
+    const uint8_t *VerdauxBuf = VerdefBuf + D->vd_aux;
+    for (unsigned J = 0; J < D->vd_cnt; ++J) {
----------------
Check alignment, probably `D->vd_aux % alignof(VerdAux) == 0`,
otherwise this may trigger a misaligned exception on some architectures.


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

https://reviews.llvm.org/D70495





More information about the llvm-commits mailing list