Index: src/IceTargetLoweringX8632.cpp |
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp |
index b092f7ffaa443534d69621800a6e325b5546a7a2..9bc8f8a5903813d3d5d92cef07561a913e83b13e 100644 |
--- a/src/IceTargetLoweringX8632.cpp |
+++ b/src/IceTargetLoweringX8632.cpp |
@@ -4634,20 +4634,13 @@ 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; |
+ const VariableDeclaration::InitializerListType &Initializers = |
+ Var.getInitializers(); |
bool HasNonzeroInitializer = Var.hasNonzeroInitializer(); |
bool IsConstant = Var.getIsConstant(); |
uint32_t Align = Var.getAlignment(); |
@@ -4657,6 +4650,8 @@ void TargetGlobalInitX8632::lower(const VariableDeclaration &Var) { |
if (Ctx->getFlags().DataSections) |
SectionSuffix = "." + MangledName; |
+ Ostream &Str = Ctx->getStrEmit(); |
+ |
Str << "\t.type\t" << MangledName << ",@object\n"; |
if (IsConstant) |
@@ -4714,4 +4709,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 |