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

Side by Side Diff: src/IceELFSection.h

Issue 1181013016: Subzero. Fixes memory leaks. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: clang-format: for f in $(git diff --name-only HEAD~7); do if [[ ${f} == *h || ${f} == *cpp ]]; then… 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 unified diff | Download patch
OLDNEW
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 void setInfoNum(Elf64_Word sh_info) { Header.sh_info = sh_info; } 74 void setInfoNum(Elf64_Word sh_info) { Header.sh_info = sh_info; }
75 75
76 void setFileOffset(Elf64_Off sh_offset) { Header.sh_offset = sh_offset; } 76 void setFileOffset(Elf64_Off sh_offset) { Header.sh_offset = sh_offset; }
77 77
78 Elf64_Xword getSectionAlign() const { return Header.sh_addralign; } 78 Elf64_Xword getSectionAlign() const { return Header.sh_addralign; }
79 79
80 // Write the section header out with the given streamer. 80 // Write the section header out with the given streamer.
81 template <bool IsELF64> void writeHeader(ELFStreamer &Str); 81 template <bool IsELF64> void writeHeader(ELFStreamer &Str);
82 82
83 protected: 83 protected:
84 ~ELFSection() {}
85
86 // Name of the section in convenient string form (instead of a index 84 // Name of the section in convenient string form (instead of a index
87 // into the Section Header String Table, which is not known till later). 85 // into the Section Header String Table, which is not known till later).
88 const IceString Name; 86 const IceString Name;
89 87
90 // The fields of the header. May only be partially initialized, but should 88 // The fields of the header. May only be partially initialized, but should
91 // be fully initialized before writing. 89 // be fully initialized before writing.
92 Elf64_Shdr Header; 90 Elf64_Shdr Header;
93 91
94 // The number of the section after laying out sections. 92 // The number of the section after laying out sections.
95 SizeT Number; 93 SizeT Number;
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 Rel.setSymbolAndType(Symbol->getNumber(), Fixup.kind()); 372 Rel.setSymbolAndType(Symbol->getNumber(), Fixup.kind());
375 Str.writeAddrOrOffset<IsELF64>(Rel.r_offset); 373 Str.writeAddrOrOffset<IsELF64>(Rel.r_offset);
376 Str.writeELFWord<IsELF64>(Rel.r_info); 374 Str.writeELFWord<IsELF64>(Rel.r_info);
377 } 375 }
378 } 376 }
379 } 377 }
380 378
381 } // end of namespace Ice 379 } // end of namespace Ice
382 380
383 #endif // SUBZERO_SRC_ICEELFSECTION_H 381 #endif // SUBZERO_SRC_ICEELFSECTION_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698