summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
Commit message (Collapse)AuthorAgeFilesLines
...
* Reduce verbiage of lit.local.cfg filesAlp Toker2014-06-093-6/+3
| | | | | | We can just split targets_to_build in one place and make it immutable. llvm-svn: 210496
* [yaml2obj][obj2yaml] Support ELF symbol's visibility flags ↵Simon Atanasyan2014-06-061-0/+126
| | | | | | (default/hidden/protected). llvm-svn: 210316
* Add "-format darwin" to llvm-nm to be like darwin's nm(1) -m output.Kevin Enderby2014-06-054-0/+53
| | | | | | | | | | | | | | | This is a first step in seeing if it is possible to make llvm-nm produce the same output as darwin's nm(1). Darwin's default format is bsd but its -m output prints the longer Mach-O specific details. For now I added the "-format darwin" to do this (whos name may need to change in the future). As there are other Mach-O specific flags to nm(1) which I'm hoping to add some how in the future. But I wanted to see if I could get the correct output for -m flag using llvm-nm and the libObject interfaces. I got this working but would love to hear what others think about this approach to getting object/format specific details printed with llvm-nm. llvm-svn: 210285
* [yaml2obj] Add new command line option `-docnum`.Simon Atanasyan2014-05-312-0/+147
| | | | | | | | | | Input YAML file might contain multiple object file definitions. New option `-docnum` allows to specify an ordinal number (starting from 1) of definition used for an object file generation. Patch reviewed by Sean Silva. llvm-svn: 209967
* [elf2yaml][ELF] Move Info field to the RelocationSection structure. ThisSimon Atanasyan2014-05-291-3/+3
| | | | | | | field represents ELF section header sh_info field and does not have any sense for regular sections. Its interpretation depends on section type. llvm-svn: 209801
* llvm/test/Object/ar-error.test: Don't check the message "No such file or ↵NAKAMURA Takumi2014-05-241-1/+2
| | | | | | | | directory". It didn't match on non-English version of Windows. llvm-svn: 209570
* [YAML] Add an optional argument `EnumMask` to the `yaml::IO::bitSetCase()`.Simon Atanasyan2014-05-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some bit-set fields used in ELF file headers in fact contain two parts. The first one is a regular bit-field. The second one is an enumeraion. For example ELF header `e_flags` for MIPS target might contain the following values: Bit-set values: EF_MIPS_NOREORDER = 0x00000001 EF_MIPS_PIC = 0x00000002 EF_MIPS_CPIC = 0x00000004 EF_MIPS_ABI2 = 0x00000020 Enumeration: EF_MIPS_ARCH_32 = 0x50000000 EF_MIPS_ARCH_64 = 0x60000000 EF_MIPS_ARCH_32R2 = 0x70000000 EF_MIPS_ARCH_64R2 = 0x80000000 For printing bit-sets we use the `yaml::IO::bitSetCase()`. It does not support bit-set/enumeration combinations and prints too many flags from an enumeration part. This patch fixes this problem. New method `yaml::IO::maskedBitSetCase()` handle "enumeration" part of bitset defined by provided mask. Patch reviewed by Nick Kledzik and Sean Silva. llvm-svn: 209504
* llvm-ar: Output the file we errored on.Filipe Cabecinhas2014-05-231-0/+5
| | | | llvm-svn: 209500
* Update MachOObjectFile::getSymbolAddress so it returns UnknownAddressOrSizeKevin Enderby2014-05-202-5/+5
| | | | | | | | | | | | for undefined symbols, so it matches what COFFObjectFile::getSymbolAddress does. This allows llvm-nm to print spaces instead of 0’s for the value of undefined symbols in Mach-O files. To make this change other uses of MachOObjectFile::getSymbolAddress are updated to handle when the Value is returned as UnknownAddressOrSize. Which is needed to keep two of the ExecutionEngine tests working for example. llvm-svn: 209253
* Revert r209235 as it broke two tests:Kevin Enderby2014-05-202-5/+5
| | | | | | | | Failing Tests (2): LLVM :: ExecutionEngine/MCJIT/stubs-sm-pic.ll LLVM :: ExecutionEngine/MCJIT/stubs.ll llvm-svn: 209236
* 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
OpenPOWER on IntegriCloud