summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't create an archive if, for example, we are asked to print the index.Rafael Espindola2013-07-051-0/+17
| | | | llvm-svn: 185697
* Add support for archives with no symbol table or string table.Rafael Espindola2013-07-042-0/+5
| | | | llvm-svn: 185664
* Add support for gnu archives with a string table and no symtab.Rafael Espindola2013-07-032-0/+8
| | | | | | While there, use early returns to reduce nesting. llvm-svn: 185547
* Make llvm-nm return 1 on error.Rafael Espindola2013-07-031-0/+17
| | | | | | | This is a small compatibility improvement with gnu nm and makes llvm-nm more useful as a testing tool. llvm-svn: 185546
* [yaml2obj][ELF] Make symbol table top-level key.Sean Silva2013-06-222-25/+21
| | | | | | | | | Although in reality the symbol table in ELF resides in a section, the standard requires that there be no more than one SHT_SYMTAB. To enforce this constraint, it is cleaner to group all the symbols under a top-level `Symbols` key on the object file. llvm-svn: 184627
* This was a nifty test, but remove it.Sean Silva2013-06-211-6/+0
| | | | | | | | | | | | | | It wouldn't really test anything that doesn't already have a more targeted test: `yaml2obj-elf-section-basic.yaml`: Already tests that section content is correctly passed though. `yaml2obj-elf-symbol-basic.yaml` (this file): Tests that the st_value and st_size attributes of `main` are set correctly. Between those two tests, disassembling the file doesn't really add anything, so just remove mention of disassembling the file. llvm-svn: 184607
* Revert "Put r184469 disassembler test back on X86"Sean Silva2013-06-212-46/+15
| | | | | | | | | This reverts commit r184602. In an upcoming commit, I will just remove the disassembler part of the test; it was mostly just a "nifty" thing marking a milestone but it doesn't test anything that isn't tested elsewhere. llvm-svn: 184606
* Put r184469 disassembler test back on X86Renato Golin2013-06-212-15/+46
| | | | llvm-svn: 184602
* [yaml2obj][ELF] Don't do disassembly in this test.Sean Silva2013-06-211-1/+2
| | | | | | | | | This was causing buildbot failures when build without X86 support. Is there a way to conditionalize the test on the X86 target being present? llvm-svn: 184597
* [yaml2obj][ELF] Allow expressing undefined symbols.Sean Silva2013-06-211-0/+4
| | | | | | | | | | Previously we unconditionally enforced that section references in symbols in the YAML had a name that was a section name present in the object, and linked the references to that section. Now, permit empty section names (already the default, if the `Section` key is not provided) to indicate SHN_UNDEF. llvm-svn: 184513
* [yaml2obj][ELF] Don't explicitly set `Binding` with STB_*Sean Silva2013-06-212-6/+45
| | | | | | | | | | | | | | | Instead, just have 3 sub-lists, one for each of {STB_LOCAL,STB_GLOBAL,STB_WEAK}. This allows us to be a lot more explicit w.r.t. the symbol ordering in the object file, because if we allowed explicitly setting the STB_* `Binding` key for the symbol, then we might have ended up having to shuffle STB_LOCAL symbols to the front of the list, which is likely to cause confusion and potential for error. Also, this new approach is simpler ;) llvm-svn: 184506
* [yaml2obj][ELF] Add support for st_value and st_size.Sean Silva2013-06-201-0/+16
| | | | | | | | | After this patch, the ELF file produced by `yaml2obj-elf-symbol-basic.yaml`, when linked and executed on x86_64 (under SysV ABI, obviously; I tested on Linux), produces a working executable that goes into an infinite loop! llvm-svn: 184469
* [yaml2obj][ELF] Allow symbols to reference sections.Sean Silva2013-06-201-0/+2
| | | | llvm-svn: 184468
* Make sure ar is creating a new file instead of updating an existing one.Rafael Espindola2013-06-201-0/+1
| | | | | | Should fix the bots that are seeing a corrupted file from a previous run. llvm-svn: 184424
* [yaml2obj][ELF] Beef up this test a bit.Sean Silva2013-06-191-0/+1
| | | | llvm-svn: 184269
* [yaml2obj][ELF] Support ELFOSABI_* enum.Sean Silva2013-06-191-0/+10
| | | | llvm-svn: 184268
* [yaml2obj][ELF] Support st_info through `Binding` and `Type` YAML keys.Sean Silva2013-06-191-0/+4
| | | | llvm-svn: 184263
* [yaml2obj][ELF] Ensure STN_UNDEF entry is present.Sean Silva2013-06-181-1/+0
| | | | llvm-svn: 184258
* [yaml2obj][ELF] Rudimentary symbol table support.Sean Silva2013-06-181-0/+22
| | | | | | Currently, we only output the name. llvm-svn: 184255
* Basic support for parsing Mach-O universal binaries in LLVMObject libraryAlexey Samsonov2013-06-182-0/+6
| | | | llvm-svn: 184191
* [yaml2obj] Add support for sh_link via `Link` key.Sean Silva2013-06-151-0/+3
| | | | llvm-svn: 184022
* [yaml2obj] Add support for sh_addralign via `AddressAlign` key.Sean Silva2013-06-141-2/+4
| | | | | | | For consistency, change the address in the test case from 0xDEADBEEF to 0xCAFEBABE since 0xCAFEBABE that actually has a 2-byte alignment. llvm-svn: 183962
* [yaml2obj] Add support for specifying raw section content.Sean Silva2013-06-131-1/+6
| | | | llvm-svn: 183955
* [yaml2obj] Add sh_addr via `Address` key.Sean Silva2013-06-131-0/+2
| | | | llvm-svn: 183954
* [yaml2obj] Initial ELF section support.Sean Silva2013-06-132-1/+24
| | | | | | | The current functionality is extremely basic and a bit rough around the edges, but it will flesh out in future commits. llvm-svn: 183953
* [yaml2obj] Remove fragile test case.Sean Silva2013-06-122-39/+0
| | | | | | | | | | This test case was a "sanity check"/"breathing" test case at first, but is really fragile, which impairs changes to yaml2obj. `test/Object/yaml2obj-elf-bits-endian.test` is much more robust and serves as an adequate sanity check. llvm-svn: 183811
* Fix dubious type name similar to member name.Sean Silva2013-06-115-5/+5
| | | | | | Should bring bots back to life. llvm-svn: 183715
* [yaml2obj] Initial ELF support.Sean Silva2013-06-107-0/+79
| | | | | | | | | Currently, only emitting the ELF header is supported (no sections or segments). The ELFYAML code organization is broadly similar to the COFFYAML code. llvm-svn: 183711
* Move the test for the data in code into the ARM directory as it is an ARMKevin Enderby2013-06-061-0/+0
| | | | | | | | binary that is used for the test. Caught by Jim Grosbach! rdar://11791371 llvm-svn: 183442
* Teach llvm-objdump with the -macho parser how to use the data in code tableKevin Enderby2013-06-062-0/+7
| | | | | | | | | | | | | | | from the LC_DATA_IN_CODE load command. And when disassembling print the data in code formatted for the kind of data it and not disassemble those bytes. I added the format specific functionality to the derived class MachOObjectFile since these tables only appears in Mach-O object files. This is my first attempt to modify the libObject stuff so if folks have better suggestions how to fit this in or suggestions on the implementation please let me know. rdar://11791371 llvm-svn: 183424
* Print symbol names in relocations when dumping COFF as YAML.Rafael Espindola2013-06-063-12/+12
| | | | llvm-svn: 183403
* Don't print default values for NumberOfAuxSymbols and AuxiliaryData.Rafael Espindola2013-06-051-0/+1
| | | | llvm-svn: 183293
* Handle relocations that don't point to symbols.Rafael Espindola2013-06-052-0/+7
| | | | | | | | In ELF (as in MachO), not all relocations point to symbols. Represent this properly by using a symbol_iterator instead of a SymbolRef. Update llvm-readobj ELF's dumper to handle relocatios without symbols. llvm-svn: 183284
* [Object/COFF] Fix Windows .lib name handling.Rui Ueyama2013-06-033-0/+26
| | | | llvm-svn: 183091
* Change how we iterate over relocations on ELF.Rafael Espindola2013-05-301-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | For COFF and MachO, sections semantically have relocations that apply to them. That is not the case on ELF. In relocatable objects (.o), a section with relocations in ELF has offsets to another section where the relocations should be applied. In dynamic objects and executables, relocations don't have an offset, they have a virtual address. The section sh_info may or may not point to another section, but that is not actually used for resolving the relocations. This patch exposes that in the ObjectFile API. It has the following advantages: * Most (all?) clients can handle this more efficiently. They will normally walk all relocations, so doing an effort to iterate in a particular order doesn't save time. * llvm-readobj now prints relocations in the same way the native readelf does. * probably most important, relocations that don't point to any section are now visible. This is the case of relocations in the rela.dyn section. See the updated relocation-executable.test for example. llvm-svn: 182908
* Add MCSymbolizer for symbolic/annotated disassembly.Ahmed Bougacha2013-05-241-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a basic first step towards symbolization of disassembled instructions. This used to be done using externally provided (C API) callbacks. This patch introduces: - the MCSymbolizer class, that mimics the same functions that were used in the X86 and ARM disassemblers to symbolize immediate operands and to annotate loads based off PC (for things like c string literals). - the MCExternalSymbolizer class, which implements the old C API. - the MCRelocationInfo class, which provides a way for targets to translate relocations (either object::RelocationRef, or disassembler C API VariantKinds) to MCExprs. - the MCObjectSymbolizer class, which does symbolization using what it finds in an object::ObjectFile. This makes simple symbolization (with no fancy relocation stuff) work for all object formats! - x86-64 Mach-O and ELF MCRelocationInfos. - A basic ARM Mach-O MCRelocationInfo, that provides just enough to support the C API VariantKinds. Most of what works in otool (the only user of the old symbolization API that I know of) for x86-64 symbolic disassembly (-tvV) works, namely: - symbol references: call _foo; jmp 15 <_foo+50> - relocations: call _foo-_bar; call _foo-4 - __cf?string: leaq 193(%rip), %rax ## literal pool for "hello" Stub support is the main missing part (because libObject doesn't know, among other things, about mach-o indirect symbols). As for the MCSymbolizer API, instead of relying on the disassemblers to call the tryAdding* methods, maybe this could be done automagically using InstrInfo? For instance, even though PC-relative LEAs are used to get the address of string literals in a typical Mach-O file, a MOV would be used in an ELF file. And right now, the explicit symbolization only recognizes PC-relative LEAs. InstrInfo should have already have most of what is needed to know what to symbolize, so this can definitely be improved. I'd also like to remove object::RelocationRef::getValueString (it seems only used by relocation printing in objdump), as simply printing the created MCExpr is definitely enough (and cleaner than string concats). llvm-svn: 182625
* Use std::list so that we have a stable iterator.Rafael Espindola2013-05-211-3/+2
| | | | | | | I will try to avoid creating these std::strings, but for now this gets the tests passing with libc++. llvm-svn: 182405
* Temporarily disable this test because it is failing when using libc++.Bob Wilson2013-05-191-2/+3
| | | | llvm-svn: 182212
* Convert obj2yaml to use yamlio.Rafael Espindola2013-05-171-96/+78
| | | | llvm-svn: 182169
* Object: Fix Mach-O relocation printing.Ahmed Bougacha2013-05-141-0/+35
| | | | | | | | | There were two problems that made llvm-objdump -r crash: - for non-scattered relocations, the symbol/section index is actually in the (aptly named) symbolnum field. - sections are 1-indexed. llvm-svn: 181843
* Change getRelocationAdditionalInfo to be ELF only.Rafael Espindola2013-05-091-2/+2
| | | | | | | It was only implemented for ELF where it collected the Addend, so this patch also renames it to getRelocationAddend. llvm-svn: 181502
* Split Alignment out of the Section Characteristics.Rafael Espindola2013-05-062-4/+8
| | | | | | | | The alignment is just a byte in the middle of Characteristics, not an independent flag. Making it an independent field in the yaml representation makes it more yamlio friendly. llvm-svn: 181243
* Revert r181009.Amara Emerson2013-05-032-0/+0
| | | | llvm-svn: 181079
* Delete test instead.Amara Emerson2013-05-031-47/+0
| | | | llvm-svn: 181066
* Temporarily disable failing test.Amara Emerson2013-05-031-0/+1
| | | | llvm-svn: 181062
* Add support for reading ARM ELF build attributes.Amara Emerson2013-05-033-0/+46
| | | | | | | | | | | Build attribute sections can now be read if they exist via ELFObjectFile, and the llvm-readobj tool has been extended with an option to dump this information if requested. Regression tests are also included which exercise these features. Also update the docs with a fixed ARM ABI link and a new link to the Addenda which provides the build attributes specification. llvm-svn: 181009
* Add missing ':'.Rafael Espindola2013-04-261-1/+1
| | | | llvm-svn: 180616
* Clarify getRelocationAddress x getRelocationOffset a bit.Rafael Espindola2013-04-252-0/+18
| | | | | | | | | | getRelocationAddress is for dynamic libraries and executables, getRelocationOffset for relocatable objects. Mark the getRelocationAddress of COFF and MachO as not implemented yet. Add a test of ELF's. llvm-readobj -r now prints the same values as readelf -r. llvm-svn: 180259
* Fix typo.Rafael Espindola2013-04-232-4/+4
| | | | llvm-svn: 180137
* Write relocations in yaml2obj.Rafael Espindola2013-04-231-1/+21
| | | | llvm-svn: 180115
OpenPOWER on IntegriCloud