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

Side by Side Diff: lib/Object/COFFObjectFile.cpp

Issue 9617030: Distinguish between ELF 32/64, little/big endian, in the type system of Binary.h (Closed) Base URL: https://llvm.org/svn/llvm-project/llvm/trunk/
Patch Set: x Created 8 years, 9 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 | « lib/Object/Archive.cpp ('k') | lib/Object/MachOObjectFile.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 //===- COFFObjectFile.cpp - COFF object file implementation -----*- C++ -*-===// 1 //===- COFFObjectFile.cpp - COFF object file implementation -----*- C++ -*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
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 declares the COFFObjectFile class. 10 // This file declares the COFFObjectFile class.
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 else 414 else
415 ret.p = reinterpret_cast<uintptr_t>( 415 ret.p = reinterpret_cast<uintptr_t>(
416 reinterpret_cast<const coff_relocation*>( 416 reinterpret_cast<const coff_relocation*>(
417 base() + sec->PointerToRelocations) 417 base() + sec->PointerToRelocations)
418 + sec->NumberOfRelocations); 418 + sec->NumberOfRelocations);
419 419
420 return relocation_iterator(RelocationRef(ret, this)); 420 return relocation_iterator(RelocationRef(ret, this));
421 } 421 }
422 422
423 COFFObjectFile::COFFObjectFile(MemoryBuffer *Object, error_code &ec) 423 COFFObjectFile::COFFObjectFile(MemoryBuffer *Object, error_code &ec)
424 : ObjectFile(Binary::isCOFF, Object, ec) 424 : ObjectFile(Binary::ID_COFF, Object, ec)
425 , Header(0) 425 , Header(0)
426 , SectionTable(0) 426 , SectionTable(0)
427 , SymbolTable(0) 427 , SymbolTable(0)
428 , StringTable(0) 428 , StringTable(0)
429 , StringTableSize(0) { 429 , StringTableSize(0) {
430 // Check that we at least have enough room for a header. 430 // Check that we at least have enough room for a header.
431 if (!checkSize(Data, ec, sizeof(coff_file_header))) return; 431 if (!checkSize(Data, ec, sizeof(coff_file_header))) return;
432 432
433 // The actual starting location of the COFF header in the file. This can be 433 // The actual starting location of the COFF header in the file. This can be
434 // non-zero in PE/COFF files. 434 // non-zero in PE/COFF files.
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 } 753 }
754 754
755 namespace llvm { 755 namespace llvm {
756 756
757 ObjectFile *ObjectFile::createCOFFObjectFile(MemoryBuffer *Object) { 757 ObjectFile *ObjectFile::createCOFFObjectFile(MemoryBuffer *Object) {
758 error_code ec; 758 error_code ec;
759 return new COFFObjectFile(Object, ec); 759 return new COFFObjectFile(Object, ec);
760 } 760 }
761 761
762 } // end namespace llvm 762 } // end namespace llvm
OLDNEW
« no previous file with comments | « lib/Object/Archive.cpp ('k') | lib/Object/MachOObjectFile.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698