summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/XCOFFObjectWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/XCOFFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/XCOFFObjectWriter.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/MC/XCOFFObjectWriter.cpp b/llvm/lib/MC/XCOFFObjectWriter.cpp
index c7cba91c861..932d5d27f4e 100644
--- a/llvm/lib/MC/XCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/XCOFFObjectWriter.cpp
@@ -317,21 +317,21 @@ void XCOFFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
// Nothing to do for temporary symbols.
if (S.isTemporary())
continue;
- const MCSymbolXCOFF *XSym = cast<MCSymbolXCOFF>(&S);
- // Map the symbol into its containing csect.
+ const MCSymbolXCOFF *XSym = cast<MCSymbolXCOFF>(&S);
const MCSectionXCOFF *ContainingCsect = XSym->getContainingCsect();
+ // Handle undefined symbol.
+ if (ContainingCsect->getCSectType() == XCOFF::XTY_ER) {
+ UndefinedCsects.emplace_back(ContainingCsect);
+ continue;
+ }
+
// If the symbol is the csect itself, we don't need to put the symbol
// into csect's Syms.
if (XSym == ContainingCsect->getQualNameSymbol())
continue;
- if (XSym->isUndefined(false)) {
- UndefinedCsects.emplace_back(ContainingCsect);
- continue;
- }
-
assert(WrapperMap.find(ContainingCsect) != WrapperMap.end() &&
"Expected containing csect to exist in map");
OpenPOWER on IntegriCloud