[PATCH] D91943: [llvm-readelf/obj] - Fix the possible crash when dumping group sections.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 01:16:14 PST 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/groups.test:389
+
+## We set the content of the string table to '0061626300' ('\0abc\0') to fixup the size of the string table.
+# RUN: yaml2obj %s -DSTRTABCONTENT="0061626300" -DSYM1STNAME=4 -DSYM2STNAME=5 -o %t.signame.o
----------------
I'm confused. Why do we need to do this, rather than just specifying an arbitrarily large `StName` value greater than the string table size?


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:3613
+          ": st_name (0x" + Twine::utohexstr(Sym.st_name) +
+          ") goes past the end of the string table of size 0x" +
+          Twine::utohexstr(Strings.size())));
----------------
Perhaps this makes a bit more sense, since st_name is a value/pointer, rather than a range, so it doesn't "go" anywhere.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91943



More information about the llvm-commits mailing list