Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: src/IceELFObjectWriter.h

Issue 1179313004: Fix a bug that would cause subzero to fail when --threads=0. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses codereview comments. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceCompiler.cpp ('k') | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceELFObjectWriter.h
diff --git a/src/IceELFObjectWriter.h b/src/IceELFObjectWriter.h
index 11038455616eab6a33b44ea83a8c67c58fd53bd1..a9127ac91d7a98856857d0ee95d67820c1e0b851 100644
--- a/src/IceELFObjectWriter.h
+++ b/src/IceELFObjectWriter.h
@@ -30,11 +30,12 @@ namespace Ice {
// sections and write them out. Expected usage:
//
// (1) writeInitialELFHeader (invoke once)
-// (2) writeDataSection (invoke once)
-// (3) writeFunctionCode (must invoke once per function)
-// (4) writeConstantPool (must invoke once per pooled primitive type)
-// (5) setUndefinedSyms (invoke once)
-// (6) writeNonUserSections (invoke once)
+// (2) writeDataSection (may be invoked multiple times, as long as
+// SectionSuffix is unique)
+// (3) writeFunctionCode (must invoke once per function)
+// (4) writeConstantPool (must invoke once per pooled primitive type)
+// (5) setUndefinedSyms (invoke once)
+// (6) writeNonUserSections (invoke once)
//
// The requirement for writeDataSection to be invoked only once can
// be relaxed if using -fdata-sections. The requirement to invoke only once
@@ -42,11 +43,6 @@ namespace Ice {
// SectionType are contiguous in the file. With -fdata-sections, each global
// variable is in a separate section and therefore the sections will be
// trivially contiguous.
-//
-// The motivation for requiring that writeFunctionCode happen after
-// writeDataSection: to keep the .text and .data sections contiguous in the
-// file. Having both -fdata-sections and -ffunction-sections does allow
-// relaxing this requirement.
class ELFObjectWriter {
ELFObjectWriter() = delete;
ELFObjectWriter(const ELFObjectWriter &) = delete;
@@ -64,7 +60,8 @@ public:
// of each global's definition in the symbol table.
// Use the given target's RelocationKind for any relocations.
void writeDataSection(const VariableDeclarationList &Vars,
- FixupKind RelocationKind);
+ FixupKind RelocationKind,
+ const IceString &SectionSuffix);
// Copy data of a function's text section to file and note the offset of the
// symbol's definition in the symbol table.
@@ -151,7 +148,8 @@ private:
// SectionType, given the global variables Vars belonging to that SectionType.
void writeDataOfType(SectionType SectionType,
const VariableDeclarationList &Vars,
- FixupKind RelocationKind);
+ FixupKind RelocationKind,
+ const IceString &SectionSuffix);
// Write the final relocation sections given the final symbol table.
// May also be able to seek around the file and resolve function calls
« no previous file with comments | « src/IceCompiler.cpp ('k') | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698