[PATCH] D41049: Compact symbols from 96 to 88 bytes

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 08:47:09 PST 2017


ruiu added inline comments.


================
Comment at: ELF/InputFiles.h:310
+  const typename ELFT::Verdef *getVerdef(uint32_t Index) {
+    assert(Index <= Verdefs.size());
+    return Verdefs[Index];
----------------
If you can trigger this by passing a malformed object file, this should be a fatal() instead of assert().


================
Comment at: ELF/SymbolTable.cpp:481
                             const typename ELFT::Sym &Sym, uint32_t Alignment,
-                            const typename ELFT::Verdef *Verdef) {
+                            unsigned VerdefIndex) {
   // DSO symbols do not affect visibility in the output, so we pass STV_DEFAULT
----------------
unsigned -> uint32_t for consistency.


================
Comment at: ELF/SyntheticSections.cpp:2308
+  SharedFile<ELFT> *File = SS->getFile<ELFT>();
+  const typename ELFT::Verdef *Ver = File->getVerdef(SS->VerdefIndex);
   if (!Ver) {
----------------
You are using getVerdef only here. I might delete that function and just make the member variable public.


https://reviews.llvm.org/D41049





More information about the llvm-commits mailing list