Chromium Code Reviews| Index: src/IceELFObjectWriter.h |
| diff --git a/src/IceELFObjectWriter.h b/src/IceELFObjectWriter.h |
| index 11038455616eab6a33b44ea83a8c67c58fd53bd1..31a6ccbd7edef7fc6a0bfdf32e86b1d920a5dd98 100644 |
| --- a/src/IceELFObjectWriter.h |
| +++ b/src/IceELFObjectWriter.h |
| @@ -30,7 +30,8 @@ namespace Ice { |
| // sections and write them out. Expected usage: |
| // |
| // (1) writeInitialELFHeader (invoke once) |
| -// (2) writeDataSection (invoke once) |
| +// (2) writeDataSection (may be invoked multiple times, as long as |
| +// SectionSuffix is unique) |
|
Jim Stichnoth
2015/06/16 17:03:24
can you indent this by 4 characters?
John
2015/06/16 17:30:55
Done.
|
| // (3) writeFunctionCode (must invoke once per function) |
| // (4) writeConstantPool (must invoke once per pooled primitive type) |
| // (5) setUndefinedSyms (invoke once) |
| @@ -43,10 +44,7 @@ namespace Ice { |
| // 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. |
| +// TODO(jpp): explain what's going on here. |
| class ELFObjectWriter { |
| ELFObjectWriter() = delete; |
| ELFObjectWriter(const ELFObjectWriter &) = delete; |
| @@ -64,7 +62,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 +150,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 |