Index: src/IceTargetLoweringX8632.cpp |
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp |
index b092f7ffaa443534d69621800a6e325b5546a7a2..4241b89817c0643015a64f6f03979daa664929a1 100644 |
--- a/src/IceTargetLoweringX8632.cpp |
+++ b/src/IceTargetLoweringX8632.cpp |
@@ -4634,20 +4634,14 @@ TargetGlobalInitX8632::TargetGlobalInitX8632(GlobalContext *Ctx) |
: TargetGlobalInitLowering(Ctx) {} |
void TargetGlobalInitX8632::lower(const VariableDeclaration &Var) { |
- // TODO(jvoung): handle this without text. |
- if (Ctx->getFlags().UseELFWriter) |
- return; |
- |
- Ostream &Str = Ctx->getStrEmit(); |
- |
- const VariableDeclaration::InitializerListType &Initializers = |
- Var.getInitializers(); |
- |
// If external and not initialized, this must be a cross test. |
// Don't generate a declaration for such cases. |
bool IsExternal = Var.isExternal() || Ctx->getFlags().DisableInternal; |
if (IsExternal && !Var.hasInitializer()) return; |
+ Ostream &Str = Ctx->getStrEmit(); |
+ const VariableDeclaration::InitializerListType &Initializers = |
+ Var.getInitializers(); |
bool HasNonzeroInitializer = Var.hasNonzeroInitializer(); |
bool IsConstant = Var.getIsConstant(); |
uint32_t Align = Var.getAlignment(); |
@@ -4714,4 +4708,10 @@ void TargetGlobalInitX8632::lower(const VariableDeclaration &Var) { |
Str << "\t.size\t" << MangledName << ", " << Size << "\n"; |
} |
+void TargetGlobalInitX8632::lowerGlobalsELF( |
+ const VariableDeclarationList &Vars) { |
+ ELFObjectWriter *Writer = Ctx->getObjectWriter(); |
+ Writer->writeDataSection(Vars, llvm::ELF::R_386_32); |
+} |
+ |
} // end of namespace Ice |