summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
Commit message (Collapse)AuthorAgeFilesLines
...
* Accept lower case to handle windows error messages.Rafael Espindola2015-07-141-1/+1
| | | | llvm-svn: 242236
* Add support for reading members out of thin archives.Rafael Espindola2015-07-141-0/+6
| | | | | | | | | | For now the Archive owns the buffers of the thin archive members. This makes for a simple API, but all the buffers are destructed only when the archive is destructed. This should be fine since we close the files after mmap so we should not hit an open file limit. llvm-svn: 242215
* llvm-ar: Don't try to extract from thin archives.Rafael Espindola2015-07-141-0/+3
| | | | | | This matches the gnu ar behavior. llvm-svn: 242162
* Sleep for 2.1 seconds to see if that makes the test stable on windows.Rafael Espindola2015-07-141-2/+3
| | | | | | Might fix pr24106. llvm-svn: 242158
* llvm-ar: print an error when the requested member is not found.Rafael Espindola2015-07-141-0/+4
| | | | llvm-svn: 242156
* Rename a test. NFC.Rafael Espindola2015-07-141-2/+0
| | | | llvm-svn: 242151
* Add missing file.Rafael Espindola2015-07-131-0/+0
| | | | | | Sorry about that. llvm-svn: 242083
* Fix reading archive members with / in the name.Rafael Espindola2015-07-131-0/+6
| | | | | | This is important for thin archives. llvm-svn: 242082
* Add support deterministic output in llvm-ar and make it the default.Rafael Espindola2015-07-134-20/+20
| | | | llvm-svn: 242061
* [Object][ELF] Handle the dynamic string table in files without a section table.Michael J. Spencer2015-07-101-1/+29
| | | | llvm-svn: 241937
* [Object][ELF] Support dumping hash-tables from files with no section table.Michael J. Spencer2015-07-092-0/+8
| | | | | | This time without breaking the bots. llvm-svn: 241869
* Create BSD archives by default on OS X.Rafael Espindola2015-07-091-1/+1
| | | | | | | | | They should probably be created on anything that is not windows or linux, but I will test on freebsd before changing that. With this it is possible to bootstrap with llvm-ar instead of ar+ranlib on OS X. llvm-svn: 241849
* llvm-ar: Pad the symbol table to 4 bytes.Rafael Espindola2015-07-091-0/+8
| | | | | | | It looks like ld64 requires it. With this we seem to be able to bootstrap using llvm-ar+/usr/bin/true instead of ar+ranlib (currently on stage2). llvm-svn: 241842
* [yaml2obj] Initialize sh_addralign field for the .symtab sectionSimon Atanasyan2015-07-091-0/+3
| | | | llvm-svn: 241835
* [ELF] Explicitly configure sections alignment in the tests. NFCSimon Atanasyan2015-07-092-0/+2
| | | | llvm-svn: 241834
* Add missing file from previous commit.Rafael Espindola2015-07-091-0/+0
| | | | llvm-svn: 241815
* Basic support for BSD symbol tables in archives.Rafael Espindola2015-07-091-0/+21
| | | | | | | This could be optimized and for now we only produce __.SYMDEF and not "__.SYMDEF SORTED". llvm-svn: 241814
* Temporarily reverting 241765, 241768, and 241772 to unbreak the build bots.Adrian Prantl2015-07-092-8/+0
| | | | llvm-svn: 241781
* [Object][ELF] Support dumping hash-tables from files with no section table.Michael J. Spencer2015-07-092-0/+8
| | | | llvm-svn: 241765
* Don't reject an archive with just a symbol table.Rafael Espindola2015-07-082-0/+4
| | | | | | It is pretty unambiguous how to interpret it and gnu ar accepts it too. llvm-svn: 241750
* Start adding support for writing archives in BSD format.Rafael Espindola2015-07-081-0/+10
| | | | | | | | No support for the symbol table yet (but will hopefully add it today). We always use the long filename format so that we can align the member, which is an advantage of the BSD format. llvm-svn: 241721
* [yaml2obj] Align section content using AddressAlign field's valueSimon Atanasyan2015-07-081-0/+53
| | | | | | | | Use AddressAlign field's value to properly align sections content in the yaml2obj tool. Before this change the yaml2obj ignored AddressAlign and always aligned section on 16 bytes boundary. llvm-svn: 241674
* [yaml2obj] Use regex to match sections offsets. NFCSimon Atanasyan2015-07-082-3/+3
| | | | llvm-svn: 241669
* Delete UnknownAddress. It is a perfectly valid symbol value.Rafael Espindola2015-07-071-0/+3
| | | | | | | | | | | getSymbolValue now returns a value that in convenient for most callers: * 0 for undefined * symbol size for common symbols * offset/address for symbols the rest Code that needs something more specific can check getSymbolFlags. llvm-svn: 241605
* Common symbols are not undefined, at least for ObjectFile.Rafael Espindola2015-07-071-0/+9
| | | | | | | | | They are implemented like that in some object formats, but for the interface provided by lib/Object, SF_Undefined and SF_Common are different things. This matches the ELF and COFF implementation and fixes llvm-nm for MachO. llvm-svn: 241587
* llvm-nm: treat weak undefined as undefined.Rafael Espindola2015-07-062-2/+11
| | | | | | This matches the behavior of gnu ld. llvm-svn: 241512
* When sorting by address, undefined symbols go first.Rafael Espindola2015-07-061-16/+17
| | | | | | This matches gnu nm. llvm-svn: 241488
* Fix printing of common symbols.Rafael Espindola2015-07-061-0/+3
| | | | | | Printing the symbol size matches the behavior or both gnu nm and freebsd nm. llvm-svn: 241480
* Check that COFF .obj files have sections with zero virtual address spaces.Rafael Espindola2015-07-062-0/+13
| | | | | | | | | | | | | 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-062-0/+6
| | | | | | Thanks to Aboud, Amjad for reporting the regression and providing the testcase. llvm-svn: 241440
* [ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj toolsSimon Atanasyan2015-07-032-3/+2
| | | | | | | | | | SHT_NOBITS sections do not have content in an object file. Now the yaml2obj tool does not accept `Content` field for such sections, and the obj2yaml tool does not attempt to read the section content from a file. Restore r241350 and r241352. llvm-svn: 241377
* This reverts commit r241350 and r241352.Rafael Espindola2015-07-032-2/+3
| | | | | | | | | | | r241350 broke lld tests. r241352 depends on r241350. Original messages: "[ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools" "[ELFYAML] Make the Size field for .bss section optional" llvm-svn: 241354
* [ELFYAML] Make the Size field for .bss section optionalSimon Atanasyan2015-07-031-1/+0
| | | | | | It's a common case to have a zero-size .bss section in an object file. llvm-svn: 241352
* [ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj toolsSimon Atanasyan2015-07-032-3/+3
| | | | | | | | SHT_NOBITS sections do not have content in an object file. Now yaml2obj tool does not accept `Content` field for such sections, and obj2yaml tool does not attempt to read the section content from a file. llvm-svn: 241350
* Improve error message.Rafael Espindola2015-07-021-1/+1
| | | | | | Thanks to Sean Silva for the suggestion. llvm-svn: 241255
* Return ErrorOr from getSection.Rafael Espindola2015-07-011-1/+1
| | | | | | | | | | | | | | This also improves the logic of what is an error: * getSection(uint_32): only return an error if the index is out of bounds. The index 0 corresponds to a perfectly valid entry. * getSection(Elf_Sym): Returns null for symbols that normally don't have sections and error for out of bound indexes. In many places this just moves the report_fatal_error up the stack, but those can then be fixed in smaller patches. llvm-svn: 241156
* Remove Elf_Shdr_Iter. Diagnose files with invalid section header sizes.Rafael Espindola2015-06-302-0/+3
| | | | llvm-svn: 241109
* Add a test of an elf file with an invalid section index.Rafael Espindola2015-06-302-0/+4
| | | | | | We were already checking, but were missing a test. llvm-svn: 241094
* Report an error on invalid sh_entsize.Rafael Espindola2015-06-302-0/+32
| | | | llvm-svn: 241070
* Factor out the checking of string tables.Rafael Espindola2015-06-292-0/+1
| | | | | | | | | | 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-292-0/+3
| | | | | | We were already checking this, but had no tests. llvm-svn: 240945
* Convert an assert that can fail into error checking.Rafael Espindola2015-06-292-0/+1
| | | | llvm-svn: 240944
* [Stackmap] Pre-assemble the stackmap parser test case. (Fix builders).Lang Hames2015-06-273-52/+1
| | | | | | | | 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-262-0/+67
| | | | | | | | | | 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
* [Object][ELF] Add support for dumping dynamic relocations when sections are ↵Michael J. Spencer2015-06-251-0/+11
| | | | | | stripped. llvm-svn: 240703
* llvm-nm: Don't print mapping symbols.Rafael Espindola2015-06-251-0/+11
| | | | | | This matches the behavior of gnu nm. Fixes pr23930. llvm-svn: 240695
* llvm-nm: print 'n' instead of '?'Rafael Espindola2015-06-251-1/+6
| | | | | | This matches gnu nm and has the advantage that there is a upper case N. llvm-svn: 240655
* Object: Add XFAILed test case for r239560.Peter Collingbourne2015-06-241-0/+14
| | | | | | | We ought to also emit unmangled references to dllimported functions, but no existing linker needs this. llvm-svn: 240562
* Change how symbol sizes are handled in lib/Object.Rafael Espindola2015-06-242-1/+8
| | | | | | | | | | | | | | COFF and MachO only define symbol sizes for common symbols. Reflect that in the class hierarchy by having a method for common symbols only in the base and a general one in ELF. This avoids the need of using a magic value for the size, which had a few problems * Most callers didn't check for it. * The ones that did could not tell the magic value from a file actually having that value. llvm-svn: 240529
* objdump: Don't print a (always 0) size for MachO symbols.Rafael Espindola2015-06-231-3/+3
| | | | | | | | | | | Only common symbol on MachO and COFF have a size. For COFF we already had a custom format. For MachO, there is no native objdump and we were printing it as ELF. Now we only print the sizes for symbols that actually have them. llvm-svn: 240422
OpenPOWER on IntegriCloud