summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object
Commit message (Collapse)AuthorAgeFilesLines
...
* Use static instead of anonymous namespace.Rui Ueyama2014-01-161-8/+4
| | | | llvm-svn: 199419
* Reduce nesting.Rui Ueyama2014-01-161-13/+11
| | | | llvm-svn: 199418
* Use the current local variable naming style.Rui Ueyama2014-01-161-244/+242
| | | | llvm-svn: 199417
* llmv-objdump/COFF: Print export table contents.Rui Ueyama2014-01-161-3/+95
| | | | | | | | | | | | | | | | This patch adds the capability to dump export table contents. An example output is this: Export Table: Ordinal RVA Name 5 0x2008 exportfn1 6 0x2010 exportfn2 By adding this feature to llvm-objdump, we will be able to use it to check export table contents in LLD's tests. Currently we are doing binary comparison in the tests, which is fragile and not readable to humans. llvm-svn: 199358
* Don't use DataRefImpl to implement ImportDirectoryEntryRef.Rui Ueyama2014-01-161-37/+17
| | | | | | | | | DataRefImpl (a union of two integers and a pointer) is not the ideal data type to represent a reference to an import directory entity. We should just use the pointer to the import table and an offset instead to simplify. No functionality change. llvm-svn: 199349
* Return an ErrorOr<Binary *> from createBinary.Rafael Espindola2014-01-152-34/+29
| | | | | | | | I did write a version returning ErrorOr<OwningPtr<Binary> >, but it is too cumbersome to use without std::move. I will keep the patch locally and submit when we switch to c++11. llvm-svn: 199326
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-073-3/+2
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* Support for microMIPS TLS relocations.Zoran Jovanovic2013-12-191-0/+2
| | | | llvm-svn: 197685
* Fix a pair of array index checks.Eric Christopher2013-12-061-2/+5
| | | | | | Patch by Marius Wachtler. llvm-svn: 196560
* Path: Recognize COFF import library file magic.Rui Ueyama2013-11-152-0/+2
| | | | | | | | | | | | Summary: Make identify_magic to recognize COFF import file. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2165 llvm-svn: 194852
* Readobj: If NumbersOfSections is 0xffff, it's an COFF import library.Rui Ueyama2013-11-151-4/+7
| | | | | | | | 0xffff does not mean that there are 65535 sections in a COFF file but indicates that it's a COFF import library. This patch fixes SEGV error when an import library file is passed to llvm-readobj. llvm-svn: 194844
* Support for microMIPS branch instructions.Zoran Jovanovic2013-11-041-0/+1
| | | | llvm-svn: 193992
* move getSymbolNMTypeChar to the one program that needs it: nm.Rafael Espindola2013-11-022-105/+0
| | | | llvm-svn: 193933
* Convert another use of getSymbolNMTypeChar.Rafael Espindola2013-11-021-5/+9
| | | | llvm-svn: 193932
* Avoid some getSymbolNMTypeChar uses in COFFObjectFile.cpp itself.Rafael Espindola2013-11-021-12/+6
| | | | | | This is a fixed version of 193928 which keeps these uses in sync. llvm-svn: 193931
* Revert "Don't use getSymbolNMTypeChar for implementing ↵Rafael Espindola2013-11-021-2/+4
| | | | | | | | | | COFFObjectFile::getSymbolFileOffset." Investigating a bot failure. This reverts commit r193928. llvm-svn: 193929
* Don't use getSymbolNMTypeChar for implementing ↵Rafael Espindola2013-11-021-4/+2
| | | | | | COFFObjectFile::getSymbolFileOffset. llvm-svn: 193928
* Fix llvm-nm to mach OS X's nm on some tests.Rafael Espindola2013-11-021-6/+17
| | | | | | | There is still a long way to go for llvm-nm, but at least we now match nm's letter output in the cases we test for. llvm-svn: 193912
* Support for microMIPS jump instructionsZoran Jovanovic2013-10-291-0/+1
| | | | llvm-svn: 193623
* Support for microMIPS relocations 1.Zoran Jovanovic2013-10-231-0/+11
| | | | llvm-svn: 193247
* Path: Recognize Windows compiled resource file.Rui Ueyama2013-10-152-1/+3
| | | | | | | | | | | | | | Some background: One can pass compiled resource files (.res files) directly to the linker on Windows. If a resource file is given, the linker will run "cvtres" command in background to convert the resource file to a COFF file to link it. What I'm trying to do with this patch is to make the linker to recognize the resource file by file magic, so that it can run cvtres command. Differential Revision: http://llvm-reviews.chandlerc.com/D1943 llvm-svn: 192742
* Add missing #include's to cctype when using isdigit/alpha/etc.Will Dietz2013-10-122-0/+2
| | | | llvm-svn: 192519
* Object/COFF: Rename getXXX{Begin,End} -> xxx_{begin,end}.Rui Ueyama2013-09-272-10/+10
| | | | | | | It is mentioned in the LLVM coding standard that _begin() and _end() suffixes should be used. llvm-svn: 191569
* Re-submit r191472 with a fix for big endian.Rui Ueyama2013-09-271-30/+166
| | | | | llvm-objdump: Dump COFF import table if -private-headers option is given. llvm-svn: 191557
* Revert "llvm-objdump: Dump COFF import table if -private-headers option is ↵Rui Ueyama2013-09-271-166/+30
| | | | | | | | given." This reverts commit r191472 because it's failing on BE machine. llvm-svn: 191480
* llvm-objdump: Dump COFF import table if -private-headers option is given.Rui Ueyama2013-09-271-30/+166
| | | | | | | | | | | | | | | | This is a patch to add capability to llvm-objdump to dump COFF Import Table entries, so that we can write tests for LLD checking Import Table contents. llvm-objdump did not print anything but just file name if the format is COFF and -private-headers option is given. This is a patch adds capability for dumping DLL Import Table, which is specific to the COFF format. In this patch I defined a new iterator to iterate over import table entries. Also added a few functions to COFFObjectFile.cpp to access fields of the entry. Differential Revision: http://llvm-reviews.chandlerc.com/D1719 llvm-svn: 191472
* ELF: Add support for the exclude section bit for gas compat.Benjamin Kramer2013-09-151-0/+1
| | | | llvm-svn: 190769
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-09-012-395/+401
| | | | llvm-svn: 189728
* Revert "Fix the build broken by r189315." and "Move everything depending on ↵Charles Davis2013-08-272-403/+397
| | | | | | | | | Object/MachOFormat.h over to Support/MachO.h." This reverts commits r189319 and r189315. r189315 broke some tests on what I believe are big-endian platforms. llvm-svn: 189321
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-08-272-397/+403
| | | | llvm-svn: 189315
* Support/MachO: Add a bunch of defines.Charles Davis2013-08-271-26/+26
| | | | | | | | Right now we have two headers for the Mach-O format. I'd like to get rid of one. Since the other object formats are all in Support, I chose to keep the Mach-O header in Support, and discard the other one. llvm-svn: 189314
* Move #includes from .h to .cpp file.Jakub Staszak2013-08-211-0/+2
| | | | llvm-svn: 188852
* Add back missing PPC relocation types.Ulrich Weigand2013-08-091-0/+36
| | | | llvm-svn: 188064
* Add missing PPC64 relocation types.Michael J. Spencer2013-08-081-0/+42
| | | | llvm-svn: 188031
* [Object] Split the ELF interface into 3 parts.Michael J. Spencer2013-08-083-2/+625
| | | | | | | | * ELFTypes.h contains template magic for defining types based on endianess, size, and alignment. * ELFFile.h defines the ELFFile class which provides low level ELF specific access. * ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface. llvm-svn: 188022
* initial draft of PPCMachObjectWriter.cppDavid Fang2013-08-081-3/+4
| | | | | | | | this records relocation entries in the mach-o object file for PIC code generation. tested on powerpc-darwin8, validated against darwin otool -rvV llvm-svn: 188004
* YAMLTraits.h: replace DenseMap that used a bad implementation of DenseMapInfoDmitri Gribenko2013-08-071-0/+1
| | | | | | | | | | for StringRef with a StringMap The bug is that the empty key compares equal to the tombstone key. Also added an assertion to DenseMap to catch similar bugs in future. llvm-svn: 187866
* MachObjectFile: Don't leak on error.Benjamin Kramer2013-08-031-7/+9
| | | | llvm-svn: 187698
* Add support for the 's' operation to llvm-ar.Rafael Espindola2013-07-291-2/+6
| | | | | | | | | | | | If no other operation is specified, 's' becomes an operation instead of an modifier. The s operation just creates a symbol table. It is the same as running ranlib. We assume the archive was created by a sane ar (like llvm-ar or gnu ar) and if the symbol table is present, then it is current. We use that to optimize the most common case: a broken build system that thinks it has to run ranlib. llvm-svn: 187353
* Remove the mblaze backend from llvm.Rafael Espindola2013-07-251-2/+0
| | | | | | Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html llvm-svn: 187145
* Delete the buffer in createObjectFile if it fails.Rafael Espindola2013-07-241-1/+4
| | | | | | | | | | The Binary constructor takes ownership of the memory buffer. This is a fairly unfortunate interface, but for now make createObjectFile consistent with it by also deleting the buffer if it fails. Fixes a leak in llvm-ar found by the valgrind bots. llvm-svn: 187039
* Typo.Eric Christopher2013-07-221-1/+1
| | | | llvm-svn: 186886
* 80-column tidying. Formatting choices by clang-format.Eric Christopher2013-07-221-14/+16
| | | | llvm-svn: 186885
* Retry submitting r186623: COFFDumper: Dump data directory entries.Rui Ueyama2013-07-191-37/+49
| | | | | | | | The original change was rolled back in r186627 because of test failures on the big endian machine. I believe I fixed the issue so re-submitting. llvm-svn: 186734
* Revert "COFFDumper: Dump data directory entries."Rui Ueyama2013-07-181-46/+36
| | | | | | Because it broke s390x and ppc64-linux buildbots. This reverts commit r186623. llvm-svn: 186627
* COFFDumper: Dump data directory entries.Rui Ueyama2013-07-181-36/+46
| | | | | | | | | | | | | | | | | Summary: Dump optional data directory entries in the PE/COFF header, so that we can test the output of LLD linker. This patch updates the test binary file, but the source of the binary is the same. I just re-linked the file. I don't know how the previous file was linked, but the previous file did not have any data directory entries for some reason. Reviewers: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1148 llvm-svn: 186623
* Add 'const' qualifiers to static const char* variables.Craig Topper2013-07-161-1/+1
| | | | llvm-svn: 186371
* Change llvm-ar to use lib/Object.Rafael Espindola2013-07-121-26/+23
| | | | | | | | | | | | | | | | | | | | | | This fixes two bugs is lib/Object that the use in llvm-ar found: * In OS X created archives, the name can be padded with nulls. Strip them. * In the constructor, remember the first non special member and use that in begin_children. This makes sure we skip all special members, not just the first one. The change to llvm-ar itself consist of * Using lib/Object for reading archives instead of ArchiveReader.cpp. * Writing the modified archive directly, instead of creating an in memory representation. The old Archive library was way more general than what is needed, as can be seen by the diffstat of this patch. Having llvm-ar using lib/Object now opens the way for creating regular symbol tables for both native objects and bitcode files so that we can use those archives for LTO. llvm-svn: 186197
* Don't reject an empty archive.Rafael Espindola2013-07-121-4/+6
| | | | llvm-svn: 186159
* Find the symbol table on archives created on OS X.Rafael Espindola2013-07-101-3/+14
| | | | llvm-svn: 186041
OpenPOWER on IntegriCloud