forked from OSchip/llvm-project
Fix handling of _start being undefined.
We were crashing before. llvm-svn: 247481
This commit is contained in:
parent
9d08009dff
commit
1d12ab3db1
|
@ -476,8 +476,6 @@ template <class ELFT> void SymbolTableSection<ELFT>::writeTo(uint8_t *Buf) {
|
|||
Out = &W.getBSS();
|
||||
break;
|
||||
case SymbolBody::UndefinedKind:
|
||||
if (!Body->isWeak())
|
||||
error(Twine("undefined symbol: ") + Name);
|
||||
case SymbolBody::DefinedAbsoluteKind:
|
||||
case SymbolBody::SharedKind:
|
||||
break;
|
||||
|
@ -614,6 +612,9 @@ template <class ELFT> void Writer<ELFT>::createSections() {
|
|||
for (auto &P : Symtab.getSymbols()) {
|
||||
StringRef Name = P.first;
|
||||
SymbolBody *Body = P.second->Body;
|
||||
if (Body->isStrongUndefined())
|
||||
error(Twine("undefined symbol: ") + Name);
|
||||
|
||||
if (auto *C = dyn_cast<DefinedCommon<ELFT>>(Body))
|
||||
CommonSymbols.push_back(C);
|
||||
if (!includeInSymtab(*Body))
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
||||
# RUN: not lld -flavor gnu2 %t -o %t2 2>&1 | FileCheck %s
|
||||
# CHECK: undefined symbol: _start
|
||||
# REQUIRES: x86
|
Loading…
Reference in New Issue