#
51ff5595 |
| 06-Nov-2014 |
David Majnemer <david.majnemer@gmail.com> |
Object, COFF: Infer symbol sizes from adjacent symbols
Use the position of the subsequent symbol in the object file to infer the size of it's predecessor. I hope to eventually remove whatever COFF
Object, COFF: Infer symbol sizes from adjacent symbols
Use the position of the subsequent symbol in the object file to infer the size of it's predecessor. I hope to eventually remove whatever COFF specific details from this little algorithm so that we can unify this logic with what Mach-O does.
llvm-svn: 221444
show more ...
|
#
50267222 |
| 05-Nov-2014 |
David Majnemer <david.majnemer@gmail.com> |
llvm-readobj: Add support for dumping the DOS header in PE files
llvm-svn: 221333
|
#
c7d7c6fb |
| 31-Oct-2014 |
David Majnemer <david.majnemer@gmail.com> |
Object, COFF: Cleanup symbol type code, improve binutils compatibility
Do a better job classifying symbols. This increases the consistency between the COFF handling code and the ELF side of things.
Object, COFF: Cleanup symbol type code, improve binutils compatibility
Do a better job classifying symbols. This increases the consistency between the COFF handling code and the ELF side of things.
llvm-svn: 220952
show more ...
|
#
a9ee5c06 |
| 09-Oct-2014 |
David Majnemer <david.majnemer@gmail.com> |
Object, COFF: Move the VirtualSize/SizeOfRawData logic to getSectionSize
While getSectionContents was updated to do the right thing, getSectionSize wasn't. Move the logic to getSectionSize and leve
Object, COFF: Move the VirtualSize/SizeOfRawData logic to getSectionSize
While getSectionContents was updated to do the right thing, getSectionSize wasn't. Move the logic to getSectionSize and leverage it from getSectionContents.
llvm-svn: 219391
show more ...
|
#
dd9cff2e |
| 09-Oct-2014 |
David Majnemer <david.majnemer@gmail.com> |
Object, COFF: Cap the section contents to min(VirtualSize, SizeOfRawData)
It is not useful to return the data beyond VirtualSize it's less than SizeOfRawData.
An implementation detail of COFF requi
Object, COFF: Cap the section contents to min(VirtualSize, SizeOfRawData)
It is not useful to return the data beyond VirtualSize it's less than SizeOfRawData.
An implementation detail of COFF requires the section size to be rounded up to a multiple of FileAlignment; this means that SizeOfRawData is not representative of how large the section is. Instead, we should cap it to VirtualSize when this occurs as it represents the true size of the section.
Note that this is only relevant in executable files because this rounding doesn't occur in object files (and VirtualSize is always zero).
llvm-svn: 219388
show more ...
|
#
979fb40b |
| 09-Oct-2014 |
Rui Ueyama <ruiu@google.com> |
Object: Add range iterators for COFF import/export table
llvm-svn: 219383
|
#
8280fbbf |
| 08-Oct-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Correctly compute the size of common symbols in COFF.
llvm-svn: 219324
|
#
80291274 |
| 08-Oct-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Remove bogus std::error_code returns form SectionRef.
There are two methods in SectionRef that can fail:
* getName: The index into the string table can be invalid. * getContents: The section might
Remove bogus std::error_code returns form SectionRef.
There are two methods in SectionRef that can fail:
* getName: The index into the string table can be invalid. * getContents: The section might point to invalid contents.
Every other method will always succeed and returning and std::error_code just complicates the code. For example, a section can have an invalid alignment, but if we are able to get to the section structure at all and create a SectionRef, we will always be able to read that invalid alignment.
llvm-svn: 219314
show more ...
|
#
506c684d |
| 07-Oct-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Don't check for null after calling COFFObjectFile::toSec.
It can only return null if passed a corrupted reference with a null Ref.p. Checking for null is then an issue for asserts to check for inter
Don't check for null after calling COFFObjectFile::toSec.
It can only return null if passed a corrupted reference with a null Ref.p. Checking for null is then an issue for asserts to check for internal consistency, not control flow to check for invalid input.
I didn't add an assert(sec != nullptr) because toSec itself has a far more complete assert.
llvm-svn: 219235
show more ...
|
#
a9260865 |
| 07-Oct-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Optimize COFFObjectFile::sectionContainsSymbol a bit.
There is no need to compute the coff_section of the symbol just to compare the pointer.
Inspired by the ELF implementation.
llvm-svn: 219233
|
#
1af08658 |
| 03-Oct-2014 |
Rui Ueyama <ruiu@google.com> |
llvm-readobj: print out the fields of the COFF delay-import table
llvm-svn: 218996
|
#
15d99359 |
| 03-Oct-2014 |
Rui Ueyama <ruiu@google.com> |
llvm-readobj: print COFF delay-load import table
This patch adds another iterator to access the delay-load import table and use it from llvm-readobj.
http://reviews.llvm.org/D5594
llvm-svn: 218933
|
#
861021f9 |
| 02-Oct-2014 |
Rui Ueyama <ruiu@google.com> |
llvm-readobj: print COFF imported symbols
This patch defines a new iterator for the imported symbols. Make a change to COFFDumper to use that iterator to print out imported symbols and its ordinals.
llvm-readobj: print COFF imported symbols
This patch defines a new iterator for the imported symbols. Make a change to COFFDumper to use that iterator to print out imported symbols and its ordinals.
llvm-svn: 218915
show more ...
|
#
1e152d5e |
| 02-Oct-2014 |
Rui Ueyama <ruiu@google.com> |
This patch adds a new flag "-coff-imports" to llvm-readobj. When the flag is given, the command prints out the COFF import table.
Currently only the import table directory will be printed. I'm going
This patch adds a new flag "-coff-imports" to llvm-readobj. When the flag is given, the command prints out the COFF import table.
Currently only the import table directory will be printed. I'm going to make another patch to print out the imported symbols.
The implementation of import directory entry iterator in COFFObjectFile.cpp was buggy. This patch fixes that too.
http://reviews.llvm.org/D5569
llvm-svn: 218891
show more ...
|
#
dac39857 |
| 26-Sep-2014 |
David Majnemer <david.majnemer@gmail.com> |
Object: BSS/virtual sections don't have contents
Users of getSectionContents shouldn't try to pass in BSS or virtual sections. In all instances, this is a bug in the code calling this routine.
N.B
Object: BSS/virtual sections don't have contents
Users of getSectionContents shouldn't try to pass in BSS or virtual sections. In all instances, this is a bug in the code calling this routine.
N.B. Some COFF implementations (like CL) will mark their BSS sections as taking space on disk. This would confuse COFFObjectFile into thinking the section is larger than the file.
llvm-svn: 218549
show more ...
|
#
062c406a |
| 11-Sep-2014 |
Rui Ueyama <ruiu@google.com> |
Support: Delete {aligned_,}{u,}{little,big}8_t
The byte has no endianness, so these types don't make sense. uint8_t should be used instead.
llvm-svn: 217631
|
#
4015ea6b |
| 10-Sep-2014 |
David Majnemer <david.majnemer@gmail.com> |
Attempt to pacify buildbots.
llvm-svn: 217499
|
#
44f51e51 |
| 10-Sep-2014 |
David Majnemer <david.majnemer@gmail.com> |
Object: Add support for bigobj
This adds support for reading the "bigobj" variant of COFF produced by cl's /bigobj and mingw's -mbig-obj.
The most significant difference that bigobj brings is more
Object: Add support for bigobj
This adds support for reading the "bigobj" variant of COFF produced by cl's /bigobj and mingw's -mbig-obj.
The most significant difference that bigobj brings is more than 2**16 sections to COFF.
bigobj brings a few interesting differences with it: - It doesn't have a Characteristics field in the file header. - It doesn't have a SizeOfOptionalHeader field in the file header (it's only used in executable files). - Auxiliary symbol records have the same width as a symbol table entry. Since symbol table entries are bigger, so are auxiliary symbol records.
Write support will come soon.
Differential Revision: http://reviews.llvm.org/D5259
llvm-svn: 217496
show more ...
|
Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4 |
|
#
e1d12948 |
| 27-Aug-2014 |
Craig Topper <craig.topper@gmail.com> |
Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created.
llvm-svn: 216525
|
Revision tags: llvmorg-3.5.0-rc3 |
|
#
48af1c2a |
| 19-Aug-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Don't own the buffer in object::Binary.
Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a
Don't own the buffer in object::Binary.
Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too.
Keeping this ownership would make supporting IR inside native objects particularly painful.
This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer.
This patch introduces a few new types.
* MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer.
The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how.
llvm-svn: 216002
show more ...
|
#
c66d761b |
| 17-Aug-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
llvm-objdump: don't print relocations in non-relocatable files.
This matches the behavior of GNU objdump.
llvm-svn: 215844
|
#
8f7d5f29 |
| 08-Aug-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Delete dead code. NFC.
llvm-svn: 215224
|
#
67622317 |
| 08-Aug-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
getLoadName is only implemented for ELF, make it ELF only.
llvm-svn: 215219
|
Revision tags: llvmorg-3.5.0-rc2 |
|
#
437b0d58 |
| 31-Jul-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Use std::unique_ptr to make the ownership explicit.
llvm-svn: 214377
|
Revision tags: llvmorg-3.5.0-rc1 |
|
#
2e60ca96 |
| 24-Jun-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Pass a unique_ptr<MemoryBuffer> to the constructors in the Binary hierarchy.
Once the objects are constructed, they own the buffer. Passing a unique_ptr makes that clear.
llvm-svn: 211595
|