[PATCH] D33621: Fix for -wrap linker option and LTO, PR 33145
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 2 11:48:39 PDT 2017
pcc added inline comments.
================
Comment at: lld/ELF/SymbolTable.cpp:203-231
template <class ELFT> void SymbolTable<ELFT>::wrap(StringRef Name) {
- SymbolBody *B = find(Name);
- if (!B)
+ SymbolBody *SB = find(Name);
+ if (!SB)
return;
- Symbol *Sym = B->symbol();
- Symbol *Real = addUndefined(Saver.save("__real_" + Name));
- Symbol *Wrap = addUndefined(Saver.save("__wrap_" + Name));
+ Symbol *Sym = SB->symbol();
+ SymbolBody *RB = find("__real_" + Name.str());
+ SymbolBody *WB = find("__wrap_" + Name.str());
----------------
Can we now replace these functions with something that applies the rename to each symbol in `Config->RenamedSymbols`? I think it should be possible with this change to how we declare `RenamedSymbols`.
```
struct RenamedSymbol {
uint8_t OrigBinding;
Symbol *Target;
};
MapVector<Symbol*, RenamedSymbol> RenamedSymbols;
```
https://reviews.llvm.org/D33621
More information about the llvm-commits
mailing list