summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-nm/llvm-nm.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Delete getAliasedGlobal.Rafael Espindola2014-05-161-1/+1
| | | | llvm-svn: 209040
* Teach llvm-nm to know about fat archives (aka MachOUniversal filesKevin Enderby2014-05-141-0/+14
| | | | | | containing archives). First step as other tools will be updated next. llvm-svn: 208812
* Suggested improvement by Rafael Espindola to use isa<> in a few placesKevin Enderby2014-05-121-6/+6
| | | | | | instead of dyn_cast<>. llvm-svn: 208628
* Fix llvm-nm to print the full 64-bit address for symbols in 64-bit object files.Kevin Enderby2014-05-091-8/+36
| | | | | | | | | | | | | | 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
* Revert "Fix a nomenclature error in llvm-nm."Rafael Espindola2014-04-031-27/+27
| | | | | | | | | | | | | | | | 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
* Fix a nomenclature error in llvm-nm.Rafael Espindola2014-04-021-27/+27
| | | | | | | | | | | What llvm-nm prints depends on the file format. On ELF for example, if the file is relocatable, it prints offsets. If it is not, it prints addresses. Since it doesn't really need to care what it is that it is printing, use the generic term value. Fix or implement getSymbolValue to keep llvm-nm working. llvm-svn: 205479
* Object: Provide a richer means of describing auxiliary symbolsDavid Majnemer2014-03-191-2/+1
| | | | | | | | | | | | | | | | 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
* Object/COFF: Add function to check if section number is reserved one.Rui Ueyama2014-03-181-3/+2
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D3103 llvm-svn: 204199
* [C++11] Change the interface of getCOFF{Section,Relocation,Symbol} to make ↵Alexey Samsonov2014-03-181-2/+2
| | | | | | | | | | | | | | it work with range-based for loops. Reviewers: ruiu Reviewed By: ruiu CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3097 llvm-svn: 204120
* Object/COFF: change data type of SymbolNumber from int16 to uint16.Rui Ueyama2014-03-151-1/+3
| | | | | | | | | | | | Microsoft PE/COFF Spec clearly states that the field is of signed interger type. However, in reality, it's unsigned. If cl.exe needs to create a large number of sections for COMDAT sections, it will just create more than 32768 sections. Handling large section number as negative number is not correct. I think this is a spec bug. Differential Revision: http://llvm-reviews.chandlerc.com/D3088 llvm-svn: 203986
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-4/+4
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-051-1/+1
| | | | llvm-svn: 202957
* [cleanup] Re-sort all the includes with utils/sort_includes.py.Chandler Carruth2014-03-041-1/+1
| | | | llvm-svn: 202811
* Move getELFDynamicSymbolIterators to a public header.Alexey Samsonov2014-02-261-25/+4
| | | | llvm-svn: 202264
* Add a SymbolicFile interface between Binary and ObjectFile.Rafael Espindola2014-02-211-110/+74
| | | | | | | | | | | 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
* Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola2014-02-101-12/+12
| | | | llvm-svn: 201108
* Use the information provided by getFlags to unify some code in llvm-nm.Rafael Espindola2014-02-051-90/+73
| | | | | | | | | | It is not clear how much we should try to expose in getFlags. For example, should there be a SF_Object and a SF_Text? But for information that is already being exposed, we may as well use it in llvm-nm. llvm-svn: 200820
* Small fix for llvm-nm handling of weak symbols on ELF (print 'v').Rafael Espindola2014-02-041-2/+6
| | | | llvm-svn: 200808
* Move error handling down to getSymbolNMTypeChar.Rafael Espindola2014-02-041-54/+30
| | | | llvm-svn: 200727
* Simplify getSymbolFlags.Rafael Espindola2014-01-311-3/+1
| | | | | | | None of the object formats require extra parsing to compute these flags, so the method cannot fail. llvm-svn: 200574
* This file already has a "using namespace object;", use it.Rafael Espindola2014-01-301-22/+20
| | | | llvm-svn: 200493
* Only ELF has a dynamic symbol table. Remove it from ObjectFile.Rafael Espindola2014-01-301-2/+28
| | | | | | | | | 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
* Use early returns and factor the object::Binary creation.Rafael Espindola2014-01-301-69/+59
| | | | llvm-svn: 200484
* Simplify the handling of iterators in ObjectFile.Rafael Espindola2014-01-301-4/+1
| | | | | | | | | | | | None of the object file formats reported error on iterator increment. In retrospect, that is not too surprising: no object format stores symbols or sections in a linked list or other structure that requires chasing pointers. As a consequence, all error checking can be done on begin() and end(). This reduces the text segment of bin/llvm-readobj in my machine from 521233 to 518526 bytes. llvm-svn: 200442
* Fix TLS handling in ELF's getAddress and llvm-nm to print 'D' for it.Rafael Espindola2014-01-301-0/+1
| | | | llvm-svn: 200433
* Normalize the style in llvm-nm.cpp.Rafael Espindola2014-01-291-298/+308
| | | | | | | It had grown fairly inconsistent. I am about to change it quite a bit to also use the object api when handling IR files. llvm-svn: 200374
* Pass the computed magic to createBinary and createObjectFile if available.Rafael Espindola2014-01-221-3/+3
| | | | | | | identify_magic is not free, so we should avoid calling it twice. The argument also makes it cheap for createBinary to just forward to createObjectFile. llvm-svn: 199813
* Rename these methods to match the style guide.Rafael Espindola2014-01-211-4/+4
| | | | llvm-svn: 199751
* Return an ErrorOr<Binary *> from createBinary.Rafael Espindola2014-01-151-6/+9
| | | | | | | | I did write a version returning ErrorOr<OwningPtr<Binary> >, but it is too cumbersome to use without std::move. I will keep the patch locally and submit when we switch to c++11. llvm-svn: 199326
* Make parseBitcodeFile return an ErrorOr<Module *>.Rafael Espindola2014-01-151-11/+8
| | | | llvm-svn: 199279
* move getSymbolNMTypeChar to the one program that needs it: nm.Rafael Espindola2013-11-021-1/+224
| | | | llvm-svn: 193933
* Revert "Encapsulate PassManager debug flags to avoid static init and cxa_exit."Andrew Trick2013-09-191-5/+0
| | | | | | | | Working on a better solution to this. This reverts commit 7d4e9934e7ca83094c5cf41346966c8350179ff2. llvm-svn: 190990
* Encapsulate PassManager debug flags to avoid static init and cxa_exit.Andrew Trick2013-09-181-0/+5
| | | | | | | | | | | | | | This puts all the global PassManager debugging flags, like -print-after-all and -time-passes, behind a managed static. This eliminates their static initializers and, more importantly, exit-time destructors. The only behavioral change I anticipate is that tools need to initialize the PassManager before parsing the command line in order to export these options, which makes sense. Tools that already initialize the standard passes (opt/llc) don't need to do anything new. llvm-svn: 190974
* Don't crash in 'llvm -s' when an archive has no symtab.Rafael Espindola2013-07-101-11/+14
| | | | llvm-svn: 186029
* Make llvm-nm return 1 on error.Rafael Espindola2013-07-031-0/+8
| | | | | | | This is a small compatibility improvement with gnu nm and makes llvm-nm more useful as a testing tool. llvm-svn: 185546
* Basic support for parsing Mach-O universal binaries in LLVMObject libraryAlexey Samsonov2013-06-181-0/+18
| | | | llvm-svn: 184191
* Remove unused header.Rafael Espindola2013-06-141-1/+0
| | | | llvm-svn: 183968
* Remove the program class.Rafael Espindola2013-06-121-1/+1
| | | | | | | It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just those two functions and make Execute and Wait implementations details. llvm-svn: 183864
* [Object][Archive] Improve performance.Michael J. Spencer2013-02-031-1/+3
| | | | | | | | | | | | Improve performance of iterating over children and accessing the member file buffer by caching the file size and moving code out to the header. This also makes getBuffer return a StringRef instead of a MemoryBuffer. Both fixing a memory leak and removing a malloc. This takes getBuffer from ~10% of the time in lld to unmeasurable. llvm-svn: 174272
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-2/+2
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Sort the #include lines for tools/...Chandler Carruth2012-12-041-4/+4
| | | | | | | | Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. llvm-svn: 169252
* llvm-nm: Make sort more stable when symbol names are equal.Daniel Dunbar2012-11-131-1/+12
| | | | llvm-svn: 167866
* Adding changes to support GNU style archive library readingShankar Easwaran2012-11-131-0/+22
| | | | llvm-svn: 167853
* Add hidden flag to exclude aliases from output.Jan Sjödin2012-09-181-2/+6
| | | | llvm-svn: 164158
* Change the `linker_private_weak_def_auto' linkage to `linkonce_odr_auto_hide' toBill Wendling2012-08-171-1/+0
| | | | | | | | | | | | | | | | | | | | make it more consistent with its intended semantics. The `linker_private_weak_def_auto' linkage type was meant to automatically hide globals which never had their addresses taken. It has nothing to do with the `linker_private' linkage type, which outputs the symbols with a `l' (ell) prefix among other things. The intended semantic is more like the `linkonce_odr' linkage type. Change the name of the linkage type to `linkonce_odr_auto_hide'. And therefore changing the semantics so that it produces the correct output for the linker. Note: The old linkage name `linker_private_weak_def_auto' will still parse but is not a synonym for `linkonce_odr_auto_hide'. This should be removed in 4.0. <rdar://problem/11754934> llvm-svn: 162114
* [llvm-nm] Update documentation to cover object file support and arguments.Michael J. Spencer2012-06-061-5/+5
| | | | llvm-svn: 158120
* Fix uses of the C99 PRI format macros not to conflict with C++11 UDLs.Benjamin Kramer2012-03-101-2/+3
| | | | llvm-svn: 152474
* In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), ↵David Meyer2012-02-281-3/+3
| | | | | | and isWeak(), with a bitset of flags. llvm-svn: 151670
* [Object] Add {begin,end}_dynamic_symbols stubs and implementation for ELF.Michael J. Spencer2012-02-281-3/+13
| | | | | | | | Add -D option to llvm-nm to dump dynamic symbols. Patch by David Meyer. llvm-svn: 151600
* Remove unused variables.Rafael Espindola2011-12-251-1/+1
| | | | llvm-svn: 147261
OpenPOWER on IntegriCloud