| OLD | NEW |
| 1 //===- subzero/src/IceELFObjectWriter.h - ELF object writer -----*- C++ -*-===// | 1 //===- subzero/src/IceELFObjectWriter.h - ELF object writer -----*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // Abstraction for a writer that is responsible for writing an ELF file. | 10 // Abstraction for a writer that is responsible for writing an ELF file. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // without -fdata-sections is so that variables that belong to each possible | 41 // without -fdata-sections is so that variables that belong to each possible |
| 42 // SectionType are contiguous in the file. With -fdata-sections, each global | 42 // SectionType are contiguous in the file. With -fdata-sections, each global |
| 43 // variable is in a separate section and therefore the sections will be | 43 // variable is in a separate section and therefore the sections will be |
| 44 // trivially contiguous. | 44 // trivially contiguous. |
| 45 // | 45 // |
| 46 // The motivation for requiring that writeFunctionCode happen after | 46 // The motivation for requiring that writeFunctionCode happen after |
| 47 // writeDataSection: to keep the .text and .data sections contiguous in the | 47 // writeDataSection: to keep the .text and .data sections contiguous in the |
| 48 // file. Having both -fdata-sections and -ffunction-sections does allow | 48 // file. Having both -fdata-sections and -ffunction-sections does allow |
| 49 // relaxing this requirement. | 49 // relaxing this requirement. |
| 50 class ELFObjectWriter { | 50 class ELFObjectWriter { |
| 51 ELFObjectWriter() = delete; |
| 51 ELFObjectWriter(const ELFObjectWriter &) = delete; | 52 ELFObjectWriter(const ELFObjectWriter &) = delete; |
| 52 ELFObjectWriter &operator=(const ELFObjectWriter &) = delete; | 53 ELFObjectWriter &operator=(const ELFObjectWriter &) = delete; |
| 53 | 54 |
| 54 public: | 55 public: |
| 55 ELFObjectWriter(GlobalContext &Ctx, ELFStreamer &Out); | 56 ELFObjectWriter(GlobalContext &Ctx, ELFStreamer &Out); |
| 56 | 57 |
| 57 // Write the initial ELF header. This is just to reserve space in the ELF | 58 // Write the initial ELF header. This is just to reserve space in the ELF |
| 58 // file. Reserving space allows the other functions to write text | 59 // file. Reserving space allows the other functions to write text |
| 59 // and data directly to the file and get the right file offsets. | 60 // and data directly to the file and get the right file offsets. |
| 60 void writeInitialELFHeader(); | 61 void writeInitialELFHeader(); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 160 |
| 160 // Write the ELF file header with the given information about sections. | 161 // Write the ELF file header with the given information about sections. |
| 161 template <bool IsELF64> | 162 template <bool IsELF64> |
| 162 void writeELFHeaderInternal(Elf64_Off SectionHeaderOffset, | 163 void writeELFHeaderInternal(Elf64_Off SectionHeaderOffset, |
| 163 SizeT SectHeaderStrIndex, SizeT NumSections); | 164 SizeT SectHeaderStrIndex, SizeT NumSections); |
| 164 }; | 165 }; |
| 165 | 166 |
| 166 } // end of namespace Ice | 167 } // end of namespace Ice |
| 167 | 168 |
| 168 #endif // SUBZERO_SRC_ICEELFOBJECTWRITER_H | 169 #endif // SUBZERO_SRC_ICEELFOBJECTWRITER_H |
| OLD | NEW |