summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
Commit message (Collapse)AuthorAgeFilesLines
...
* Move test that depends on x86 to the x86 directory.Rafael Espindola2015-06-041-1/+1
| | | | llvm-svn: 239043
* Disassemble the start of sections even if there is no symbol there.Rafael Espindola2015-06-042-0/+9
| | | | | | | 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
* Fix the interpretation of a 0 st_name.Rafael Espindola2015-06-032-41/+26
| | | | | | | | | | | | | | The ELF spec is very clear: ----------------------------------------------------------------------------- If the value is non-zero, it represents a string table index that gives the symbol name. Otherwise, the symbol table entry has no name. -------------------------------------------------------------------------- In particular, a st_name of 0 most certainly doesn't mean that the symbol has the same name as the section. llvm-svn: 238899
* Stop inventing symbol sizes.Rafael Espindola2015-05-224-10/+1
| | | | | | | | | | | | | | | | | | | | | 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-222-6/+2
| | | | | | We still detect the same errors, but now we do it earlier. llvm-svn: 238024
* Fix llvm-nm -S option.Rafael Espindola2015-05-221-16/+23
| | | | | | | It is explicitly documented to have no effect on object formats where symbols don't have sizes. llvm-svn: 238019
* Make this test stricter. NFC.Rafael Espindola2015-05-221-8/+16
| | | | llvm-svn: 238018
* [llvm-readobj] Teach llvm-readobj to print PT_MIPS_ABIFLAGS program headerSimon Atanasyan2015-05-151-0/+0
| | | | llvm-svn: 237451
* [llvm-readobj/obj2yaml/yaml2obj] Support MIPS machine ELF header flagsSimon Atanasyan2015-05-081-16/+17
| | | | llvm-svn: 236807
* [obj2yaml/yaml2obj] Add SHT_MIPS_ABIFLAGS section supportSimon Atanasyan2015-05-072-1/+69
| | | | | | | This change adds support for the SHT_MIPS_ABIFLAGS section reading/writing to the obj2yaml and yaml2obj tools. llvm-svn: 236738
* [llvm-readobj/obj2yaml/yaml2obj] Support more MIPS ELF header flagsSimon Atanasyan2015-05-072-0/+187
| | | | llvm-svn: 236728
* [Object] Teach Object and llvm-objdump about ".hidden"Davide Italiano2015-04-301-0/+2
| | | | | | | Differential Revision: http://reviews.llvm.org/D9416 Reviewed by: rafael llvm-svn: 236279
* Support arm32 R_ARM_V4BX relocation formatAdhemerval Zanella2015-04-221-0/+77
| | | | | | | | | | | | ARM32 ELF R_ARM_V4BX relocation format is a special relocation type that records the location of an ARMv4t BX instruction to enable a static linker to generate ARMv4 compatible instructions. This relocation does not contain a reference symbol. This patch enabled its creation by removing the requeriment of a relocation symbol target in ELFState<ELFT>::writeSectionContent. llvm-svn: 235513
* [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
* Make llvm/test/Object/archive-format.test CRLF-tolerant.NAKAMURA Takumi2015-03-031-5/+4
| | | | llvm-svn: 231074
* lit: Add 'cd' support to the internal shell and port some testsReid Kleckner2015-03-027-14/+1
| | | | | | | | | | | The internal shell was already threading around a 'cwd' parameter. We just have to make it mutable so that we can update it as the test script executes. If the shell ever grows support for environment variable substitution, we could also implement support for export. llvm-svn: 231017
* Object: Test for reading kext bundlesJustin Bogner2015-02-272-0/+7
| | | | | | | 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-212-0/+26
| | | | | | This adds section group support to the tools obj2yaml and yaml2obj. llvm-svn: 230124
* [Object] Support reading 64-bit MIPS ELF archivesSimon Atanasyan2015-02-172-0/+27
| | | | | | | | | | | | | | | | | | | 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
* [ELFYAML] Provide default value 0 for YAML relocation addendum fieldSimon Atanasyan2015-01-293-14/+0
| | | | | | Follow up to r227318. llvm-svn: 227422
* [ELFYAML] Provide explicit value for relocation addendums in the testSimon Atanasyan2015-01-281-0/+4
| | | | | | | | | | | | The `Addend` is an optional field of the `Relocation` YAML record. But we do not provide its default value while reading it from a YAML file and so it might keep uninitialized. I am going to fix the code by a separate commit. We might either make this field mandatory (at least for .rela sections) or specify 0 as a default value explicitly. llvm-svn: 227318
* [ELFYAML] Support mips64 relocation record format in yaml2obj/obj2yamlSimon Atanasyan2015-01-251-0/+113
| | | | | | | | | | | | | | | | | | | MIPS64 ELF file has a very specific relocation record format. Each record might specify up to three relocation operations. So the `r_info` field in fact consists of three relocation type sub-fields and optional code of "special" symbols. http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf page 40 The patch implements support of the MIPS64 relocation record format in yaml2obj/obj2yaml tools by introducing new optional Relocation fields: Type2, Type3, and SpecSym. These fields are recognized only if the object/YAML file relates to the MIPS64 target. Differential Revision: http://reviews.llvm.org/D7136 llvm-svn: 227044
* [Object][ELF] Test unknown type.Michael J. Spencer2015-01-231-0/+10
| | | | llvm-svn: 226943
* Fix edge case when Start overflowed in 32 bit modeFilipe Cabecinhas2015-01-151-1/+1
| | | | llvm-svn: 226229
* Report fatal errors instead of segfaulting/asserting on a few invalid ↵Filipe Cabecinhas2015-01-1516-9/+51
| | | | | | | | | | | | | | | | | 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-062-0/+9
| | | | llvm-svn: 225271
* [Object] Don't crash on empty export lists.Juergen Ributzka2014-12-192-0/+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
* Start adding thin archive support.Rafael Espindola2014-12-162-0/+8
| | | | | | 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
* Add mach-o LC_RPATH support to llvm-objdumpJean-Daniel Dupas2014-12-041-0/+7
| | | | | | | | | | 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
* Widen ELFYAML relocation type to 32 bitsWill Newton2014-11-271-1/+9
| | | | | | | The current 8 bits is sufficient for ELF32 targets but ELF64 requires 32 bits. Add a test for AArch64 that exposes the issue. llvm-svn: 222898
* [Object][Mips] Return address of MIPS symbol with cleared microMIPS ↵Simon Atanasyan2014-11-252-0/+12
| | | | | | indicator bit llvm-svn: 222726
* Object, support both mach-o archive t.o.c file namesNick Kledzik2014-11-122-0/+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
* [yaml2obj] Support AArch64 relocations.Chad Rosier2014-11-101-0/+47
| | | | | | | Patch by Daniel Stewart <stewartd@codeaurora.org>! Phabricator Revision: http://reviews.llvm.org/D6192 llvm-svn: 221639
* [ELF][yaml2obj] Handle additional MIPS specific st_other field flagsSimon Atanasyan2014-11-061-1/+3
| | | | | | | | 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
* Plumb in the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler andKevin Enderby2014-11-061-1/+1
| | | | | | | | | | | | add the code and test cases for 32-bit ARM symbolizer. Also fixed the printing of data in code as it was not using the table correctly and needed to fix one of the test cases too. This will break lld’s test/mach-o/arm-interworking-movw.yaml till the tweak for that is made. Which I’ll be committing immediately after this commit. llvm-svn: 221470
* Object, COFF: Infer symbol sizes from adjacent symbolsDavid Majnemer2014-11-061-6/+6
| | | | | | | | | 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
* Remove "REQUIRES:shell" from tests. They work for me.NAKAMURA Takumi2014-11-041-2/+0
| | | | llvm-svn: 221269
* [yaml2obj] Allow yaml2obj tool to recognize EF_MIPS_NAN2008 flagSimon Atanasyan2014-11-041-2/+4
| | | | llvm-svn: 221268
* Re-enable tests in llvm/test/Object, corresponding to line_iterator'sNAKAMURA Takumi2014-11-045-15/+0
| | | | | | change in r221153. llvm-svn: 221265
* Add CRLF support to LineIterator.Rafael Espindola2014-11-032-0/+3
| | | | | | | 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
* Object, COFF: Cleanup symbol type code, improve binutils compatibilityDavid Majnemer2014-10-314-7/+7
| | | | | | | Do a better job classifying symbols. This increases the consistency between the COFF handling code and the ELF side of things. llvm-svn: 220952
* Fix getRelocationValueString to return the symbol name for EM_386.Jan Wen Voung2014-10-292-6/+6
| | | | | | | | | | | | | | Summary: This helps llvm-objdump -r to print out the symbol name along with the relocation type on x86. Adjust existing tests from checking for "Unknown" to check for the symbol now. Test Plan: Adjusted test/Object tests. Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5987 llvm-svn: 220866
* Handle spaces and quotes in file names in MRI scripts.Rafael Espindola2014-10-221-1/+1
| | | | llvm-svn: 220364
* MRI scripts: Add addlib support.Rafael Espindola2014-10-211-0/+17
| | | | llvm-svn: 220346
* Overwrite instead of adding to archives when creating them in mri scripts.Rafael Espindola2014-10-211-0/+18
| | | | | | | This matches the behavior of GNU ar and also makes it easier to implemnt support for the addlib command. llvm-svn: 220336
* Add support for addmod to mri scripts.Rafael Espindola2014-10-211-0/+18
| | | | llvm-svn: 220294
* Suppress llvm-ar's MRI tests for now on win32, since line_iterator is ↵NAKAMURA Takumi2014-10-113-0/+9
| | | | | | incompatible to CRLF. llvm-svn: 219579
* llvm-ar: Start adding support for mri scripts.Rafael Espindola2014-10-105-0/+25
| | | | | | | | | | | | | | | | | | | | | | I was quiet surprised to find this feature being used. Fortunately the uses I found look fairly simple. In fact, they are just a very verbose version of the regular ar commands. Start implementing it then by parsing the script and setting the command variables as if we had a regular command line. This patch adds just enough support to create an empty archive and do a bit of error checking. In followup patches I will implement at least addmod and addlib. From the description in the manual, even the more general case should not be too hard to implement if needed. The features that don't map 1:1 to the simple command line are * Reading from multiple archives. * Creating multiple archives. llvm-svn: 219521
* Add tests for r219479.David Majnemer2014-10-102-0/+263
| | | | llvm-svn: 219480
OpenPOWER on IntegriCloud