diff options
author | Rui Ueyama <ruiu@google.com> | 2017-10-28 21:11:38 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2017-10-28 21:11:38 +0000 |
commit | 4a22edabec95a4c1197212f86a63d21ab2a6194a (patch) | |
tree | 11a810010af8d30cf26cae2a41b72785bae53e7b /lld/ELF/MapFile.cpp | |
parent | 294f88dfa0da99edf12947be24ca6917c1bf75dd (diff) | |
download | bcm5719-llvm-4a22edabec95a4c1197212f86a63d21ab2a6194a.tar.gz bcm5719-llvm-4a22edabec95a4c1197212f86a63d21ab2a6194a.zip |
Do not handle DefinedCommon symbols in the MapFile writer.
Because of r314495 which converts DefinedCommon symbols to DefinedRegular
symbols, common symbols are no longer reachable to the MapFile writer.
So the code to handle common symbols is now dead.
llvm-svn: 316846
Diffstat (limited to 'lld/ELF/MapFile.cpp')
-rw-r--r-- | lld/ELF/MapFile.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp index 591c4d80d4d..852f017a591 100644 --- a/lld/ELF/MapFile.cpp +++ b/lld/ELF/MapFile.cpp @@ -26,9 +26,7 @@ #include "Strings.h" #include "SymbolTable.h" #include "SyntheticSections.h" - #include "lld/Common/Threads.h" - #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -51,30 +49,21 @@ static std::string indent(int Depth) { return std::string(Depth * 8, ' '); } // Returns a list of all symbols that we want to print out. static std::vector<Defined *> getSymbols() { std::vector<Defined *> V; - for (InputFile *File : ObjectFiles) { - for (SymbolBody *B : File->getSymbols()) { - if (auto *DR = dyn_cast<DefinedRegular>(B)) { + for (InputFile *File : ObjectFiles) + for (SymbolBody *B : File->getSymbols()) + if (auto *DR = dyn_cast<DefinedRegular>(B)) if (DR->getFile() == File && !DR->isSection() && DR->Section && DR->Section->Live) V.push_back(DR); - } else if (auto *DC = dyn_cast<DefinedCommon>(B)) { - if (DC->Section) - V.push_back(DC); - } - } - } return V; } // Returns a map from sections to their symbols. static SymbolMapTy getSectionSyms(ArrayRef<Defined *> Syms) { SymbolMapTy Ret; - for (Defined *S : Syms) { + for (Defined *S : Syms) if (auto *DR = dyn_cast<DefinedRegular>(S)) Ret[DR->Section].push_back(S); - else if (auto *DC = dyn_cast<DefinedCommon>(S)) - Ret[DC->Section].push_back(S); - } // Sort symbols by address. We want to print out symbols in the // order in the output file rather than the order they appeared |