OLD | NEW |
1 //===- subzero/src/IceELFObjectWriter.cpp - ELF object file writer --------===// | 1 //===- subzero/src/IceELFObjectWriter.cpp - ELF object file writer --------===// |
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 /// \file | 10 /// \file |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 // object writer's memory, for writing later. | 260 // object writer's memory, for writing later. |
261 const auto &Fixups = Asm->fixups(); | 261 const auto &Fixups = Asm->fixups(); |
262 if (!Fixups.empty()) { | 262 if (!Fixups.empty()) { |
263 if (!RelSection->isRela()) { | 263 if (!RelSection->isRela()) { |
264 // This is a non-rela section, so we need to update the instruction stream | 264 // This is a non-rela section, so we need to update the instruction stream |
265 // with the relocation addends. | 265 // with the relocation addends. |
266 for (const auto *Fixup : Fixups) { | 266 for (const auto *Fixup : Fixups) { |
267 Fixup->emitOffset(Asm); | 267 Fixup->emitOffset(Asm); |
268 } | 268 } |
269 } | 269 } |
270 RelSection->addRelocations(OffsetInSection, Asm->fixups()); | 270 RelSection->addRelocations(OffsetInSection, Asm->fixups(), SymTab); |
271 } | 271 } |
272 Section->appendData(Str, Asm->getBufferView()); | 272 Section->appendData(Str, Asm->getBufferView()); |
273 } | 273 } |
274 | 274 |
275 namespace { | 275 namespace { |
276 | 276 |
277 ELFObjectWriter::SectionType | 277 ELFObjectWriter::SectionType |
278 classifyGlobalSection(const VariableDeclaration *Var) { | 278 classifyGlobalSection(const VariableDeclaration *Var) { |
279 if (Var->getIsConstant()) | 279 if (Var->getIsConstant()) |
280 return ELFObjectWriter::ROData; | 280 return ELFObjectWriter::ROData; |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 if (ELF64) { | 684 if (ELF64) { |
685 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), | 685 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), |
686 AllSections.size()); | 686 AllSections.size()); |
687 } else { | 687 } else { |
688 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), | 688 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), |
689 AllSections.size()); | 689 AllSections.size()); |
690 } | 690 } |
691 } | 691 } |
692 | 692 |
693 } // end of namespace Ice | 693 } // end of namespace Ice |
OLD | NEW |