summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object/Inputs
Commit message (Collapse)AuthorAgeFilesLines
...
* Add dynamic_table iterators back to ELF.h.Rafael Espindola2015-08-071-0/+0
| | | | | | | | | In tree they are only used by llvm-readobj, but it is also used by https://github.com/mono/CppSharp. While at it, add some missing error checking. llvm-svn: 244320
* [COFF] Return symbol VAs instead of RVAs for PE filesReid Kleckner2015-07-312-0/+0
| | | | | | | | This makes llvm-nm consistent with binutils nm on executables and DLLs. For a vanilla hello world executable, the address of main should include the default image base of 0x400000. llvm-svn: 243755
* Support printing relocations in files with no section table.Rafael Espindola2015-07-231-0/+0
| | | | llvm-svn: 242998
* Refactor duplicated code and check for invalid symbol table size.Rafael Espindola2015-07-231-0/+0
| | | | llvm-svn: 242981
* [Object][ELF] Handle files with no section header string table.Michael J. Spencer2015-07-211-0/+0
| | | | llvm-svn: 242839
* Simplify iterating over the dynamic section and report broken ones.Rafael Espindola2015-07-201-0/+0
| | | | llvm-svn: 242712
* Remove Elf_Rela_Iter and Elf_Rel_Iter.Rafael Espindola2015-07-201-0/+0
| | | | | | Use just the pointers and check for invalid relocation sections. llvm-svn: 242700
* Report errors an invalid virtual addresses.Rafael Espindola2015-07-201-0/+0
| | | | llvm-svn: 242676
* Simplify iterating over program headers and detect corrupt ones.Rafael Espindola2015-07-201-0/+0
| | | | | | We now use a simple pointer and have range loops. llvm-svn: 242669
* llvm-readobj: Handle invalid references to the string table.Rafael Espindola2015-07-201-0/+0
| | | | llvm-svn: 242658
* Add missing file.Rafael Espindola2015-07-131-0/+0
| | | | | | Sorry about that. llvm-svn: 242083
* [Object][ELF] Support dumping hash-tables from files with no section table.Michael J. Spencer2015-07-091-0/+0
| | | | | | This time without breaking the bots. llvm-svn: 241869
* Add missing file from previous commit.Rafael Espindola2015-07-091-0/+0
| | | | llvm-svn: 241815
* Temporarily reverting 241765, 241768, and 241772 to unbreak the build bots.Adrian Prantl2015-07-091-0/+0
| | | | llvm-svn: 241781
* [Object][ELF] Support dumping hash-tables from files with no section table.Michael J. Spencer2015-07-091-0/+0
| | | | llvm-svn: 241765
* Don't reject an archive with just a symbol table.Rafael Espindola2015-07-081-0/+0
| | | | | | It is pretty unambiguous how to interpret it and gnu ar accepts it too. llvm-svn: 241750
* Check that COFF .obj files have sections with zero virtual address spaces.Rafael Espindola2015-07-061-0/+0
| | | | | | | | | | | | | When talking about the virtual address of sections the coff spec says: ... for simplicity, compilers should set this to zero. Otherwise, it is an arbitrary value that is subtracted from offsets during relocation. We don't currently subtract it, so check that it is zero. If some producer does create such files, we can change getRelocationOffset instead. llvm-svn: 241447
* Fix handling of ELF::R_MIPS_32 on Mips64.Rafael Espindola2015-07-061-0/+0
| | | | | | Thanks to Aboud, Amjad for reporting the regression and providing the testcase. llvm-svn: 241440
* Remove Elf_Shdr_Iter. Diagnose files with invalid section header sizes.Rafael Espindola2015-06-301-0/+0
| | | | llvm-svn: 241109
* Add a test of an elf file with an invalid section index.Rafael Espindola2015-06-301-0/+0
| | | | | | We were already checking, but were missing a test. llvm-svn: 241094
* Report an error on invalid sh_entsize.Rafael Espindola2015-06-301-0/+0
| | | | llvm-svn: 241070
* Factor out the checking of string tables.Rafael Espindola2015-06-291-0/+0
| | | | | | | | | | This moves the error checking for string tables to getStringTable which returns an ErrorOr<StringRef>. This improves error checking, makes it uniform across all string tables and makes it possible to check them once instead of once per name. llvm-svn: 240950
* Add a testcase for an invalid file.Rafael Espindola2015-06-291-0/+0
| | | | | | We were already checking this, but had no tests. llvm-svn: 240945
* Convert an assert that can fail into error checking.Rafael Espindola2015-06-291-0/+0
| | | | llvm-svn: 240944
* [Stackmap] Pre-assemble the stackmap parser test case. (Fix builders).Lang Hames2015-06-272-50/+0
| | | | | | | | This case had been failing on testers that didn't have x86 support. Rather than XFAIL it on testers without x86 support, I've just assembled it and used the raw object as the test input. llvm-svn: 240875
* [StackMaps] Add a lightweight parser for stackmap version 1 sections.Lang Hames2015-06-261-0/+50
| | | | | | | | | | The parser provides a convenient interface for reading llvm stackmap v1 sections in object files. This patch also includes a new option for llvm-readobj, '-stackmap', which uses the parser to pretty-print stackmap sections for debugging/testing purposes. llvm-svn: 240860
* Improve error handling of getRelocationAddend.Rafael Espindola2015-06-191-0/+0
| | | | | | | | | | | | | | | | | | This patch changes getRelocationAddend to use ErrorOr and considers it an error to try to get the addend of a REL section. If, for example, a x86_64 file has a REL section, that file is corrupted and we should reject it. Using ErrorOr is not ideal since we check the section type once per relocation instead of once per section. Checking once per section would involve getRelocationAddend just asserting and callers checking the section before iterating over the relocations. In any case, this is an improvement and includes a test. llvm-svn: 240176
* [Object, MachO] Don't crash on incomplete MachO segment load commands.Alexey Samsonov2015-06-041-0/+0
| | | | | | | | Report proper error code from MachOObjectFile constructor if we can't parse another segment load command (we already return a proper error if segment load command contents is suspicious). llvm-svn: 239109
* [Object, MachO] Don't crash on parsing invalid MachO header.Alexey Samsonov2015-06-041-0/+0
| | | | | | | | | | | Summary: Instead, properly report this error from MachOObjectFile constructor. Test Plan: regression test suite Reviewers: rafael Subscribers: llvm-commits llvm-svn: 239078
* Disassemble the start of sections even if there is no symbol there.Rafael Espindola2015-06-041-0/+0
| | | | | | | We already handled a section with no symbols, extend that to also handle a section with symbols that don't include the section start. llvm-svn: 239039
* Stop inventing symbol sizes.Rafael Espindola2015-05-222-0/+0
| | | | | | | | | | | | | | | | | | | | | MachO and COFF quite reasonably only define the size for common symbols. We used to try to figure out the "size" by computing the gap from one symbol to the next. This would not be correct in general, since a part of a section can belong to no visible symbol (padding, private globals). It was also really expensive, since we would walk every symbol to find the size of one. If a caller really wants this, it can sort all the symbols once and get all the gaps ("size") in O(n log n) instead of O(n^2). On MachO this also has the advantage of centralizing all the checks for an invalid n_sect. llvm-svn: 238028
* Detect invalid section indexes when we first read them.Rafael Espindola2015-05-221-0/+0
| | | | | | We still detect the same errors, but now we do it earlier. llvm-svn: 238024
* [llvm-readobj] Teach llvm-readobj to print PT_MIPS_ABIFLAGS program headerSimon Atanasyan2015-05-151-0/+0
| | | | llvm-svn: 237451
* [opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie2015-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gep operator Similar to gep (r230786) and load (r230794) changes. Similar migration script can be used to update test cases, which successfully migrated all of LLVM and Polly, but about 4 test cases needed manually changes in Clang. (this script will read the contents of stdin and massage it into stdout - wrap it in the 'apply.sh' script shown in previous commits + xargs to apply it over a large set of test cases) import fileinput import sys import re rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL) def conv(match): line = match.group(1) line += match.group(4) line += ", " line += match.group(2) return line line = sys.stdin.read() off = 0 for match in re.finditer(rep, line): sys.stdout.write(line[off:match.start()]) sys.stdout.write(conv(match)) off = match.end() sys.stdout.write(line[off:]) llvm-svn: 232184
* Object: Test for reading kext bundlesJustin Bogner2015-02-271-0/+0
| | | | | | | In the review for r230567, it was pointed out we should really test the lib/Object part of that change. This does so using llvm-readobj. llvm-svn: 230779
* [obj2yaml/yaml2obj] Add SHT_GROUP support.Shankar Easwaran2015-02-211-0/+0
| | | | | | This adds section group support to the tools obj2yaml and yaml2obj. llvm-svn: 230124
* [Object] Support reading 64-bit MIPS ELF archivesSimon Atanasyan2015-02-171-0/+0
| | | | | | | | | | | | | | | | | | | The 64-bit MIPS ELF archive file format is used by MIPS64 targets. The main difference from a regular archive file is the symbol table format: 1. ar_name is equal to "/SYM64/" 2. number of symbols and offsets are 64-bit integers http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf Page 96 The patch allows reading of such archive files by llvm-nm, llvm-objdump and other tools. But it does not support archive files with number of symbols and/or offsets exceed 2^32. I think it is a rather rare case requires more significant modification of `Archive` class code. http://reviews.llvm.org/D7546 llvm-svn: 229520
* Report fatal errors instead of segfaulting/asserting on a few invalid ↵Filipe Cabecinhas2015-01-1514-0/+0
| | | | | | | | | | | | | | | | | accesses while reading MachO files. Summary: Shift an older “invalid file” test to get a consistent naming for these tests. Bugs found by afl-fuzz Reviewers: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6945 llvm-svn: 226219
* Don't loop endlessly for MachO files with 0 ncmdsFilipe Cabecinhas2015-01-061-0/+0
| | | | llvm-svn: 225271
* [Object] Don't crash on empty export lists.Juergen Ributzka2014-12-191-0/+0
| | | | | | | | | | | | 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
* Start adding thin archive support.Rafael Espindola2014-12-161-0/+0
| | | | | | This is just sufficient for 'ar t' to work. llvm-svn: 224307
* Add missing test fileJean-Daniel Dupas2014-12-041-0/+0
| | | | llvm-svn: 223346
* [Object][Mips] Return address of MIPS symbol with cleared microMIPS ↵Simon Atanasyan2014-11-251-0/+0
| | | | | | indicator bit llvm-svn: 222726
* Object, support both mach-o archive t.o.c file namesNick Kledzik2014-11-121-0/+0
| | | | | | | | | | 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
* Add CRLF support to LineIterator.Rafael Espindola2014-11-031-0/+2
| | | | | | | The MRI scripts have to work with CRLF, and in general it is probably a good idea to support this in a core utility like LineIterator. llvm-svn: 221153
* Add tests for r219479.David Majnemer2014-10-101-0/+167
| | | | llvm-svn: 219480
* obj2yaml, COFF: Handle long section namesDavid Majnemer2014-10-101-0/+11
| | | | | | | | | | | | | Long section names are represented as a slash followed by a numeric ASCII string. This number is an offset into a string table. Print the appropriate entry in the string table instead of the less enlightening /4. N.B. yaml2obj already does the right thing, this test exercises both sides of the (de-)serialization. llvm-svn: 219458
* Fix an off-by-one bug in the target independent llvm-objdump.Rafael Espindola2014-08-171-0/+0
| | | | | | | | It would prevent the display of a single byte instruction before a label. Patch by Steve King! llvm-svn: 215837
* Add printing of Mach-O stabs in llvm-nm.Kevin Enderby2014-07-171-0/+0
| | | | llvm-svn: 213327
* [Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj,Simon Atanasyan2014-07-131-0/+0
| | | | | | obj2yaml and yaml2obj tools. llvm-svn: 212908
OpenPOWER on IntegriCloud