MC/Mach-O: Mark absolute variable's appropriately, and add Mach-O support for
writing them.
- <rdar://problem/7885351> integrated assembler broken for i386 objc code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103112 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCSymbol.cpp b/lib/MC/MCSymbol.cpp
index 82d72a3..07751f7 100644
--- a/lib/MC/MCSymbol.cpp
+++ b/lib/MC/MCSymbol.cpp
@@ -44,6 +44,10 @@
assert((isUndefined() || (isAbsolute() && isa<MCConstantExpr>(Value))) &&
"Invalid redefinition!");
this->Value = Value;
+
+ // Mark the variable as absolute as appropriate.
+ if (isa<MCConstantExpr>(Value))
+ setAbsolute();
}
void MCSymbol::print(raw_ostream &OS) const {