diff options
author | jasonliu <jasonliu.development@gmail.com> | 2019-12-19 20:30:12 +0000 |
---|---|---|
committer | jasonliu <jasonliu.development@gmail.com> | 2019-12-19 21:20:33 +0000 |
commit | ac741f98c1770a451d4f638d93264287cbe0074f (patch) | |
tree | ef83b223e2b94891ce3e5d76117133441951d611 /llvm/lib/MC/XCOFFObjectWriter.cpp | |
parent | df2e2ab07b48b81fb440e3522c6e639e8ef8f2e9 (diff) | |
download | bcm5719-llvm-ac741f98c1770a451d4f638d93264287cbe0074f.tar.gz bcm5719-llvm-ac741f98c1770a451d4f638d93264287cbe0074f.zip |
[XCOFF][AIX] Fix for missing of undefined symbols from symbol table
Summary:
When we use undefined symbol with its qualname, we are not able
to generate that symbol because of the logic of early "continue"
that skip the qualname symbol. This patch fixes it.
Differential revision: https://reviews.llvm.org/D71667
Diffstat (limited to 'llvm/lib/MC/XCOFFObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/XCOFFObjectWriter.cpp | 14 |
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"); |