Subzero: Fix emission of global initializers.
Also changes the szbuild.py script to add -fdata-sections, and entirely removes the -disable-globals option.
The global initializer emission basically copies what llc does, based on 3 properties of the global: constant vs non-constant, internal vs external, and full zero-initializer vs non-trivial initializer.
BUG= none
R=jvoung@chromium.org, kschimpf@google.com
Review URL: https://codereview.chromium.org/631383003
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index 15272c1..6642ba9 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -2369,8 +2369,7 @@
}
}
Trans.nameUnnamedFunctions(Context->getModule());
- if (!getFlags().DisableGlobals)
- getTranslator().lowerGlobals(Context->getGlobalIDAddresses());
+ getTranslator().lowerGlobals(Context->getGlobalIDAddresses());
GlobalAddressNamesAndInitializersInstalled = true;
}
}