summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-24 08:39:57 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-24 08:39:57 +0000
commit50e48b359eb4e3d3e22d6e447583619d1feaeeae (patch)
treea2c616c140fa25b075ce581091e303028e663fd9 /lib
parent8a719291db4cd209a7fa2b320f5f83462a2c487f (diff)
downloadllvm-50e48b359eb4e3d3e22d6e447583619d1feaeeae.tar.gz
llvm-50e48b359eb4e3d3e22d6e447583619d1feaeeae.tar.bz2
llvm-50e48b359eb4e3d3e22d6e447583619d1feaeeae.tar.xz
llvm-mc: Tweak undefined symbol handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79898 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/MC/MCAssembler.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp
index 7a67fac7ef..80e1b9e43c 100644
--- a/lib/MC/MCAssembler.cpp
+++ b/lib/MC/MCAssembler.cpp
@@ -294,7 +294,7 @@ public:
// FIXME: Set private external bit.
// Set external bit.
- if (MSD.SymbolData->isExternal())
+ if (MSD.SymbolData->isExternal() || Symbol.isUndefined())
Type |= STF_External;
// struct nlist (12 bytes)
@@ -339,7 +339,7 @@ public:
ie = Asm.symbol_end(); it != ie; ++it) {
MCSymbol &Symbol = it->getSymbol();
- if (!it->isExternal())
+ if (!it->isExternal() && !Symbol.isUndefined())
continue;
uint64_t &Entry = StringIndexMap[Symbol.getName()];
@@ -371,7 +371,7 @@ public:
ie = Asm.symbol_end(); it != ie; ++it) {
MCSymbol &Symbol = it->getSymbol();
- if (it->isExternal())
+ if (it->isExternal() || Symbol.isUndefined())
continue;
uint64_t &Entry = StringIndexMap[Symbol.getName()];
@@ -385,7 +385,6 @@ public:
MSD.SymbolData = it;
MSD.StringIndex = Entry;
- assert(!Symbol.isUndefined() && "Local symbol can not be undefined!");
if (Symbol.isAbsolute()) {
MSD.SectionIndex = 0;
LocalSymbolData.push_back(MSD);