diff options
| author | George Rimar <grimar@accesssoftek.com> | 2017-12-06 08:36:21 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2017-12-06 08:36:21 +0000 |
| commit | ba7afd7043cf9a28e9222cf236f98cb58e13bbf2 (patch) | |
| tree | 9d139cb0c59053afda070733e74c69b3511a16af /lld/ELF/MapFile.cpp | |
| parent | 3275eb7a681574eeb6835536467815c9b21ba090 (diff) | |
[ELF] - Show .plt symbols in -Map output.
As mentioned in PR35471, shared functions for which
.plt entry address is used shows up in bfd's map files.
Patch teaches LLD to do the same.
Differential revision: https://reviews.llvm.org/D40839
llvm-svn: 319879
Diffstat (limited to 'lld/ELF/MapFile.cpp')
| -rw-r--r-- | lld/ELF/MapFile.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp index c89d2375939c..8bf672be6fcf 100644 --- a/lld/ELF/MapFile.cpp +++ b/lld/ELF/MapFile.cpp @@ -52,7 +52,7 @@ static std::vector<Symbol *> getSymbols() { for (InputFile *File : ObjectFiles) { for (Symbol *B : File->getSymbols()) { if (auto *SS = dyn_cast<SharedSymbol>(B)) - if (SS->CopyRelSec) + if (SS->CopyRelSec || SS->NeedsPltAddr) V.push_back(SS); if (auto *DR = dyn_cast<Defined>(B)) if (DR->File == File && !DR->isSection() && DR->Section && @@ -67,10 +67,16 @@ static std::vector<Symbol *> getSymbols() { static SymbolMapTy getSectionSyms(ArrayRef<Symbol *> Syms) { SymbolMapTy Ret; for (Symbol *S : Syms) { - if (auto *DR = dyn_cast<Defined>(S)) + if (auto *DR = dyn_cast<Defined>(S)) { Ret[DR->Section].push_back(S); + continue; + } + + SharedSymbol *SS = cast<SharedSymbol>(S); + if (SS->CopyRelSec) + Ret[SS->CopyRelSec].push_back(S); else - Ret[cast<SharedSymbol>(S)->CopyRelSec].push_back(S); + Ret[InX::Plt].push_back(S); } // Sort symbols by address. We want to print out symbols in the |
