diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-01-15 09:16:42 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-01-15 09:16:42 +0000 |
commit | dee105772c5b5662e1a046b1c102467c84a09d26 (patch) | |
tree | c1395726ad714912c52e1f8edbabaed8c863ac88 /llvm/lib/CodeGen | |
parent | 888d52a6556eec27341ba635a64315dd08c269aa (diff) | |
download | bcm5719-llvm-dee105772c5b5662e1a046b1c102467c84a09d26.tar.gz bcm5719-llvm-dee105772c5b5662e1a046b1c102467c84a09d26.zip |
WinCOFF: Transform IR expressions featuring __ImageBase into image relative relocations
MSVC on x64 requires that we create image relative symbol
references to refer to RTTI data. Seeing as how there is no way to
explicitly make reference to a given relocation type in LLVM IR, pattern
match expressions of the form &foo - &__ImageBase.
Differential Revision: http://llvm-reviews.chandlerc.com/D2523
llvm-svn: 199312
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index cf950f8cc75..365a73d9753 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1512,6 +1512,10 @@ static const MCExpr *lowerConstant(const Constant *CV, AsmPrinter &AP) { llvm_unreachable("Unknown constant value to lower!"); } + if (const MCExpr *RelocExpr = + AP.getObjFileLowering().getExecutableRelativeSymbol(CE, AP.Mang)) + return RelocExpr; + switch (CE->getOpcode()) { default: // If the code isn't optimized, there may be outstanding folding |