summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump
Commit message (Collapse)AuthorAgeFilesLines
...
* [binutils] NFC: fix clang-tidy warning: use empty() instead of size() == 0Jordan Rupprecht2018-12-202-12/+11
| | | | llvm-svn: 349710
* [llvm-objdump] - Fix one more BB.George Rimar2018-12-191-1/+4
| | | | | | | | | Should fix the http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25876/steps/build/logs/stdio: /home/grosser/buildslave/polly-amd64-linux/llvm.src/tools/llvm-objdump/llvm-objdump.cpp:539:25: error: conditional expression is ambiguous; 'std::string' (aka 'basic_string<char>') can be converted to 'typename std::remove_reference<StringRef>::type' (aka 'llvm::StringRef') and vice versa Target = Demangle ? demangle(*SymName) : *SymName; llvm-svn: 349617
* [llvm-objdump] - Fix BB.George Rimar2018-12-191-16/+15
| | | | | | Move the helper method before the first incocation in the file. llvm-svn: 349614
* [llvm-objdump] - Demangle the symbols when printing symbol table and ↵George Rimar2018-12-191-27/+28
| | | | | | | | | | | | | | | relocations. This is https://bugs.llvm.org/show_bug.cgi?id=40009, llvm-objdump does not demangle the symbols when prints symbol table and/or relocations. Patch teaches it to do that. Differential revision: https://reviews.llvm.org/D55821 llvm-svn: 349613
* Update the Swift version numbers reported by objdumpMichael Trent2018-12-071-2/+6
| | | | | | | | | | | | | | | | | | Summary: Add Swift 4.1, Swift 4.2, and Swift 5 version numbers to objdump's MachODump's print_imae_info routines. rdar://46548425 Reviewers: pete, lhames, bob.wilson Reviewed By: pete, bob.wilson Subscribers: bob.wilson, llvm-commits Differential Revision: https://reviews.llvm.org/D55442 llvm-svn: 348632
* [llvm-objdump] Print a blank row at the end of sectionsXing GUO2018-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When using option `-x` (--all-headers), it will print `Sections`, `Symbol Table`, `Program Header` ... `Sections` and `Symbol Table` will be connected together. Before: ``` Sections: Idx Name Size Address Type 0 00000000 0000000000000000 ... 29 .shstrtab 0000011a 0000000000000000 SYMBOL TABLE: ... ``` After: ``` Sections: Idx Name Size Address Type 0 00000000 0000000000000000 ... 29 .shstrtab 0000011a 0000000000000000 SYMBOL TABLE: ... ``` Reviewers: Higuoxing Reviewed By: Higuoxing Subscribers: llvm-commits, jhenderson Differential Revision: https://reviews.llvm.org/D54665 llvm-svn: 347135
* [llvm-objdump] Use `auto` declaration in typecastingXing GUO2018-11-151-16/+8
| | | | | | | | | | | | | | | | Summary: According to `MaskRay`, use `auto` for type inference, according to coding standards. Delete some comments, because these comments can be easily inferred from codes. Reviewers: jhenderson, MaskRay Reviewed By: jhenderson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54573 llvm-svn: 346946
* [llvm-objdump] Improve ELF file type checking statements (D54509)Xing GUO2018-11-141-12/+6
| | | | llvm-svn: 346851
* [llvm-objdump] Use WithColor for error reportingJonas Devlieghere2018-11-113-68/+95
| | | | | | Use helpers from Support/WithError.h to print errors. llvm-svn: 346623
* [llvm-objdump] Add symbol 'O' for object dataKristina Brooks2018-11-111-0/+2
| | | | | | | | | | | | | Improve compatibility with GNU objdump by showing `O` next to global symbol names, instead of a blank space. Patch by Higuoxing (Xing). Reviewers: MaskRay Differential Revision: https://reviews.llvm.org/D54380 llvm-svn: 346610
* [Support] Make error banner optional in logAllUnhandledErrorsJonas Devlieghere2018-11-111-2/+2
| | | | | | | | In a lot of places an empty string was passed as the ErrorBanner to logAllUnhandledErrors. This patch makes that argument optional to simplify the call sites. llvm-svn: 346604
* [llvm-objdump] Mark syms/t flags as NotHidden. NFC.Kristina Brooks2018-10-311-0/+1
| | | | | | | Slight improvement to help output of llvm-objdump that exposes the shorter -t flag for -syms instead of it being hidden away. llvm-svn: 345704
* [llvm-objdump] Add --reloc alias for -r (PR39407)Kristina Brooks2018-10-311-1/+5
| | | | | | | | | | | | | This addresses PR39407 (https://bugs.llvm.org/show_bug.cgi?id=39407) improving compatibility with GNU binutils counterparts. Reviewed By: kristina Patch by Higuoxing (Xing). Differential Revision: https://reviews.llvm.org/D53804 llvm-svn: 345703
* [llvm-objdump] support '--syms' as an alias of -tKristina Brooks2018-10-311-2/+3
| | | | | | | | | | | This adds support for '--syms' as an alias of '-t' for llvm-objdump, fixing PR39406 (https://bugs.llvm.org/show_bug.cgi?id=39406). Patch by Higuoxing (Xing). Differential Revision: https://reviews.llvm.org/D53803 llvm-svn: 345697
* [llvm-objdump] Don't crash when using `-a` on non-archivesJames Henderson2018-10-291-4/+4
| | | | | | | | | | | | | This fixes PR39402. The crash was caused when dereferencing nullptr in DumpObject and printArchiveChild. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D53690 Patch by Xing GUO llvm-svn: 345503
* [llvm-objdump] Add '--full-contents' as alias for '-s'James Henderson2018-10-291-1/+5
| | | | | | | | | | | | This fixes PR39404. Reviewed By: jhenderson Patch by Xing Guo Differential Revision: https://reviews.llvm.org/D53576 llvm-svn: 345495
* [llvm-objdump] Fix --file-headers (-f) optionPetar Jovanovic2018-10-191-1/+4
| | | | | | | | | | | | | | | | | Changed the format call to match the surrounding code. Previously it was printing an unsigned int while the return type being printed was long unsigned int or wider. This caused problems for big-endian systems which were discovered on mips64. Also, the printed address had less characters than it should because the character count was directly obtained from the number of bytes in the address. The tests were adapted to fit this fix and now use longer addresses. Patch by Milos Stojanovic. Differential Revision: https://reviews.llvm.org/D53403 llvm-svn: 344818
* llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)Fangrui Song2018-09-273-5/+5
| | | | | | | | | | | | Summary: The convenience wrapper in STLExtras is available since rL342102. Reviewers: dblaikie, javed.absar, JDevlieghere, andreadb Subscribers: MatzeB, sanjoy, arsenm, dschuff, mehdi_amini, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, javed.absar, gbedwell, jrtc27, mgrang, atanasyan, steven_wu, george.burgess.iv, dexonsmith, kristina, jsji, llvm-commits Differential Revision: https://reviews.llvm.org/D52573 llvm-svn: 343163
* [llvm-objdump] Keep the memory buffer from the dSYM alive when using -g -dsymFrancis Visoiu Mistrih2018-08-311-0/+3
| | | | | | | | | | When using -g and -dsym, llvm-objdump opens the dsym file and keeps the MachOObjectFile alive, while the memory buffer that the MachOObjectFile was based on gets destroyed. Differential Revision: https://reviews.llvm.org/D51365 llvm-svn: 341209
* [llvm-objdump] Label calls to the PLT.Joel Galenson2018-08-241-0/+36
| | | | | | Differential Revision: https://reviews.llvm.org/D50204 llvm-svn: 340611
* Print "invalid mangled name" when we can't demangle something.Zachary Turner2018-08-211-0/+2
| | | | llvm-svn: 340340
* [llvm-objdump] Add ability to demangle COFF symbols.Zachary Turner2018-08-203-17/+32
| | | | llvm-svn: 340221
* [ADT] Normalize empty triple componentsPetr Hosek2018-08-081-1/+0
| | | | | | | | | | | | | | | | | LLVM triple normalization is handling "unknown" and empty components differently; for example given "x86_64-unknown-linux-gnu" and "x86_64-linux-gnu" which should be equivalent, triple normalization returns "x86_64-unknown-linux-gnu" and "x86_64--linux-gnu". autoconf's config.sub returns "x86_64-unknown-linux-gnu" for both "x86_64-linux-gnu" and "x86_64-unknown-linux-gnu". This changes the triple normalization to behave the same way, replacing empty triple components with "unknown". This addresses PR37129. Differential Revision: https://reviews.llvm.org/D50219 llvm-svn: 339294
* [llvm-objdump] Remove continue after report_error which is unreachableFangrui Song2018-08-041-2/+0
| | | | llvm-svn: 338951
* objdump: Better handling of Mach-O universal binariesDave Lee2018-08-033-153/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With Mach-O, there is a flag requirement discrepancy between working with universal binaries and thin binaries. Many flags that don't require the `-macho` flag (for example `-private-headers` and `-disassemble`) fail to work on universal binaries unless `-macho` is given. When this happens, the error message is unhelpful, stating: The file was not recognized as a valid object file. Which can lead to confusion. This change allows generic flags to be used on universal binaries with and without the `-macho` flag. This means flags that can be used for thin files can be used consistently with fat files too. To do this, the universal binary support within `ParseInputMachO()` is extracted into a new function. This new function is called directly from `DumpInput()` when the input binary is universal. Additionally the `-arch` flag validation in `ParseInputMachO()` was extracted to be reused. Reviewers: compnerd Reviewed By: compnerd Subscribers: keith, llvm-commits Differential Revision: https://reviews.llvm.org/D48702 llvm-svn: 338792
* [ADT] Replace std::isprint by llvm::isPrint.Michael Kruse2018-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The standard library functions ::isprint/std::isprint have platform- and locale-dependent behavior which makes LLVM's output less predictable. In particular, regression tests my fail depending on the implementation of these functions. Implement llvm::isPrint in StringExtras.h with a standard behavior and replace all uses of ::isprint/std::isprint by a call it llvm::isPrint. The function is inlined and does not look up language settings so it should perform better than the standard library's version. Such a replacement has already been done for isdigit, isalpha, isxdigit in r314883. gtest does the same in gtest-printers.cc using the following justification: // Returns true if c is a printable ASCII character. We test the // value of c directly instead of calling isprint(), which is buggy on // Windows Mobile. inline bool IsPrintableAscii(wchar_t c) { return 0x20 <= c && c <= 0x7E; } Similar issues have also been encountered by Julia: https://github.com/JuliaLang/julia/issues/7416 I noticed the problem myself when on Windows isprint('\t') started to evaluate to true (see https://stackoverflow.com/questions/51435249) and thus caused several unit tests to fail. The result of isprint doesn't seem to be well-defined even for ASCII characters. Therefore I suggest to replace isprint by a platform-independent version. Differential Revision: https://reviews.llvm.org/D49680 llvm-svn: 338034
* [llvm-objdump] Add dynamic section printing to private-headers optionPaul Semel2018-07-253-2/+94
| | | | | | Differential Revision: https://reviews.llvm.org/D49016 llvm-svn: 337902
* [llvm-objdump] Add -demangle (-C) optionPaul Semel2018-07-182-1/+39
| | | | | | Differential Revision: https://reviews.llvm.org/D49043 llvm-svn: 337401
* [llvm-objdump] - An attempt to fix BB after r337361.George Rimar2018-07-181-2/+2
| | | | | | | | | | | Seems r337361 is the reason of the following ARM BB failures: http://lab.llvm.org:8011/builders/clang-cmake-armv8-quick http://lab.llvm.org:8011/builders/clang-cmake-armv8-full/builds/4633 Reason is unclear to me, other bots are OK. If this will not help, I'll revert r337361. llvm-svn: 337371
* [llvm-objdump] - Stop reporting bogus section IDs.George Rimar2018-07-181-4/+3
| | | | | | | | | | | | | | | | Imagine we have a file with few sections, and one of them is .foo with index N != 0. Problem is that when llvm-objdump is given a -section=.foo parameter it lists .foo as a section at index 0. That makes impossible to write test cases which needs to find the index of the particular section, while ignoring dumping of others. The patch fixes that. Differential revision: https://reviews.llvm.org/D49372 llvm-svn: 337361
* Revert "[llvm-objdump] Add -demangle (-C) option"Paul Semel2018-07-112-39/+1
| | | | | | | This reverts commit 3a44ccd156e0edd2e89226f8ed63928e227900bb. This reverts commit d5cfc836bb5552e20507d3612d13ff66ff9e36a0. llvm-svn: 336829
* [llvm-objdump] Add -demangle (-C) optionPaul Semel2018-07-112-1/+39
| | | | | | Differential Revision: https://reviews.llvm.org/D49043 llvm-svn: 336816
* Reapply: "objdump: Support newer ObjC image info flags"Dave Lee2018-07-061-0/+6
| | | | | | | | | | | | | | | | | | | | | Summary: Add support for two additional ObjC image info flags: `IS_SIMULATED` and `HAS_CATEGORY_CLASS_PROPERTIES`. `IS_SIMULATED` indicates a Mach-O binary built for iOS simulator. `HAS_CATEGORY_CLASS_PROPERTIES` indicates a Mach-O binary built by a compiler that supports class properties in categories. Reviewers: enderby, compnerd Reviewed By: compnerd Subscribers: keith, llvm-commits Differential Revision: https://reviews.llvm.org/D48568 llvm-svn: 336411
* Revert "objdump: Support newer ObjC image info flags"Dave Lee2018-07-061-6/+0
| | | | | | This reverts commit 8c4cc472e7a67bd3b2b20cc4cf32d31af29bc7e9. llvm-svn: 336402
* objdump: Support newer ObjC image info flagsDave Lee2018-07-051-0/+6
| | | | | | | | | | | | | | | | | | | | | Summary: Add support for two additional ObjC image info flags: `IS_SIMULATED` and `HAS_CATEGORY_CLASS_PROPERTIES`. `IS_SIMULATED` indicates a Mach-O binary built for iOS simulator. `HAS_CATEGORY_CLASS_PROPERTIES` indicates a Mach-O binary built by a compiler that supports class properties in categories. Reviewers: enderby, compnerd Reviewed By: compnerd Subscribers: keith, llvm-commits Differential Revision: https://reviews.llvm.org/D48568 llvm-svn: 336399
* [llvm-objdump] Add --archive-headers (-a) optionPaul Semel2018-07-052-10/+83
| | | | llvm-svn: 336357
* [llvm-objdump] Add --file-headers (-f) optionPaul Semel2018-07-042-0/+25
| | | | llvm-svn: 336284
* Handle absolute symbols as branch targets in disassembly.Sterling Augustine2018-06-281-21/+35
| | | | | | https://reviews.llvm.org/D48554 llvm-svn: 335903
* [llvm-objdump] Add -x --all-headers optionsFangrui Song2018-06-272-0/+10
| | | | | | | | | | Reviewers: paulsemel, echristo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48622 llvm-svn: 335785
* [llvm-objdump] Add -R optionPaul Semel2018-06-072-17/+72
| | | | | | | | This option prints dynamic relocation entries of the given file Differential Revision: https://reviews.llvm.org/D47493 llvm-svn: 334196
* Implemented sane default for llvm-objdump's relocation Value formatDaniel Cederman2018-06-011-72/+10
| | | | | | | | | | | | | | | | | | | | | Summary: "Unknown" for platforms that were not manually added into the switch did not make sense at all. Now it prints Target + addend for all elf-machines that were not explicitly mentioned. Addresses PR21059 and PR25124. Original author: fedor.sergeev Reviewers: jyknight, espindola, fedor.sergeev Reviewed By: jyknight Subscribers: eraman, dcederman, jfb, dschuff, aheejin, llvm-commits Differential Revision: https://reviews.llvm.org/D36464 llvm-svn: 333726
* Fix debug build by adding missing dependencies on libBinaryFormatSam Clegg2018-05-151-0/+1
| | | | | | | | Debug BUILD_SHARED_LIBS build was broken by rL332305 Differential Revision: https://reviews.llvm.org/D46859 llvm-svn: 332315
* Hexagon: Put relocations after instructions not packets.Sid Manning2018-05-141-290/+319
| | | | | | | | | | | | | Change relocation output so that relocation information follows individual instructions rather than clustering them at the end of packets. This change required shifting block of code but the actual change is in HexagonPrettyPrinter's PrintInst. Differential Revision: https://reviews.llvm.org/D46728 llvm-svn: 332283
* Remove @brief commands from doxygen comments, too.Adrian Prantl2018-05-011-3/+3
| | | | | | | | | | | | | | | | | This is a follow-up to r331272. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done https://reviews.llvm.org/D46290 llvm-svn: 331275
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-014-4/+4
| | | | | | | | | | | | | | | | We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46290 llvm-svn: 331272
* [WebAssembly] objdump: Don't assume all relocations have symbolsSam Clegg2018-04-261-2/+6
| | | | | | | | Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D46134 llvm-svn: 330959
* [WebAssembly] Implement getRelocationValueString()Sam Clegg2018-04-261-1/+9
| | | | | | | | And use it in llvm-objdump. Differential Revision: https://reviews.llvm.org/D46092 llvm-svn: 330957
* [llvm-objdump] Issue error message when object file cannot be createdGerolf Hoflehner2018-04-191-4/+6
| | | | llvm-svn: 330364
* [llvm-objdump] Print "..." instead of random data for virtual sectionsFrancis Visoiu Mistrih2018-04-191-0/+7
| | | | | | | | | | | | | | | | | When disassembling with -D, skip virtual sections by printing "..." for each symbol. This patch also implements `MachOObjectFile::isSectionVirtual`. Test case comes from: ``` .zerofill __DATA,__common,_data64unsigned,472,3 ``` Differential Revision: https://reviews.llvm.org/D45824 llvm-svn: 330342
* Define InitLLVM to do common initialization all at once.Rui Ueyama2018-04-131-7/+2
| | | | | | | | | | | We have a few functions that virtually all command wants to run on process startup/shutdown. This patch adds InitLLVM class to do that all at once, so that we don't need to copy-n-paste boilerplate code to each llvm command's main() function. Differential Revision: https://reviews.llvm.org/D45602 llvm-svn: 330046
OpenPOWER on IntegriCloud