mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199312 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user