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

Side by Side Diff: src/IceELFSection.h

Issue 1273153002: Subzero. Native 64-bit int arithmetic on x86-64. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixes tests & make format Created 5 years, 4 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/IceAssemblerX86BaseImpl.h ('k') | src/IceInstX8632.cpp » ('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/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 /// \file 10 /// \file
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 for (const AssemblerFixup &Fixup : Fixups) { 355 for (const AssemblerFixup &Fixup : Fixups) {
356 const ELFSym *Symbol; 356 const ELFSym *Symbol;
357 if (Fixup.isNullSymbol()) 357 if (Fixup.isNullSymbol())
358 Symbol = SymTab->getNullSymbol(); 358 Symbol = SymTab->getNullSymbol();
359 else 359 else
360 Symbol = SymTab->findSymbol(Fixup.symbol(&Ctx)); 360 Symbol = SymTab->findSymbol(Fixup.symbol(&Ctx));
361 if (!Symbol) 361 if (!Symbol)
362 llvm::report_fatal_error("Missing symbol mentioned in reloc"); 362 llvm::report_fatal_error("Missing symbol mentioned in reloc");
363 363
364 if (IsELF64) { 364 if (IsELF64) {
365 llvm_unreachable( 365 // TODO(jpp): check that Fixup.offset() is correct even for pc-rel.
366 "Not tested -- check that Fixup.offset() is correct even for pc-rel");
367 Elf64_Rela Rela; 366 Elf64_Rela Rela;
368 Rela.r_offset = Fixup.position(); 367 Rela.r_offset = Fixup.position();
369 Rela.setSymbolAndType(Symbol->getNumber(), Fixup.kind()); 368 Rela.setSymbolAndType(Symbol->getNumber(), Fixup.kind());
370 Rela.r_addend = Fixup.offset(); 369 Rela.r_addend = Fixup.offset();
371 Str.writeAddrOrOffset<IsELF64>(Rela.r_offset); 370 Str.writeAddrOrOffset<IsELF64>(Rela.r_offset);
372 Str.writeELFXword<IsELF64>(Rela.r_info); 371 Str.writeELFXword<IsELF64>(Rela.r_info);
373 Str.writeELFXword<IsELF64>(Rela.r_addend); 372 Str.writeELFXword<IsELF64>(Rela.r_addend);
374 } else { 373 } else {
375 Elf32_Rel Rel; 374 Elf32_Rel Rel;
376 Rel.r_offset = Fixup.position(); 375 Rel.r_offset = Fixup.position();
377 Rel.setSymbolAndType(Symbol->getNumber(), Fixup.kind()); 376 Rel.setSymbolAndType(Symbol->getNumber(), Fixup.kind());
378 Str.writeAddrOrOffset<IsELF64>(Rel.r_offset); 377 Str.writeAddrOrOffset<IsELF64>(Rel.r_offset);
379 Str.writeELFWord<IsELF64>(Rel.r_info); 378 Str.writeELFWord<IsELF64>(Rel.r_info);
380 } 379 }
381 } 380 }
382 } 381 }
383 382
384 } // end of namespace Ice 383 } // end of namespace Ice
385 384
386 #endif // SUBZERO_SRC_ICEELFSECTION_H 385 #endif // SUBZERO_SRC_ICEELFSECTION_H
OLDNEW
« no previous file with comments | « src/IceAssemblerX86BaseImpl.h ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698