aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Object/nm-trivial-object.test
AgeCommit message (Collapse)AuthorFilesLines
2015-05-22Fix llvm-nm -S option.Rafael Espindola1-16/+23
It is explicitly documented to have no effect on object formats where symbols don't have sizes. llvm-svn: 238019
2015-05-22Make this test stricter. NFC.Rafael Espindola1-8/+16
llvm-svn: 238018
2015-03-02lit: Add 'cd' support to the internal shell and port some testsReid Kleckner1-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
2014-11-06Object, COFF: Infer symbol sizes from adjacent symbolsDavid Majnemer1-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
2014-10-31Object, COFF: Cleanup symbol type code, improve binutils compatibilityDavid Majnemer1-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
2014-10-08Correctly compute the size of common symbols in COFF.Rafael Espindola1-1/+1
llvm-svn: 219324
2014-10-08Print symbol sizes in this test in preparation for fixing COFF common sizes.Rafael Espindola1-7/+7
llvm-svn: 219320
2014-07-28Tweak llvm-nm’s -undefined-only (aka -u) printing for Mach-O filesKevin Enderby1-0/+10
to just print the symbol name. So it matches darwin’s nm(1) -u option. llvm-svn: 214143
2014-07-24Add an implementation for llvm-nm’s -print-file-name option (aka -o and -A).Kevin Enderby1-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
2014-07-17Add printing of Mach-O stabs in llvm-nm.Kevin Enderby1-0/+15
llvm-svn: 213327
2014-07-16Add the "-x" flag to llvm-nm for Mach-O files that prints the fields of a ↵Kevin Enderby1-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
2014-07-11Add the "-s" flag to llvm-nm for Mach-O files that prints symbols only inKevin Enderby1-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
2014-07-03Add the -just-symbol-name (aka -j) flag to llvm-nm to just print theKevin Enderby1-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
2014-07-03Add the -U flag to llvm-nm as an alias to -defined-onlyKevin Enderby1-0/+6
as darwin’s nm(1) uses -U for this functionality. llvm-svn: 212280
2014-07-02Add the -reverse-sort flag (aka -r) to llvm-nmKevin Enderby1-0/+8
which exists in other Unix nm(1)’s. llvm-svn: 212235
2014-06-23nm-trivial-object.test requires shell since Lit internal runner isn't ↵NAKAMURA Takumi1-0/+1
capable of chdir. llvm-svn: 211537
2014-06-23Change the default input for llvm-nm to be a.out instead of standard inputKevin Enderby1-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
2014-06-19Fix the output of llvm-nm for Mach-O files to use the characters ‘d’ and ↵Kevin Enderby1-0/+7
‘b’ for data and bss symbols instead of the generic ’s’ for a symbol in a section. llvm-svn: 211321
2014-05-20Update MachOObjectFile::getSymbolAddress so it returns UnknownAddressOrSizeKevin Enderby1-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
2014-05-20Revert r209235 as it broke two tests:Kevin Enderby1-4/+4
Failing Tests (2): LLVM :: ExecutionEngine/MCJIT/stubs-sm-pic.ll LLVM :: ExecutionEngine/MCJIT/stubs.ll llvm-svn: 209236
2014-05-20Update MachOObjectFile::getSymbolAddress so it returns UnknownAddressOrSizeKevin Enderby1-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
2014-05-09Fix llvm-nm to print the full 64-bit address for symbols in 64-bit object files.Kevin Enderby1-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
2014-04-03Only clear the thumb bit from function addresses.Rafael Espindola1-0/+8
llvm-svn: 205500
2014-04-03Revert "Fix a nomenclature error in llvm-nm."Rafael Espindola1-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
2014-02-05Add a test for printing absolute symbols in ELF.Rafael Espindola1-0/+5
llvm-svn: 200818
2014-02-04Small fix for llvm-nm handling of weak symbols on ELF (print 'v').Rafael Espindola1-0/+6
llvm-svn: 200808
2014-02-04Add a test for common symbols in coff.Rafael Espindola1-0/+11
llvm-svn: 200803
2013-11-02Fix llvm-nm to mach OS X's nm on some tests.Rafael Espindola1-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
2013-07-22Mark ELF's first symbol as format specific so that llvm-nm ignores it.Rafael Espindola1-0/+1
llvm-svn: 186860
2013-04-26Add missing ':'.Rafael Espindola1-1/+1
llvm-svn: 180616
2012-08-02Move test yaml files under Inputs until they are converted to be the actualMatt Beaumont-Gay1-2/+4
test files. llvm-svn: 161219
2012-08-02Add yaml2obj. A utility to convert YAML to binaries.Michael J. Spencer1-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
2011-11-29Fixed ObjectFile functions:Danil Malyshev1-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
2011-10-31Change the actual tests to match the input directory rename (duh)Matt Beaumont-Gay1-4/+4
llvm-svn: 143404
2011-09-27Unbreak tests.Michael J. Spencer1-0/+19
llvm-svn: 140622
2011-01-21Revert "Object: Renable the tests now that none of the build bots complain ↵Michael J. Spencer1-19/+0
about aliasing." This reverts commit 281f3901b7b0869929caf8946c1ad1228bc38922. llvm-svn: 123972
2011-01-21Object: Renable the tests now that none of the build bots complain about ↵Michael J. Spencer1-0/+19
aliasing. llvm-svn: 123964
2011-01-20Disable this test until I can figure out why it's broken. Not xfailed because itMichael J. Spencer1-19/+0
usese 100% CPU and times out, so it's annoying to run it. llvm-svn: 123915
2011-01-20Object: Add some tests!Michael J. Spencer1-0/+19
llvm-svn: 123899