summaryrefslogtreecommitdiff
path: root/test/Object
Commit message (Collapse)AuthorAge
* Add a SymbolicFile interface between Binary and ObjectFile.Rafael Espindola2014-02-21
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201881 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test for printing absolute symbols in ELF.Rafael Espindola2014-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200818 91177308-0d34-0410-b5e6-96231b3b80d8
* Small fix for llvm-nm handling of weak symbols on ELF (print 'v').Rafael Espindola2014-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200808 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test for common symbols in coff.Rafael Espindola2014-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200803 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark the first dynamic elf symbol as SF_FormatSpecific.Rafael Espindola2014-01-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200578 91177308-0d34-0410-b5e6-96231b3b80d8
* Only ELF has a dynamic symbol table. Remove it from ObjectFile.Rafael Espindola2014-01-30
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200488 91177308-0d34-0410-b5e6-96231b3b80d8
* This has been fixed.Rafael Espindola2014-01-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200487 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix TLS handling in ELF's getAddress and llvm-nm to print 'D' for it.Rafael Espindola2014-01-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200433 91177308-0d34-0410-b5e6-96231b3b80d8
* We do use pipefail these days. Update the test.Rafael Espindola2014-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200370 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix "llvm-objdump -d -r" to show relocations inline for ELF filesMark Seaborn2014-01-25
| | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200090 91177308-0d34-0410-b5e6-96231b3b80d8
* [Object][ELF][Mips] Print symbol name for MIPS ELF relocations.Simon Atanasyan2014-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199898 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo: : not ;Bill Wendling2014-01-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199359 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure we create a new archive by deleting any stale ones first.Rafael Espindola2014-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199319 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct word hyphenationsAlp Toker2013-12-05
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196471 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-ar: Let opening a directory failed in llvm-ar.NAKAMURA Takumi2013-11-08
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194257 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix llvm-nm to mach OS X's nm on some tests.Rafael Espindola2013-11-02
| | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193912 91177308-0d34-0410-b5e6-96231b3b80d8
* Create an atom with just the data that failed to disassemble.Rafael Espindola2013-10-16
| | | | | | Patch by Stephen Checkoway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192827 91177308-0d34-0410-b5e6-96231b3b80d8
* [Mips] Teach llvm-readobj to print MIPS-specific ELF program headers.Simon Atanasyan2013-10-07
| | | | | | | The patch reviewed by Michael Spencer. http://llvm-reviews.chandlerc.com/D1846 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192093 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a minimal implementation of ranlib.Rafael Espindola2013-08-28
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189489 91177308-0d34-0410-b5e6-96231b3b80d8
* MC CFG: Remap enough for data too, analoguous to r188873.Ahmed Bougacha2013-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188925 91177308-0d34-0410-b5e6-96231b3b80d8
* Add testcase for r188873: MCTextAtom boundaries.Ahmed Bougacha2013-08-21
| | | | | | | Check that they are correctly computed if the last instruction is larger than 1 byte. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188923 91177308-0d34-0410-b5e6-96231b3b80d8
* Add basic YAML MC CFG testcase.Ahmed Bougacha2013-08-21
| | | | | | Drive-by llvm-objdump cleanup (don't hardcode ToolName). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188904 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: ObjectSymbolizer can now recognize external function stubs.Ahmed Bougacha2013-08-21
| | | | | | | Only implemented in the Mach-O ObjectSymbolizer. The testcase sadly introduces a new binary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188879 91177308-0d34-0410-b5e6-96231b3b80d8
* [tests] Cleanup initialization of test suffixes.Daniel Dunbar2013-08-16
| | | | | | | | | | | | | | | | | - Instead of setting the suffixes in a bunch of places, just set one master list in the top-level config. We now only modify the suffix list in a few suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py). - Aside from removing the need for a bunch of lit.local.cfg files, this enables 4 tests that were inadvertently being skipped (one in Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been XFAILED). - This commit also fixes a bunch of config files to use config.root instead of older copy-pasted code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188513 91177308-0d34-0410-b5e6-96231b3b80d8
* [Object] Split the ELF interface into 3 parts.Michael J. Spencer2013-08-08
| | | | | | | | * ELFTypes.h contains template magic for defining types based on endianess, size, and alignment. * ELFFile.h defines the ELFFile class which provides low level ELF specific access. * ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188022 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the 's' operation to llvm-ar.Rafael Espindola2013-07-29
| | | | | | | | | | | | If no other operation is specified, 's' becomes an operation instead of an modifier. The s operation just creates a symbol table. It is the same as running ranlib. We assume the archive was created by a sane ar (like llvm-ar or gnu ar) and if the symbol table is present, then it is current. We use that to optimize the most common case: a broken build system that thinks it has to run ranlib. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187353 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an initial implementation of archive symbol table generation.Rafael Espindola2013-07-23
| | | | | | | | | | | The symbol table has forward references in the file. Instead of allocating a temporary buffer or counting the size and then writing, this implementation writes a dummy value first and patches it once the final value is known. There is room for performance improvement. I will implement them as soon as I get some other features (like a ranlib mode) in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186934 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark ELF's first symbol as format specific so that llvm-nm ignores it.Rafael Espindola2013-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186860 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace archive members in the old position.Rafael Espindola2013-07-22
| | | | | | | | | | | | This matches gnu archive behavior and since archive member order can change which member is used, not changing the order on replacement looks like the right thing to do. This patch also refactors the logic for which archive member to keep and whether to move it to a helper function (computeInsertAction). The nesting in computeNewArchiveMembers was getting a bit confusing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186829 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't depend on a llvm-ar specific behavior.Rafael Espindola2013-07-22
| | | | | | | | GNU ar when not given the a or b modifiers replaces archive members in the same location of the old ones. I am about to implement that in llvm-ar. For now, just don't depend on the current llvm-ar behavior on this test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186823 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle replacement into a position past the original member.Rafael Espindola2013-07-21
| | | | | | | We were incorrectly computing where to insert a member if it was replacing a previous member that was before the insert point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186792 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix inserting new elements in a specified location.Rafael Espindola2013-07-19
| | | | | | We were only handling the 'a' and 'b' options during moves before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186721 91177308-0d34-0410-b5e6-96231b3b80d8
* Split openFileForWrite into windows and unix versions.Rafael Espindola2013-07-19
| | | | | | It is similar to 186511, but for creating files for writing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186679 91177308-0d34-0410-b5e6-96231b3b80d8
* Split openFileForRead into Windows and Unix versions.Rafael Espindola2013-07-17
| | | | | | | | | | | This has some advantages: * Lets us use native, utf16 windows functions. * Easy to produce good errors on windows about trying to use a directory when we want a file. * Simplifies the unix version a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186511 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_ostream.cpp: Introduce <fcntl.h> to let O_BINARY provided. Or, ↵NAKAMURA Takumi2013-07-17
| | | | | | | | llvm::outs() would be set to O_TEXT by default. llvm/test/Object/check_binary_output.ll is expected to pass on win32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186480 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/test/Object/ar-create.test: Relax a CHECK line to satisfy localized ↵NAKAMURA Takumi2013-07-16
| | | | | | | | message catalogue. For example, 'No such file or directory' cannot be seen on Japanese version of msvcrt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186469 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/test/Object/check_binary_output.ll: Mark it as XFAIL on Windows. ↵NAKAMURA Takumi2013-07-16
| | | | | | Investigating. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186468 91177308-0d34-0410-b5e6-96231b3b80d8
* On error, close the temporary file descriptor.Rafael Espindola2013-07-16
| | | | | | With this change llvm-ar can remove the temporary file on windows too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186423 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm/test/Object/directory.ll: Mark it as XFAIL:cygwin. Directories can be ↵NAKAMURA Takumi2013-07-16
| | | | | | opened on cygwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186387 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix TimeValue::toWin32Time() to be symmetric to fromWin32Time() and ↵NAKAMURA Takumi2013-07-16
| | | | | | | | | | | compatible to Win32's FILETIME. llvm-ar is the only user of toWin32Time() (via setLastModificationAndAccessTime), and r186298 can be reverted. It had been buggy since the initial commit. FIXME: Could we rename {from|to}Win32Time as {from|to}Win32FILETIME in TimeValue? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186374 91177308-0d34-0410-b5e6-96231b3b80d8
* Add mingw32 to the XFAIL. I forgot about it when adding win32.Rafael Espindola2013-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186365 91177308-0d34-0410-b5e6-96231b3b80d8
* XFAIL on windows too and document the XFAILs.Rafael Espindola2013-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186354 91177308-0d34-0410-b5e6-96231b3b80d8
* XFAIL this on freebsd to bring the bot back.Rafael Espindola2013-07-15
| | | | | | | | Joerg Sonnenberger tells me one can open a directory in freebsd. I will try to centralize our calls to open so that we can handle O_BINARY in one place, and will then handle this there too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186317 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark llvm/test/Object/extract.ll as XFAIL:mingw32, for now.NAKAMURA Takumi2013-07-15
| | | | | | FIXME: Investigate Win32's TimeValue stuff! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186298 91177308-0d34-0410-b5e6-96231b3b80d8
* The archive update test has a subtle race condition in it: if the testChandler Carruth2013-07-14
| | | | | | | | | | | | | | | | | | is executed within the same second as the inputs for the test are checked out from the source tree, it will fail to update due to being below the resolution of the 'mtime' test used. Now, this may seem improbably to you... ok, maybe *really* improbable, but consider a system which does distributed execution of tests by shipping their inputs to another machine and runs them. That might cause the mtime to be quite recent during the test run. ;] Instead, create two files directly in the test (allowing all platforms to see the problem) and add either a use of the 'touch' command that forces one mtime to some time quite a bit in the past, or it sleeps for just over a second to be outside of the precision window. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186282 91177308-0d34-0410-b5e6-96231b3b80d8
* Only verify the length in archive test, we can't make assumptions on the ↵Benjamin Kramer2013-07-13
| | | | | | | | spacing. And .* did just match about anything anyways. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186246 91177308-0d34-0410-b5e6-96231b3b80d8
* Add r186216 back, but make the test tolerant of different uids and gids.Rafael Espindola2013-07-13
| | | | | | | original message: Fix a off by one error about which members need to use the string table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186238 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert commit r186216 -- it's breaking bots:Chandler Carruth2013-07-13
| | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/6897/steps/check-all/logs/LLVM%3A%3Aarchive-format.test Original commit log: Fix a off by one error about which members need to use the string table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186232 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a off by one error about which members need to use the string table.Rafael Espindola2013-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186216 91177308-0d34-0410-b5e6-96231b3b80d8
* Change archive-update.test to create a new file on the fly.Rafael Espindola2013-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186206 91177308-0d34-0410-b5e6-96231b3b80d8