summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object/nm-trivial-object.test
Commit message (Collapse)AuthorAgeFilesLines
* Fix test case of llvm-nm using implicit a.outAlex Brachet2019-07-121-1/+1
| | | | llvm-svn: 365892
* [test/Object/nm-trivial-object.test] - Remove 4 precompiled binaries.George Rimar2019-07-101-55/+145
| | | | | | | | | This converts 5 precompiled binaries to YAMLs, removes 4 from inputs and performs a cleanup. Differential revision: https://reviews.llvm.org/D64246 llvm-svn: 365601
* [llvm\test\Object] - An initial step to cleanup the test cases.George Rimar2019-07-081-215/+275
| | | | | | | | | | | | This patch removes trivial-object-test.elf-i386, trivial-object-test.elf-x86-64 and trivial-object-test2.elf-x86-64 precompiled objects from test/Object/Inputs folder. I adjusted the existent test cases to use YAML instead. Differential revision: https://reviews.llvm.org/D64206 llvm-svn: 365348
* [llvm-nm] Report '.comment' ELF sections as 'n' instead of '?'Matt Davis2019-02-011-14/+15
| | | | | | | | | | | | | | | | | | | Summary: The previous implementation reported `.comment` sections as '?' GNU uses 'n' which means "The symbol is a debugging symbol." `.note` sections are represented as 'n' too. The test related to this change was updated to CHECK-NEXT to ensure order and that we did not miss any symbols in the dump. Reviewers: jhenderson Reviewed By: jhenderson Subscribers: rupprecht, llvm-commits Differential Revision: https://reviews.llvm.org/D57544 llvm-svn: 352891
* [ELF] Return the section name when calling getSymbolName on a section symbol.Matt Davis2019-01-311-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, llvm-nm would report symbols for .debug and .note sections as: '?' with an empty section name: ``` 00000000 ? 00000000 ? ... ``` With this patch the output more closely resembles GNU nm: ``` 00000000 N .debug_abbrev 00000000 n .note.GNU-stack ... ``` This patch calls `getSectionName` for sections that belong to symbols of type `ELF::STT_SECTION`, which returns the name of the section from the section string table. Reviewers: Bigcheese, davide, jhenderson Reviewed By: davide, jhenderson Subscribers: rupprecht, jhenderson, llvm-commits Differential Revision: https://reviews.llvm.org/D57105 llvm-svn: 352785
* [WebAssembly] Fixing 2 more symbol offset related tests.Wouter van Oortmerssen2019-01-171-6/+6
| | | | llvm-svn: 351465
* [WebAssembly] Update test cases after FixFunctionBitcastsHeejin Ahn2018-11-071-0/+1
| | | | | | | | | | | | | | Summary: This updates generated binaries and corresponding test cases up to date after applying FixFunctionBitcasts pass. Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D54070 llvm-svn: 346286
* [WebAssembly] Add first claass symbol table to wasm objectsSam Clegg2018-02-231-1/+4
| | | | | | | | | | | | | | | | | | | | This is combination of two patches by Nicholas Wilson: 1. https://reviews.llvm.org/D41954 2. https://reviews.llvm.org/D42495 Along with a few local modifications: - One change I made was to add the UNDEFINED bit to the binary format to avoid the extra byte used when writing data symbols. Although this bit is redundant for other symbols types (i.e. undefined can be implied if a function or global is a wasm import) - I prefer to be explicit and consistent and not have derived flags. - Some field renaming. - Some reverting of unrelated minor changes. - No test output differences. Differential Revision: https://reviews.llvm.org/D43147 llvm-svn: 325860
* [WebAssembly] Fix getSymbolValue() for data symbolsSam Clegg2017-08-311-1/+1
| | | | | | | | | | This is mostly a fix for the output of `llvm-nm` See Bug 34392: https://bugs.llvm.org//show_bug.cgi?id=34392 Differential Revision: https://reviews.llvm.org/D37359 llvm-svn: 312294
* [WebAssembly] Be consistent in generating trivial test input filesSam Clegg2017-07-101-0/+7
| | | | | | | | | | | | | For each checked-in wasm file, make sure the there is corresponding .ll file that can be used to regenerate it if needed. Add test/Object/Inputs/trivial-object-test.wasm to match other formats and add some new wasm tests in test/Object. Differential Revision: https://reviews.llvm.org/D35213 llvm-svn: 307585
* llvm-nm: Don't print value or size for undefined or weak symbolsMeador Inge2016-11-231-3/+2
| | | | | | | | | | | | | | | | | Undefined and weak symbols don't have a meaningful size or value. As such, nothing should be printed for those attributes (this is already done for the address with 'U') with the BSD format. This matches what GNU nm does. Note that for the POSIX.2 format [1] zero values are still printed for the size and value. This seems in spirit with the format strings in that specification, but is debatable. [1] http://pubs.opengroup.org/onlinepubs/9699919799/ Differential Revision: https://reviews.llvm.org/D26936 llvm-svn: 287802
* Fix llvm-nm -S option.Rafael Espindola2015-05-221-16/+23
| | | | | | | It is explicitly documented to have no effect on object formats where symbols don't have sizes. llvm-svn: 238019
* Make this test stricter. NFC.Rafael Espindola2015-05-221-8/+16
| | | | llvm-svn: 238018
* lit: Add 'cd' support to the internal shell and port some testsReid Kleckner2015-03-021-1/+0
| | | | | | | | | | | The internal shell was already threading around a 'cwd' parameter. We just have to make it mutable so that we can update it as the test script executes. If the shell ever grows support for environment variable substitution, we could also implement support for export. llvm-svn: 231017
* Object, COFF: Infer symbol sizes from adjacent symbolsDavid Majnemer2014-11-061-6/+6
| | | | | | | | | Use the position of the subsequent symbol in the object file to infer the size of it's predecessor. I hope to eventually remove whatever COFF specific details from this little algorithm so that we can unify this logic with what Mach-O does. llvm-svn: 221444
* Object, COFF: Cleanup symbol type code, improve binutils compatibilityDavid Majnemer2014-10-311-3/+3
| | | | | | | Do a better job classifying symbols. This increases the consistency between the COFF handling code and the ELF side of things. llvm-svn: 220952
* Correctly compute the size of common symbols in COFF.Rafael Espindola2014-10-081-1/+1
| | | | llvm-svn: 219324
* Print symbol sizes in this test in preparation for fixing COFF common sizes.Rafael Espindola2014-10-081-7/+7
| | | | llvm-svn: 219320
* Tweak llvm-nm’s -undefined-only (aka -u) printing for Mach-O filesKevin Enderby2014-07-281-0/+10
| | | | | | to just print the symbol name. So it matches darwin’s nm(1) -u option. llvm-svn: 214143
* Add an implementation for llvm-nm’s -print-file-name option (aka -o and -A).Kevin Enderby2014-07-241-0/+15
| | | | | | | | The -print-file-name option in llvm-nm is to precede each symbol with the object file it came from. While code for the parsing of this option and its aliases existed there was no code to implement it. llvm-svn: 213906
* Add printing of Mach-O stabs in llvm-nm.Kevin Enderby2014-07-171-0/+15
| | | | llvm-svn: 213327
* Add the "-x" flag to llvm-nm for Mach-O files that prints the fields of a ↵Kevin Enderby2014-07-161-0/+8
| | | | | | | | | symbol in hex. (generally use for debugging the tools).  This is same functionality as darwin’s nm(1) "-x" flag. llvm-svn: 213176
* Add the "-s" flag to llvm-nm for Mach-O files that prints symbols only inKevin Enderby2014-07-111-0/+8
| | | | | | | | | | | | | the specified section. This is same functionality as darwin’s nm(1) "-s" flag. There is one FIXME in the code and I’m all ears to anyone that can help me with that. This option takes exactly two strings and should be allowed anywhere on the command line. Such that "llvm-nm -s __TEXT __text foo.o" would work. But that does not as the CommandLine Library does not have a way to make this work as far as I can tell. For now the "-s __TEXT __text" has to be last on the command line. llvm-svn: 212842
* Add the -just-symbol-name (aka -j) flag to llvm-nm to just print theKevin Enderby2014-07-031-0/+8
| | | | | | | | symbol’s name. On darwin the -j flag is used (often in combinations with other flags) to produce a complete list of symbol names which than can then be reorder and used with ld(1)’s -order_file. llvm-svn: 212294
* Add the -U flag to llvm-nm as an alias to -defined-onlyKevin Enderby2014-07-031-0/+6
| | | | | | as darwin’s nm(1) uses -U for this functionality. llvm-svn: 212280
* Add the -reverse-sort flag (aka -r) to llvm-nmKevin Enderby2014-07-021-0/+8
| | | | | | which exists in other Unix nm(1)’s. llvm-svn: 212235
* nm-trivial-object.test requires shell since Lit internal runner isn't ↵NAKAMURA Takumi2014-06-231-0/+1
| | | | | | capable of chdir. llvm-svn: 211537
* Change the default input for llvm-nm to be a.out instead of standard inputKevin Enderby2014-06-231-2/+10
| | | | | | | | | to match llvm-size and other UNIX systems for their nm(1). Tweak test cases that used llvm-nm with standard input to add a "-" to indicate that and add a test case to check the default of a.out for llvm-nm. llvm-svn: 211529
* Fix the output of llvm-nm for Mach-O files to use the characters ‘d’ and ↵Kevin Enderby2014-06-191-0/+7
| | | | | | | | ‘b’ for data and bss symbols instead of the generic ’s’ for a symbol in a section. llvm-svn: 211321
* Update MachOObjectFile::getSymbolAddress so it returns UnknownAddressOrSizeKevin Enderby2014-05-201-4/+4
| | | | | | | | | | | | 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-201-4/+4
| | | | | | | | 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-201-4/+4
| | | | | | | 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
* Fix llvm-nm to print the full 64-bit address for symbols in 64-bit object files.Kevin Enderby2014-05-091-19/+23
| | | | | | | | | | | | | | 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
* Only clear the thumb bit from function addresses.Rafael Espindola2014-04-031-0/+8
| | | | llvm-svn: 205500
* Revert "Fix a nomenclature error in llvm-nm."Rafael Espindola2014-04-031-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
* Add a test for printing absolute symbols in ELF.Rafael Espindola2014-02-051-0/+5
| | | | llvm-svn: 200818
* Small fix for llvm-nm handling of weak symbols on ELF (print 'v').Rafael Espindola2014-02-041-0/+6
| | | | llvm-svn: 200808
* Add a test for common symbols in coff.Rafael Espindola2014-02-041-0/+11
| | | | llvm-svn: 200803
* Fix llvm-nm to mach OS X's nm on some tests.Rafael Espindola2013-11-021-4/+4
| | | | | | | 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
* Mark ELF's first symbol as format specific so that llvm-nm ignores it.Rafael Espindola2013-07-221-0/+1
| | | | llvm-svn: 186860
* Add missing ':'.Rafael Espindola2013-04-261-1/+1
| | | | llvm-svn: 180616
* Move test yaml files under Inputs until they are converted to be the actualMatt Beaumont-Gay2012-08-021-2/+4
| | | | | | test files. llvm-svn: 161219
* Add yaml2obj. A utility to convert YAML to binaries.Michael J. Spencer2012-08-021-5/+3
| | | | | | | | yaml2obj takes a textual description of an object file in YAML format and outputs the binary equivalent. This greatly simplifies writing tests that take binary object files as input. llvm-svn: 161205
* Fixed ObjectFile functions:Danil Malyshev2011-11-291-0/+14
| | | | | | | | | | | - getSymbolOffset() renamed as getSymbolFileOffset() - getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile. - added getRelocationOffset() - fixed MachOObjectFile::getSymbolSize() - fixed MachOObjectFile::getSymbolSection() - fixed MachOObjectFile::getSymbolOffset() for symbols without section data. llvm-svn: 145408
* Change the actual tests to match the input directory rename (duh)Matt Beaumont-Gay2011-10-311-4/+4
| | | | llvm-svn: 143404
* Unbreak tests.Michael J. Spencer2011-09-271-0/+19
| | | | llvm-svn: 140622
* Revert "Object: Renable the tests now that none of the build bots complain ↵Michael J. Spencer2011-01-211-19/+0
| | | | | | | | about aliasing." This reverts commit 281f3901b7b0869929caf8946c1ad1228bc38922. llvm-svn: 123972
* Object: Renable the tests now that none of the build bots complain about ↵Michael J. Spencer2011-01-211-0/+19
| | | | | | aliasing. llvm-svn: 123964
* Disable this test until I can figure out why it's broken. Not xfailed because itMichael J. Spencer2011-01-201-19/+0
| | | | | | usese 100% CPU and times out, so it's annoying to run it. llvm-svn: 123915
* Object: Add some tests!Michael J. Spencer2011-01-201-0/+19
llvm-svn: 123899
OpenPOWER on IntegriCloud