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

Side by Side Diff: src/IceELFObjectWriter.cpp

Issue 837553009: Make fixups reference any constant (allow const float/double pool literals). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: go back to one arenaallocator type alias Created 5 years, 11 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
« no previous file with comments | « src/IceDefs.h ('k') | src/IceGlobalContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // This file defines the writer for ELF relocatable object files. 10 // This file defines the writer for ELF relocatable object files.
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 // The symbol table entry doesn't need to know the defined symbol's 318 // The symbol table entry doesn't need to know the defined symbol's
319 // size since this is in a section with a fixed Entry Size. 319 // size since this is in a section with a fixed Entry Size.
320 const SizeT SymbolSize = 0; 320 const SizeT SymbolSize = 0;
321 Section->setFileOffset(alignFileOffset(Align)); 321 Section->setFileOffset(alignFileOffset(Align));
322 322
323 // Write the data. 323 // Write the data.
324 for (Constant *C : Pool) { 324 for (Constant *C : Pool) {
325 auto Const = llvm::cast<ConstType>(C); 325 auto Const = llvm::cast<ConstType>(C);
326 std::string SymBuffer; 326 std::string SymBuffer;
327 llvm::raw_string_ostream SymStrBuf(SymBuffer); 327 llvm::raw_string_ostream SymStrBuf(SymBuffer);
328 SymStrBuf << ".L$" << Ty << "$" << Const->getPoolEntryID(); 328 Const->emitPoolLabel(SymStrBuf);
329 std::string &SymName = SymStrBuf.str(); 329 std::string &SymName = SymStrBuf.str();
330 SymTab->createDefinedSym(SymName, STT_NOTYPE, STB_LOCAL, Section, 330 SymTab->createDefinedSym(SymName, STT_NOTYPE, STB_LOCAL, Section,
331 OffsetInSection, SymbolSize); 331 OffsetInSection, SymbolSize);
332 StrTab->add(SymName); 332 StrTab->add(SymName);
333 typename ConstType::PrimType Value = Const->getValue(); 333 typename ConstType::PrimType Value = Const->getValue();
334 memcpy(Buf, &Value, WriteAmt); 334 memcpy(Buf, &Value, WriteAmt);
335 Str.writeBytes(llvm::StringRef(Buf, WriteAmt)); 335 Str.writeBytes(llvm::StringRef(Buf, WriteAmt));
336 OffsetInSection += WriteAmt; 336 OffsetInSection += WriteAmt;
337 } 337 }
338 Section->setSize(OffsetInSection); 338 Section->setSize(OffsetInSection);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 if (IsELF64) { 394 if (IsELF64) {
395 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), 395 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(),
396 AllSections.size()); 396 AllSections.size());
397 } else { 397 } else {
398 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), 398 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(),
399 AllSections.size()); 399 AllSections.size());
400 } 400 }
401 } 401 }
402 402
403 } // end of namespace Ice 403 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceDefs.h ('k') | src/IceGlobalContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698