summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core/Resolver.cpp
diff options
context:
space:
mode:
authorNick Kledzik <kledzik@apple.com>2012-04-07 01:31:00 +0000
committerNick Kledzik <kledzik@apple.com>2012-04-07 01:31:00 +0000
commitb334be1ed23b7e4e3820742c0d526d3f6be25738 (patch)
tree894ba70d71604040d875d444e862318b4d0c652e /lld/lib/Core/Resolver.cpp
parentc4d558a43e18b1fa2f094f1ea07f70e19bfb8a3c (diff)
downloadbcm5719-llvm-b334be1ed23b7e4e3820742c0d526d3f6be25738.tar.gz
bcm5719-llvm-b334be1ed23b7e4e3820742c0d526d3f6be25738.zip
First implementation of Darwin Platform. It is rich enough to generate
a hello world executable from atoms. There is still much to be flushed out. Added one test case, test/darwin/hello-world.objtxt, which exercises the darwin platform. Added -platform option to lld-core tool to dynamically select platform. llvm-svn: 154242
Diffstat (limited to 'lld/lib/Core/Resolver.cpp')
-rw-r--r--lld/lib/Core/Resolver.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp
index 4afbe4b075d..f0742a2eae3 100644
--- a/lld/lib/Core/Resolver.cpp
+++ b/lld/lib/Core/Resolver.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+#include "lld/Core/LLVM.h"
#include "lld/Core/Resolver.h"
#include "lld/Core/Atom.h"
#include "lld/Core/File.h"
@@ -359,7 +360,7 @@ void Resolver::checkDylibSymbolCollisions() {
// get "main" atom for linkage unit
const Atom *Resolver::entryPoint() {
StringRef symbolName = _platform.entryPointName();
- if (symbolName != nullptr)
+ if ( !symbolName.empty() )
return _symbolTable.findByName(symbolName);
return nullptr;
@@ -387,6 +388,7 @@ void Resolver::resolve() {
this->linkTimeOptimize();
this->tweakAtoms();
this->_result.addAtoms(_atoms);
+ this->_result._mainAtom = this->entryPoint();
}
void Resolver::MergedFile::addAtom(const Atom& atom) {
OpenPOWER on IntegriCloud