summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump
Commit message (Collapse)AuthorAgeFilesLines
...
* Make llvm-objdump handle both arm and thumb disassembly from the same Mach-OKevin Enderby2014-08-181-10/+77
| | | | | | | | | | file with -macho, the Mach-O specific object file parser option. After some discussion I chose to do this implementation contained in the logic of llvm-objdump’s MachODump.cpp using a second disassembler for thumb when needed and with updates mostly contained in the MachOObjectFile class. llvm-svn: 215931
* llvm-objdump: don't print relocations in non-relocatable files.Rafael Espindola2014-08-171-0/+5
| | | | | | This matches the behavior of GNU objdump. llvm-svn: 215844
* Fix an off-by-one bug in the target independent llvm-objdump.Rafael Espindola2014-08-171-10/+5
| | | | | | | | It would prevent the display of a single byte instruction before a label. Patch by Steve King! llvm-svn: 215837
* Silencing some -Wcast-qual warnings and removing some C-style casts at the ↵Aaron Ballman2014-08-141-2/+3
| | | | | | same time. NFC. llvm-svn: 215643
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-2/+2
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* llvm-objdump: print contents of MachO __unwind_info sectionsTim Northover2014-08-121-11/+249
| | | | llvm-svn: 215437
* llvm-objdump: fix remaining use of %x format specifier for 64-bit valuesTim Northover2014-08-111-1/+1
| | | | | | Third time lucky. This should finally fix the ARM (& MIPS, I think) bots. llvm-svn: 215349
* llvm-objdump: add missing % in format specifier.Tim Northover2014-08-081-2/+2
| | | | llvm-svn: 215198
* llvm-objdump: use portable format specifiers for info.Tim Northover2014-08-081-6/+6
| | | | | | | | ARM bots (& others, I think, now that I look) were failing because we were using incorrect printf-style format specifiers. They were wrong on almost any platform, actually, just mostly harmlessly so. llvm-svn: 215196
* Add the -mcpu= option to llvm-objdump for use with the disassemblers.Kevin Enderby2014-08-063-4/+21
| | | | | | | Also make the disassembler created with the Mach-O parser (the -m option) pick up the Target specific attributes specified with -mattr option. llvm-svn: 215032
* Remove some calls to std::move.Rafael Espindola2014-08-011-3/+3
| | | | | | | | | Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get a reference to it. Thanks to David Blaikie for the suggestion. llvm-svn: 214516
* llvm-objdump: implement printing for MachO __compact_unwind info.Tim Northover2014-08-013-2/+230
| | | | llvm-svn: 214509
* Use a reference instead of a pointer.Rafael Espindola2014-07-311-1/+1
| | | | | | This makes using a std::unique_ptr in the caller more convenient. llvm-svn: 214433
* Move MCObjectSymbolizer.h to MC/MCAnalysis.Rafael Espindola2014-07-311-1/+1
| | | | | | The cpp file is already in lib/MC/MCAnalysis. llvm-svn: 214424
* Use std::unique_ptr to make the ownership explicit.Rafael Espindola2014-07-312-5/+5
| | | | llvm-svn: 214377
* Update library dependencies.NAKAMURA Takumi2014-07-241-0/+1
| | | | llvm-svn: 213832
* llvm-objdump: Handle BSS sections larger than the object fileDavid Majnemer2014-07-141-4/+8
| | | | | | | | | The size of the uninitialized sections, like BSS, can exceed the size of the object file. Do not attempt to grab the contents of such sections. llvm-svn: 212953
* Update the MemoryBuffer API to use ErrorOr.Rafael Espindola2014-07-061-9/+10
| | | | llvm-svn: 212405
* Fix configure+make build.Rafael Espindola2014-07-021-1/+1
| | | | llvm-svn: 212210
* Move CFG building code to a new lib/MC/MCAnalysis library.Rafael Espindola2014-07-023-5/+6
| | | | | | | The new library is 150KB on a Release+Asserts build, so it is quiet a bit of code that regular users of MC don't need to link with now. llvm-svn: 212209
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-261-4/+8
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-261-8/+4
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* Pass a std::unique_ptr& to the create??? methods is lib/Object.Rafael Espindola2014-06-231-2/+2
| | | | | | | | This makes the buffer ownership on error conditions very natural. The buffer is only moved out of the argument if an object is constructed that now owns the buffer. llvm-svn: 211546
* Convert the Archive API to use ErrorOr.Rafael Espindola2014-06-161-3/+3
| | | | | | | | | Now that we have c++11, even things like ErrorOr<std::unique_ptr<...>> are easy to use. No intended functionality change. llvm-svn: 211033
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-133-31/+27
| | | | llvm-svn: 210876
* Remove all uses of 'using std::error_code' from headers.Rafael Espindola2014-06-133-3/+3
| | | | llvm-svn: 210866
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-122-0/+2
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* Remove system_error.h.Rafael Espindola2014-06-123-3/+3
| | | | | | | This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards. The cases where the general idea needed some tweaking: * std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch. * Template specialization had to be moved to the std namespace in this patch set already. * The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time. Despite these shortcomings I think this is still a good thing. Some reasons: * The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++. llvm-svn: 210687
* [C++] Use 'nullptr'. Tools edition.Craig Topper2014-04-252-4/+4
| | | | llvm-svn: 207176
* [DWARF parser] Turn DILineInfo into a struct.Alexey Samsonov2014-04-181-3/+3
| | | | | | | | | | Immutable DILineInfo doesn't bring any benefits and complicates code. Also, use std::string instead of SmallString<16> for file and function names - their length can vary significantly. No functionality change. llvm-svn: 206654
* objdump: identify WoA WinCOFF/ARM correctlySaleem Abdulrasool2014-04-171-0/+6
| | | | | | | | | | | | Since LLVM currently only supports WinCOFF, assume that the input is WinCOFF rather than another type of COFF file (ECOFF/XCOFF). If the architecture is detected as thumb (e.g. the file has a IMAGE_FILE_MACHINE_ARMNT magic) then use a triple of thumbv7-windows. This allows for objdump to properly handle WoA object files without having to specify the target triple manually. llvm-svn: 206446
* [MC] Require an MCContext when constructing an MCDisassembler.Lang Hames2014-04-152-9/+12
| | | | | | | | | | | | | | | | This patch re-introduces the MCContext member that was removed from MCDisassembler in r206063, and requires that an MCContext be passed in at MCDisassembler construction time. (Previously the MCContext member had been initialized in an ad-hoc fashion after construction). The MCCContext member can be used by MCDisassembler sub-classes to construct constant or target-specific MCExprs. This patch updates disassemblers for in-tree targets, and provides the MCRegisterInfo instance that some disassemblers were using through the MCContext (previously those backends were constructing their own MCRegisterInfo instances). llvm-svn: 206241
* tools: fix heap-buffer-overrun detected via ASANSaleem Abdulrasool2014-04-141-0/+3
| | | | | | | | | | Once the auxiliary fields relating to the filename have been inspected, any following auxiliary fields need not be visited as they have been consumed (the following fields comprise the filepath as a single unit). Adjust the test to catch this even if ASAN is not enabled. llvm-svn: 206190
* tools: simplify symbol handling in objdumpSaleem Abdulrasool2014-04-141-25/+28
| | | | | | | | | Rather than switching behaviour on whether a previous symbol has an auxiliary symbol record for the next count of elements, simply iterate over the auxiliary symbols right after processing the current symbol entry. This makes the behaviour much simpler to follow and similar to llvm-readobj and yaml2obj. llvm-svn: 206146
* tools: address possible non-null terminated filenamesSaleem Abdulrasool2014-04-141-15/+7
| | | | | | | | | If a filename is a multiple of 18 characters, there will be no null-terminator. This will result in an invalid access by the constructed StringRef. Add a test case to exercise this and fix that handling. Address this same vulnerability in llvm-readobj as well. llvm-svn: 206145
* tools: avoid a string duplicationSaleem Abdulrasool2014-04-131-8/+4
| | | | | | | | | The auxiliary file records are contiguous and only contain the filename. Construct a StringRef directly rather than copying to a temporary buffer. Suggested by majnemer on IRC! llvm-svn: 206139
* tools: teach objdump about FILE aux recordsSaleem Abdulrasool2014-04-131-4/+26
| | | | | | | | | Add support for file auxiliary symbol entries in COFF symbol tables. A COFF symbol table with a FILE entry is followed by sizeof(__FILE__) / 18 auxiliary symbol records which contain the filename. Read them and form the original filename that the record contains. Then display the name in the output. llvm-svn: 206126
* Update MCSymbolizer and its subclasses' constructors to reflect the fact thatLang Hames2014-03-271-1/+2
| | | | | | they take ownership of the RelocationInfo they're constructed with. llvm-svn: 204891
* llvm-objdump output hex to match binutils' objdumpGreg Fitzgerald2014-03-201-2/+8
| | | | | | Patch by Ted Woodward llvm-svn: 204409
* 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
* Use early returns to reduce nesting.Rui Ueyama2014-03-181-69/+69
| | | | llvm-svn: 204171
* [C++11] Change the interface of getCOFF{Section,Relocation,Symbol} to make ↵Alexey Samsonov2014-03-181-6/+5
| | | | | | | | | | | | | | 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
* [C++11] Introduce ObjectFile::symbols() to use range-based loops.Alexey Samsonov2014-03-172-25/+25
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3081 llvm-svn: 204031
* [C++11] Introduce SectionRef::relocations() to use range-based loopsAlexey Samsonov2014-03-143-26/+21
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3077 llvm-svn: 203927
* [C++11] Use ObjectFile::sections() in commandline llvm toolsAlexey Samsonov2014-03-132-47/+49
| | | | llvm-svn: 203802
* Change MCDisassembler::setSymbolizer to take unique_ptr by value.Ahmed Charles2014-03-071-1/+1
| | | | | | | This changes the interface to be more explicit that ownership is being transferred. llvm-svn: 203223
* Support: split object format out of environmentSaleem Abdulrasool2014-03-061-1/+1
| | | | | | | | | | | This is a preliminary setup change to support a renaming of Windows target triples. Split the object file format information out of the environment into a separate entity. Unfortunately, file format was previously treated as an environment with an unknown OS. This is most obvious in the ARM subtarget where the handling for macho on an arbitrary platform switches to AAPCS rather than APCS (as per Apple's needs). llvm-svn: 203160
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-062-38/+38
| | | | | | | | | | 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
* Attempt to unbreak little-endian buildbots.Rui Ueyama2014-03-051-3/+6
| | | | llvm-svn: 203023
OpenPOWER on IntegriCloud