aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object
AgeCommit message (Collapse)AuthorFilesLines
2015-01-06Don't loop endlessly for MachO files with 0 ncmdsFilipe Cabecinhas1-0/+3
llvm-svn: 225271
2014-12-23Add printing the LC_THREAD load commands with llvm-objdump’s -private-headers.Kevin Enderby1-0/+5
llvm-svn: 224792
2014-12-19Add printing the LC_ROUTINES load commands with llvm-objdump’s ↵Kevin Enderby1-0/+10
-private-headers. llvm-svn: 224627
2014-12-19Add printing the LC_SUB_CLIENT load command with llvm-objdump’s ↵Kevin Enderby1-0/+5
-private-headers. llvm-svn: 224616
2014-12-19Add printing the LC_SUB_LIBRARY load command with llvm-objdump’s ↵Kevin Enderby1-0/+5
-private-headers. llvm-svn: 224607
2014-12-19[Object] Don't crash on empty export lists.Juergen Ributzka1-1/+4
Summary: This fixes the exports iterator if the export list is empty. Reviewers: Bigcheese, kledzik Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6732 llvm-svn: 224563
2014-12-18Add printing the LC_SUB_UMBRELLA load command with llvm-objdump’s ↵Kevin Enderby1-0/+5
-private-headers. llvm-svn: 224548
2014-12-18Add printing the LC_SUB_FRAMEWORK load command with llvm-objdump’s ↵Kevin Enderby1-0/+4
-private-headers. llvm-svn: 224534
2014-12-18Add printing the LC_LINKER_OPTION load command with llvm-objdump’s ↵Kevin Enderby1-3/+3
-private-headers. Also corrected the name of the load command to not end in an ’S’ as well as corrected the name of the MachO::linker_option_command struct and other places that had the word option as plural which did not match the Mac OS X headers. llvm-svn: 224485
2014-12-17Add printing the LC_ENCRYPTION_INFO_64 load command with llvm-objdump’s ↵Kevin Enderby1-0/+5
-private-headers and add tests for the two AArch64 binaries. llvm-svn: 224400
2014-12-16Add printing the LC_ENCRYPTION_INFO load command with llvm-objdump’s ↵Kevin Enderby1-0/+5
-private-headers. llvm-svn: 224390
2014-12-16Start adding thin archive support.Rafael Espindola1-3/+17
This is just sufficient for 'ar t' to work. llvm-svn: 224307
2014-12-15Silence more static analyzer warnings.Michael Ilseman1-0/+2
Add in definedness checks for shift operators, null checks when pointers are assumed by the code to be non-null, and explicit unreachables. llvm-svn: 224255
2014-12-10Move three methods only used by MCJIT to MCJIT.Rafael Espindola2-49/+6
These methods are only used by MCJIT and are very specific to it. In fact, they are also fairly specific to the fact that we have a dynamic linker of relocatable objects. llvm-svn: 223964
2014-12-09Return ErrorOr<std::unique_ptr<Archive>> form getAsArchive.Rafael Espindola1-14/+10
This is the same return type of Archive::create. llvm-svn: 223827
2014-12-09Rename createIRObjectFile to just create.Rafael Espindola2-4/+4
It is a static method of IRObjectFile, so having to use IRObjectFile::createIRObjectFile was redundant. llvm-svn: 223822
2014-12-09Move method out of line to make buildbot happy.Rafael Espindola1-0/+2
llvm-svn: 223781
2014-12-09Don't lookup an object symbol name in the module.Rafael Espindola1-5/+2
Instead, walk the obj symbol list in parallel to find the GV. This shouldn't change anything on ELF where global symbols are not mangled, but it is a step toward supporting other object formats. Gold itself is ELF only, but bfd ld supports COFF and the logic in the gold plugin could be reused on lld. llvm-svn: 223780
2014-12-04Add mach-o LC_RPATH support to llvm-objdumpJean-Daniel Dupas1-0/+5
Summary: Add rpath load command support in Mach-O object and update llvm-objdump to use it. Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6512 llvm-svn: 223343
2014-12-02Add ARM relocations to ELFYAMLWill Newton1-0/+3
Tested with check-all with no regressions. llvm-svn: 223112
2014-11-26Object/COFF: Fix off-by-one error for object having lots of relocationsRui Ueyama1-1/+2
llvm-objdump printed out an error message for this off-by-one error, but because it always exits with 0 whether or not it found an error, the test (llvm-objdump/coff-many-relocs.test) succeeded. I made llvm-objdump exit with EXIT_FAILURE when an error is found. llvm-svn: 222852
2014-11-25COFF: Add back an assertion that is superseded by r222124David Majnemer1-1/+1
llvm-svn: 222735
2014-11-21Remove duplication of relocation names in lib/Object/ELFYAML.cppTim Northover1-330/+7
We can now use the ELF relocation .def files to create the mapping of relocation numbers to names and avoid having to duplicate the list of relocations. Patch by Will Newton. llvm-svn: 222567
2014-11-21Remove duplication of relocation names in lib/Object/ELF.cppTim Northover1-742/+14
We can now use the ELF relocation .def files to create the mapping of relocation numbers to names and avoid having to duplicate the list of relocations. Patch by Will Newton. llvm-svn: 222566
2014-11-19llvm-readobj: fix off-by-one error in COFFDumperRui Ueyama1-1/+1
It printed out base relocation table header as table entry. This patch also makes llvm-readobj to not skip ABSOLUTE entries becuase it was confusing. llvm-svn: 222299
2014-11-19llvm-readobj: teach it how to dump COFF base relocation tableRui Ueyama1-1/+69
llvm-svn: 222289
2014-11-18Support ELF files of unknown type.Michael J. Spencer3-0/+3
llvm-svn: 222208
2014-11-17Object, COFF: Tighten the object file parserDavid Majnemer1-27/+47
We were a little lax in a few areas: - We pretended that import libraries were like any old COFF file, they are not. In fact, they aren't really COFF files at all, we should probably grow some specialized functionality to handle them smarter. - Our symbol iterators were more than happy to attempt to go past the end of the symbol table if you had a symbol with a bad list of auxiliary symbols. llvm-svn: 222124
2014-11-14obj2yaml, yaml2obj: Add support for COFF executablesDavid Majnemer2-5/+115
In support of serializing executables, obj2yaml now records the virtual address and size of sections. It also serializes whatever we strictly need from the PE header, it expects that it can reconstitute everything else via inference. yaml2obj can reconstitute a fully linked executable. In order to get executables correctly serialized/deserialized, other bugs were fixed as a circumstance. We now properly respect file and section alignments. We also avoid writing out string tables unless they are strictly necessary. llvm-svn: 221975
2014-11-13Un-break the big-endian buildbotsRui Ueyama1-2/+2
llvm-svn: 221919
2014-11-13Object, Mach-O: Refactor and clean code upDavid Majnemer1-12/+25
Don't assert if we can return an error code, reuse existing functionality like is64Bit(). llvm-svn: 221915
2014-11-13Object, COFF: Refactor code to get relocation iteratorsDavid Majnemer1-26/+24
No functional change intended. llvm-svn: 221880
2014-11-13Object, COFF: Increase code reuseDavid Majnemer1-24/+32
Split getObject's smarts into checkOffset, use this to replace the handwritten check in getSectionContents. Similarly, replace checks in section_rel_begin/section_rel_end with getNumberOfRelocations. No functionality change intended. llvm-svn: 221873
2014-11-13Object, COFF: getRelocationSymbol shouldn't assertDavid Majnemer1-1/+1
lib/Object is supposed to be robust to malformed object files. Don't assert if we don't have a symbol table. I'll try to come up with a test case later. llvm-svn: 221870
2014-11-13Object, COFF: Cleanup some code in getSectionNameDavid Majnemer1-2/+2
Use StringRef::startswith to tidy up some code, no functionality change intended. llvm-svn: 221869
2014-11-13Object, COFF: Fix some theoretical bugsDavid Majnemer1-3/+14
getObject didn't consider the case where a pointer came before the start of the object file. No test is included, trying to come up with something reasonable. llvm-svn: 221868
2014-11-13llvm-readobj: Print out address table when dumping COFF delay-import tableRui Ueyama1-0/+14
llvm-svn: 221855
2014-11-12Object, support both mach-o archive t.o.c file namesNick Kledzik1-1/+1
For historical reasons archives on mach-o have two possible names for the file containing the table of contents for the archive: "__.SYMDEF SORTED" and "__.SYMDEF". But the libObject archive reader only supported the former. This patch fixes llvm::object::Archive to support both names. llvm-svn: 221747
2014-11-10[yaml2obj] Support AArch64 relocations.Chad Rosier1-0/+86
Patch by Daniel Stewart <stewartd@codeaurora.org>! Phabricator Revision: http://reviews.llvm.org/D6192 llvm-svn: 221639
2014-11-06[ELF][yaml2obj] Handle additional MIPS specific st_other field flagsSimon Atanasyan1-1/+37
The ELF symbol `st_other` field might contain additional flags besides visibility ones. This patch implements support for some MIPS specific flags. llvm-svn: 221491
2014-11-06Object, COFF: Don't consider AuxFunctionDefinition for getSymbolSizeDavid Majnemer1-10/+0
mingw lies about the size of a function's AuxFunctionDefinition. Ignore the field and rely on our heuristic to determine the symbol's size. llvm-svn: 221485
2014-11-06Object, COFF: Infer symbol sizes from adjacent symbolsDavid Majnemer1-7/+39
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
2014-11-05llvm-readobj: Add support for dumping the DOS header in PE filesDavid Majnemer1-13/+13
llvm-svn: 221333
2014-11-04[yaml2obj] Allow yaml2obj tool to recognize EF_MIPS_NAN2008 flagSimon Atanasyan1-0/+1
llvm-svn: 221268
2014-11-04Remove the static version of getScatteredRelocationType() now that r221211 addedKevin Enderby1-5/+0
a public version MachOObjectFile::getScatteredRelocationType(). This should fix the build bot for the unused function error. llvm-svn: 221216
2014-11-04Add the code and test cases for 32-bit Intel to llvm-objdump’s Mach-O ↵Kevin Enderby1-0/+5
symbolizer. llvm-svn: 221211
2014-10-31Object, COFF: Cleanup symbol type code, improve binutils compatibilityDavid Majnemer1-44/+75
Do a better job classifying symbols. This increases the consistency between the COFF handling code and the ELF side of things. llvm-svn: 220952
2014-10-27Fix unicode chars into ascii in comment lines.NAKAMURA Takumi1-1/+1
llvm-svn: 220668
2014-10-24Don't ever call materializeAllPermanently during LTO.Rafael Espindola1-11/+1
To do this, change the representation of lazy loaded functions. The previous representation cannot differentiate between a function whose body has been removed and one whose body hasn't been read from the .bc file. That means that in order to drop a function, the entire body had to be read. llvm-svn: 220580
2014-10-24[Object] Fix MachO's getUuid to return a pointer into the object instead of ↵Benjamin Kramer1-2/+3
a dangling ArrayRef. This works because uuid's are always little endian so it's not swapped. Fixes use-after-return reported by asan. llvm-svn: 220567