| OLD | NEW |
| 1 //===- subzero/src/IceELFSection.h - Model of ELF sections ------*- C++ -*-===// | 1 //===- subzero/src/IceELFSection.h - Model of ELF sections ------*- 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 // Representation of ELF sections. | 10 // Representation of ELF sections. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Sentinel value for a section number/index for before the final | 38 // Sentinel value for a section number/index for before the final |
| 39 // section index is actually known. The dummy NULL section will be assigned | 39 // section index is actually known. The dummy NULL section will be assigned |
| 40 // number 0, and it is referenced by the dummy 0-th symbol in the symbol | 40 // number 0, and it is referenced by the dummy 0-th symbol in the symbol |
| 41 // table, so use max() instead of 0. | 41 // table, so use max() instead of 0. |
| 42 enum { NoSectionNumber = std::numeric_limits<SizeT>::max() }; | 42 enum { NoSectionNumber = std::numeric_limits<SizeT>::max() }; |
| 43 | 43 |
| 44 // Constructs an ELF section, filling in fields that will be known | 44 // Constructs an ELF section, filling in fields that will be known |
| 45 // once the *type* of section is decided. Other fields may be updated | 45 // once the *type* of section is decided. Other fields may be updated |
| 46 // incrementally or only after the program is completely defined. | 46 // incrementally or only after the program is completely defined. |
| 47 ELFSection(const IceString &Name, Elf64_Word ShType, Elf64_Xword ShFlags, | 47 ELFSection(const IceString &MyName, Elf64_Word ShType, Elf64_Xword ShFlags, |
| 48 Elf64_Xword ShAddralign, Elf64_Xword ShEntsize) | 48 Elf64_Xword ShAddralign, Elf64_Xword ShEntsize) |
| 49 : Name(Name), Header() { | 49 : Name(MyName), Header() { |
| 50 Header.sh_type = ShType; | 50 Header.sh_type = ShType; |
| 51 Header.sh_flags = ShFlags; | 51 Header.sh_flags = ShFlags; |
| 52 Header.sh_addralign = ShAddralign; | 52 Header.sh_addralign = ShAddralign; |
| 53 Header.sh_entsize = ShEntsize; | 53 Header.sh_entsize = ShEntsize; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // Set the section number/index after it is finally known. | 56 // Set the section number/index after it is finally known. |
| 57 void setNumber(SizeT N) { | 57 void setNumber(SizeT N) { |
| 58 // Should only set the number once: from NoSectionNumber -> N. | 58 // Should only set the number once: from NoSectionNumber -> N. |
| 59 assert(Number == NoSectionNumber); | 59 assert(Number == NoSectionNumber); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 Rel.setSymbolAndType(Symbol->getNumber(), Fixup.kind()); | 374 Rel.setSymbolAndType(Symbol->getNumber(), Fixup.kind()); |
| 375 Str.writeAddrOrOffset<IsELF64>(Rel.r_offset); | 375 Str.writeAddrOrOffset<IsELF64>(Rel.r_offset); |
| 376 Str.writeELFWord<IsELF64>(Rel.r_info); | 376 Str.writeELFWord<IsELF64>(Rel.r_info); |
| 377 } | 377 } |
| 378 } | 378 } |
| 379 } | 379 } |
| 380 | 380 |
| 381 } // end of namespace Ice | 381 } // end of namespace Ice |
| 382 | 382 |
| 383 #endif // SUBZERO_SRC_ICEELFSECTION_H | 383 #endif // SUBZERO_SRC_ICEELFSECTION_H |
| OLD | NEW |