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

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 06:01:26 PDT 2018


peter.smith accepted this revision.
peter.smith added a comment.
This revision is now accepted and ready to land.

LGTM. Probably worth waiting a bit to see if Rui has any opinions.



================
Comment at: ELF/SyntheticSections.cpp:1822
 
-  if (this->Type != SHT_DYNSYM)
+  if (this->Type != SHT_DYNSYM) {
+    sortSymTabSymbols();
----------------
grimar wrote:
> 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).
My apologies, I think I must have assumed that the DynSym and the SymTab where of different types. Please ignore the suggestion. 


https://reviews.llvm.org/D49547





More information about the llvm-commits mailing list