summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
Commit message (Collapse)AuthorAgeFilesLines
...
* Update MachOObjectFile::getSymbolAddress so it returns UnknownAddressOrSizeKevin Enderby2014-05-202-5/+5
| | | | | | | for undefined symbols. Allowing llvm-nm to print spaces instead of 0’s for the value of undefined symbols in Mach-O files. llvm-svn: 209235
* Implement MachOObjectFile::isSectionData() and MachOObjectFile::isSectionBSSKevin Enderby2014-05-192-0/+15
| | | | | | | | so that llvm-size will total up all the sections in the Berkeley format. This allows for rough categorizations for Mach-O sections. And allows the total of llvm-size’s Berkeley and System V formats to be the same. llvm-svn: 209158
* [yaml2obj][ELF] Add an optional `Size` field to the YAML section declaration.Simon Atanasyan2014-05-162-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now the only method to configure ELF section's content and size is to assign a hexadecimal string to the `Content` field. Unfortunately this way is completely useless when you need to declare a really large section. To solve this problem this patch adds one more optional field `Size` to the `RawContentSection` structure. When yaml2obj generates an ELF file it uses the following algorithm: 1. If both `Content` and `Size` fields are missed create an empty section. 2. If only `Content` field is missed take section length from the `Size` field and fill the section by zero. 3. If only `Size` field is missed create a section using data from the `Content` field. 4. If both `Content` and `Size` fields are provided validate that the `Size` value is not less than size of `Content` data. Than take section length from the `Size`, fill beginning of the section by `Content` and the rest by zero. Examples -------- * Create a section 0x10000 bytes long filled by zero Name: .data Type: SHT_PROGBITS Flags: [ SHF_ALLOC ] Size: 0x10000 * Create a section 0x10000 bytes long starting from 'CA' 'FE' 'BA' 'BE' Name: .data Type: SHT_PROGBITS Flags: [ SHF_ALLOC ] Content: CAFEBABE Size: 0x10000 The patch reviewed by Michael Spencer. llvm-svn: 208995
* [obj2yaml][ELF] Print relocation's offset as a hex number. Use a properSimon Atanasyan2014-05-151-10/+10
| | | | | | types to hold relocation's offset and addend. llvm-svn: 208906
* [obj2yaml][ELF] Do not print empty Link and Info fields for ELF sections.Simon Atanasyan2014-05-151-26/+0
| | | | llvm-svn: 208905
* [yaml2obj] Add "-o" command line option to specify an output file name.Simon Atanasyan2014-05-152-0/+6
| | | | llvm-svn: 208900
* Teach llvm-nm to know about fat archives (aka MachOUniversal filesKevin Enderby2014-05-142-5/+18
| | | | | | containing archives). First step as other tools will be updated next. llvm-svn: 208812
* [obj2yaml] Support ELF input format in the obj2yaml tool.Simon Atanasyan2014-05-141-1/+249
| | | | | | | | | | The ELF header e_flags field in the MIPS related test cases handled incorrectly. The obj2yaml prints too many flags. I will fix that in the next patches. The patch reviewed by Michael Spencer and Sean Silva. llvm-svn: 208752
* Fix llvm-nm to print the full 64-bit address for symbols in 64-bit object files.Kevin Enderby2014-05-095-60/+64
| | | | | | | | | | | | | | The implementation might be better to have a method is64Bit() in the class SymbolicFile instead of having the static routine isSymbolList64Bit() in llvm-nm.cpp . But this is very much in the sprit of isObject() and getNMTypeChar() in llvm-nm.cpp that has a series of if else statements based on the specific class of the SymbolicFile. I can update this if folks would like. Also the tests were updated to be explicit about checking the address for 64-bits or 32-bits from object files. llvm-svn: 208463
* [yaml2obj] Follow-up to the r208228 and r208406. Remove duplicated YAMLSimon Atanasyan2014-05-091-3/+0
| | | | | | map keys. llvm-svn: 208412
* Mark yaml2obj-elf-x86-rel.yaml as XFAIL:vg_leak for now. This has two pairs ↵NAKAMURA Takumi2014-05-091-0/+1
| | | | | | of duplicate hashes. llvm-svn: 208406
* [yaml2obj] Support ELF x86 relocations.Simon Atanasyan2014-05-071-0/+43
| | | | llvm-svn: 208228
* [llvm-readobj] Add support for Mips specific ELF header e_flags.Simon Atanasyan2014-05-011-4/+5
| | | | llvm-svn: 207744
* Use the new StringTableBuilder in yaml2elfHans Wennborg2014-04-302-8/+8
| | | | | | http://reviews.llvm.org/D3574 llvm-svn: 207694
* Update tests to use the new format of printing a TimeValue. It's a bitChandler Carruth2014-04-282-13/+13
| | | | | | | | | | | | odd to have the output of 'llvm-ar tv' depend on the format of TimeValue::str(), but that's what we have today. If anyone needs the output to remain compatible with GNU ar or old versions of llvm-ar, just shout and I'll switch the code to manually format its times. Note that there isn't a portable format -- Mac and GNU have different formats at least (thanks Rafael!) so... llvm-svn: 207387
* [yaml2obj][ELF] ELF Relocations Support.Simon Atanasyan2014-04-111-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch implements support for both relocation record formats: Elf_Rel and Elf_Rela. It is possible to define relocation against symbol only. Relocations against sections will be implemented later. Now yaml2obj recognizes X86_64, MIPS and Hexagon relocation types. Example of relocation section specification: Sections: - Name: .text Type: SHT_PROGBITS Content: "0000000000000000" AddressAlign: 16 Flags: [SHF_ALLOC] - Name: .rel.text Type: SHT_REL Info: .text AddressAlign: 4 Relocations: - Offset: 0x1 Symbol: glob1 Type: R_MIPS_32 - Offset: 0x2 Symbol: glob2 Type: R_MIPS_CALL16 The patch reviewed by Michael Spencer, Sean Silva, Shankar Easwaran. llvm-svn: 206017
* YAMLIO: Allow scalars to dictate quotation rulesDavid Majnemer2014-04-101-1/+1
| | | | | | | Introduce ScalarTraits::mustQuote which determines whether or not a StringRef needs quoting before it is acceptable to output. llvm-svn: 205955
* Revert "Revert "YAMLIO: Encode ambiguous hex strings explicitly""David Majnemer2014-04-091-1/+1
| | | | | | | | | Don't quote octal compatible strings if they are only two wide, they aren't ambiguous. This reverts commit r205857 which reverted r205857. llvm-svn: 205914
* obj2yaml: Don't crash if the characteristics field is zeroDavid Majnemer2014-04-092-0/+46
| | | | | | | | | obj2yaml would fail when seeing a Weak External auxiliary record with a characteristics field holding zero instead of one of IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY, IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY, or IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY. llvm-svn: 205911
* Revert "YAMLIO: Encode ambiguous hex strings explicitly"Filipe Cabecinhas2014-04-091-1/+1
| | | | | | | | This reverts commit r205839. It broke several tests in lld. llvm-svn: 205857
* YAMLIO: Encode ambiguous hex strings explicitlyDavid Majnemer2014-04-091-1/+1
| | | | | | | | | | YAMLIO would turn a BinaryRef into the string 0000000004000000. However, the leading zero causes parsers to interpret it as being an octal number instead of a hexadecimal one. Instead, escape such strings as needed. llvm-svn: 205839
* obj2yaml: Use the correct relocation type for different machine typesDavid Majnemer2014-04-073-2/+35
| | | | | | | | | | | | | The IO normalizer would essentially lump I386 and AMD64 relocations together. Relocation types with the same numeric value would then get mapped in appropriately. For example: IMAGE_REL_AMD64_ADDR64 and IMAGE_REL_I386_DIR16 both have a numeric value of one. We would see IMAGE_REL_I386_DIR16 in obj2yaml conversions of object files with a machine type of IMAGE_FILE_MACHINE_AMD64. llvm-svn: 205746
* Implement getRelocationAddress for MachO and ET_REL elf files.Rafael Espindola2014-04-033-0/+20
| | | | | | With that, fix the symbolizer to work with any ELF file. llvm-svn: 205588
* Only clear the thumb bit from function addresses.Rafael Espindola2014-04-032-0/+8
| | | | llvm-svn: 205500
* Revert "Fix a nomenclature error in llvm-nm."Rafael Espindola2014-04-032-0/+10
| | | | | | | | | | | | | | | | This reverts commit r205479. It turns out that nm does use addresses, it is just that every reasonable relocatable ELF object has sections with address 0. I have no idea if those exist in reality, but it at least it shows that llvm-nm should use the name address. The added test was includes an unusual .o file with non 0 section addresses. I created it by hacking ELFObjectWriter.cpp. Really sorry for the churn. llvm-svn: 205493
* [yaml2obj] Add support for ELF e_flags.Daniel Sanders2014-03-311-0/+16
| | | | | | | | | | | | | | | | Summary: The FileHeader mapping now accepts an optional Flags sequence that accepts the EF_<arch>_<flag> constants. When not given, Flags defaults to zero. Reviewers: atanasyan Reviewed By: atanasyan CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3213 llvm-svn: 205173
* Teach llvm-readobj to print human friendly description of reserved sections.Rafael Espindola2014-03-243-12/+12
| | | | llvm-svn: 204584
* Object: Output .file symbols properlyDavid Majnemer2014-03-202-0/+17
| | | | | | | obj2yaml would emit the NUL bytes padding the auxiliary file symbol records. Trimming them looks nicer. llvm-svn: 204314
* Object: Provide a richer means of describing auxiliary symbolsDavid Majnemer2014-03-193-16/+48
| | | | | | | | | | | | | | | | The current state of affairs has auxiliary symbols described as a big bag of bytes. This is less than satisfying, it detracts from the YAML file as being human readable. Instead, allow for symbols to optionally contain their auxiliary data. This allows us to have a much higher level way of describing things like weak symbols, function definitions and section definitions. This depends on D3105. Differential Revision: http://llvm-reviews.chandlerc.com/D3092 llvm-svn: 204214
* [yaml2obj][ELF] Assign name (.shstrtab) to the section holds sections names.Simon Atanasyan2014-03-141-0/+13
| | | | llvm-svn: 203897
* Now that it is possible, use the mangler in IRObjectFile.Rafael Espindola2014-02-281-0/+8
| | | | | | A really simple patch marks the end of a lot of yak shaving :-) llvm-svn: 202463
* Add a SymbolicFile interface between Binary and ObjectFile.Rafael Espindola2014-02-211-0/+34
| | | | | | | | | | | This interface allows IRObjectFile to be implemented without having dummy methods for all section and segment related methods. Both llvm-ar and llvm-nm are changed to use it. Unfortunately the mangler is still not plugged in since it requires some refactoring to make a Module hold a DataLayout. llvm-svn: 201881
* Add a test for printing absolute symbols in ELF.Rafael Espindola2014-02-052-0/+5
| | | | llvm-svn: 200818
* Small fix for llvm-nm handling of weak symbols on ELF (print 'v').Rafael Espindola2014-02-042-0/+6
| | | | llvm-svn: 200808
* Add a test for common symbols in coff.Rafael Espindola2014-02-042-0/+11
| | | | llvm-svn: 200803
* Mark the first dynamic elf symbol as SF_FormatSpecific.Rafael Espindola2014-01-311-0/+2
| | | | llvm-svn: 200578
* Only ELF has a dynamic symbol table. Remove it from ObjectFile.Rafael Espindola2014-01-301-2/+11
| | | | | | | | | COFF has only one symbol table. MachO has a LC_DYSYMTAB, but that is not a symbol table, just extra info about the one symbol table (LC_SYMTAB). IR (coming soon) also has only one table. llvm-svn: 200488
* This has been fixed.Rafael Espindola2014-01-301-3/+0
| | | | llvm-svn: 200487
* Fix TLS handling in ELF's getAddress and llvm-nm to print 'D' for it.Rafael Espindola2014-01-301-2/+2
| | | | llvm-svn: 200433
* We do use pipefail these days. Update the test.Rafael Espindola2014-01-291-4/+2
| | | | llvm-svn: 200370
* Fix "llvm-objdump -d -r" to show relocations inline for ELF filesMark Seaborn2014-01-251-0/+35
| | | | | | | | | | | | | | | | | | | This fixes a regression introduced by r182908, which broke llvm-objdump's ability to display relocations inline in a disassembly dump for ELF object files. That change removed a SectionRelocMap from Object/ELF.h, which we recreate in llvm-objdump.cpp. I discovered this regression via an out-of-tree test (test/NaCl/X86/pnacl-hides-sandbox-x86-64.ll) which used llvm-objdump. Note that the "Unknown" string in the test output on i386 isn't quite right, but this appears to be a pre-existing bug. Differential Revision: http://llvm-reviews.chandlerc.com/D2559 llvm-svn: 200090
* [Object][ELF][Mips] Print symbol name for MIPS ELF relocations.Simon Atanasyan2014-01-232-1/+11
| | | | llvm-svn: 199898
* Fix typo: : not ;Bill Wendling2014-01-161-1/+1
| | | | llvm-svn: 199359
* Make sure we create a new archive by deleting any stale ones first.Rafael Espindola2014-01-151-0/+1
| | | | llvm-svn: 199319
* Correct word hyphenationsAlp Toker2013-12-051-1/+1
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. llvm-svn: 196471
* llvm-ar: Let opening a directory failed in llvm-ar.NAKAMURA Takumi2013-11-081-3/+0
| | | | | | | Linux cannot open directories with open(2), although cygwin and *bsd can. Motivation: The test, Object/directory.ll, had been failing with --target=cygwin on Linux. XFAIL was improper for host issues. llvm-svn: 194257
* Fix llvm-nm to mach OS X's nm on some tests.Rafael Espindola2013-11-023-4/+7
| | | | | | | 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
* Create an atom with just the data that failed to disassemble.Rafael Espindola2013-10-161-2/+12
| | | | | | Patch by Stephen Checkoway. llvm-svn: 192827
* [Mips] Teach llvm-readobj to print MIPS-specific ELF program headers.Simon Atanasyan2013-10-071-0/+0
| | | | | | | The patch reviewed by Michael Spencer. http://llvm-reviews.chandlerc.com/D1846 llvm-svn: 192093
* Add a minimal implementation of ranlib.Rafael Espindola2013-08-281-0/+9
| | | | | | | | | | | | This is just enough to get "llvm-ranlib foo.a" working and tested. Making llvm-ranlib a symbolic link to llvm-ar doesn't work so well with llvm's option parsing, but ar's option parsing is mostly custom anyway. This patch also removes the -X32_64 option. Looks like it was just added in r10297 as part of implementing the current command line parsing. I can add it back (with a test) if someone really has AIX portability problems without it. llvm-svn: 189489
OpenPOWER on IntegriCloud