[PATCH] D49547: [ELF] - Get rid of postThunkContents().

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 05:52:44 PDT 2018


grimar added a comment.

Thanks for the feedback, Peter!



================
Comment at: ELF/SyntheticSections.cpp:1822
 
-  if (this->Type != SHT_DYNSYM)
+  if (this->Type != SHT_DYNSYM) {
+    sortSymTabSymbols();
----------------
peter.smith wrote:
> If the only line of code that SymbolTableSection (SHT_SYMTAB) and SymbolTableBaseSection (SHT_DYNSYM) share is getParent()->Link ... Would it be possible to move sortSymTabSymbols into SymbolTableSection::finalizeContents() add the getParent()->Link and let the virtual call mechanism replace the test?
I am not sure I follow here.

SHT_SYMTAB and SHT_DYNSYM are both `SymbolTableSection<ELFT>`:

```
InX::SymTab = make<SymbolTableSection<ELFT>>(*InX::StrTab);
...
InX::DynSymTab = make<SymbolTableSection<ELFT>>(*InX::DynStrTab);
```

So I think the virtual call mechanism will not be helpful here?
(Since we do not have different classes for them atm. And need them both to be `SymbolTableSection` for `writeTo` I think).


https://reviews.llvm.org/D49547





More information about the llvm-commits mailing list