summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objdump
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-objdump] Warn if no user specified sections (-j) are not found.Yuanfang Chen2019-07-021-0/+73
| | | | | | | | | | | | | | Match GNU objdump. https://bugs.llvm.org/show_bug.cgi?id=41898 Reviewers: jhenderson, grimar, MaskRay, rupprecht Reviewed by: jhenderson, grimar, MaskRay Differential Revision: https://reviews.llvm.org/D63779 llvm-svn: 364955
* [llvm-objdump] Match GNU objdump on symbol types shown in disassemblyYuanfang Chen2019-06-241-10/+49
| | | | | | | | | | | | output. STT_OBJECT and STT_COMMON are dumped as data, not disassembled. https://bugs.llvm.org/show_bug.cgi?id=41947 Differential Revision: https://reviews.llvm.org/D62964 llvm-svn: 364211
* [llvm-objdump] Allow --disassemble-functions to take demangled namesYuanfang Chen2019-06-222-27/+61
| | | | | | | | | | | | | The --disassemble-functions switch takes demangled names when --demangle is specified, otherwise the switch takes mangled names. https://bugs.llvm.org/show_bug.cgi?id=41908 Reviewers: jhenderson, grimar, MaskRay, rupprecht Differential Revision: https://reviews.llvm.org/D63524 llvm-svn: 364121
* [llvm-objdump] Move --start-address >= --stop-address check out of theYuanfang Chen2019-06-221-2/+2
| | | | | | | | | | | | | | | | | | | | -d code. Summary: Move it into `main` function so the checking is effective for all actions user may do with llvm-objdump; notably, -r and -s in addition to existing -d. Match GNU behavior. Reviewers: jhenderson, grimar, MaskRay, rupprecht Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63631 llvm-svn: 364118
* [binutils] Add response file option to help and docsJames Henderson2019-06-211-0/+6
| | | | | | | | | | | | | | | | | | | | | Many LLVM-based tools already support response files (i.e. files containing a list of options, specified with '@'). This change simply updates the documentation and help text for some of these tools to include it. I haven't attempted to fix all tools, just a selection that I am interested in. I've taken the opportunity to add some tests for --help behaviour, where they were missing. We could expand these tests, but I don't think that's within scope of this patch. This fixes https://bugs.llvm.org/show_bug.cgi?id=42233 and https://bugs.llvm.org/show_bug.cgi?id=42236. Reviewed by: grimar, MaskRay, jkorous Differential Revision: https://reviews.llvm.org/D63597 llvm-svn: 364036
* [llvm-objdump] Switch between ARM/Thumb based on mapping symbols.Eli Friedman2019-06-201-4/+4
| | | | | | | | | | | | | | | The ARMDisassembler changes allow changing between ARM and Thumb mode based on the MCSubtargetInfo, rather than the Target, which simplifies the other changes a bit. I'm not really happy with adding more target-specific logic to tools/llvm-objdump/, but there isn't any easy way around it: the logic in question specifically applies to disassembling an object file, and that code simply isn't located in lib/Target, at least at the moment. Differential Revision: https://reviews.llvm.org/D60927 llvm-svn: 363903
* [llvm-objdump] Remove unnecessary indentation when dumping ELF data.Yuanfang Chen2019-06-191-4/+3
| | | | | | | | | | | | Reviewers: MaskRay, jhenderson, rupprecht Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63393 llvm-svn: 363858
* Print dylib load kind (weak, reexport, etc) in llvm-objdump -m -dylibs-usedMichael Trent2019-06-181-4/+7
| | | | | | | | | | | | | | | | | | | | | | Summary: Historically llvm-objdump prints the path to a dylib as well as the dylib's compatibility version and current version number. This change extends this information by adding the kind of dylib load: weak, reexport, etc. rdar://51383512 Reviewers: pete, lhames Reviewed By: pete Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62866 llvm-svn: 363746
* [llvm-objdump] Use %08 instead of %016 to print leading addresses for 32-bit ↵Fangrui Song2019-06-172-17/+22
| | | | | | | | | | binaries Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D63398 llvm-svn: 363539
* [lit] Delete empty lines at the end of lit.local.cfg NFCFangrui Song2019-06-171-1/+0
| | | | llvm-svn: 363538
* [ELF][llvm-objdump] Treat dynamic tag values as virtual addresses instead of ↵Wolfgang Pieb2019-06-101-0/+113
| | | | | | | | | | | offsets The ELF gABI requires the tag values of DT_REL, DT_RELA and DT_JMPREL to be treated as virtual addresses. They were treated as offsets. Fixes PR41832. Differential Revision: https://reviews.llvm.org/D62972 llvm-svn: 362969
* [llvm-objdump] Fix Bugzilla ID 41862 to support checking addresses of ↵Jordan Rupprecht2019-06-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | disassembled object Summary: This fixes the bugzilla id,41862 to support dealing with checking stop address against start address to support this not being a proper object to check the disasembly against like gnu objdump currently does. Reviewers: jakehehrlich, rupprecht, echristo, jhenderson, grimar Reviewed By: jhenderson Subscribers: MaskRay, smeenai, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61969 Patch by Nicholas Krause! llvm-svn: 362847
* [llvm-objdump] Add warning if --disassemble-functions specifies an unknown ↵Michael Pozulp2019-06-071-0/+11
| | | | | | | | | | | | | | | | | | | | | symbol Summary: Fixes Bug 41904 https://bugs.llvm.org/show_bug.cgi?id=41904 Re-land r362768 after it was reverted in r362826. Reviewers: jhenderson, rupprecht, grimar, MaskRay Reviewed By: jhenderson, rupprecht, MaskRay Subscribers: dexonsmith, rupprecht, kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62275 llvm-svn: 362838
* Revert "[llvm-objdump] Add warning if --disassemble-functions specifies an ↵Vlad Tsyrklevich2019-06-071-11/+0
| | | | | | | | | | unknown symbol" This reverts commit 50f61af3f304a03f10d9ecb0828829f0a72d0099, it used the function introduced in the previous revert of 0bddef79019a23ab14fcdb27028e55e484674c88. llvm-svn: 362826
* [NFC] Delete trailing whitespace character.Michael Pozulp2019-06-071-1/+1
| | | | llvm-svn: 362772
* [llvm-objdump] Print source when subsequent lines in the translation unit ↵Michael Pozulp2019-06-076-1/+78
| | | | | | | | | | | | | | | | come from the same line in two different headers. Reviewers: grimar, rupprecht, jhenderson Reviewed By: grimar, jhenderson Subscribers: llvm-commits, jhenderson Tags: #llvm Differential Revision: https://reviews.llvm.org/D62461 llvm-svn: 362771
* [llvm-objdump] Add warning if --disassemble-functions specifies an unknown ↵Michael Pozulp2019-06-071-0/+11
| | | | | | | | | | | | | | | | | | symbol Summary: Fixes Bug 41904 https://bugs.llvm.org/show_bug.cgi?id=41904 Reviewers: jhenderson, rupprecht, grimar, MaskRay Reviewed By: jhenderson, rupprecht, MaskRay Subscribers: dexonsmith, rupprecht, kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62275 llvm-svn: 362768
* [NFC] Test commit.Michael Pozulp2019-06-071-1/+1
| | | | llvm-svn: 362763
* [llvm-objdump] - Disassemble non-executable sections if specifically requested.George Rimar2019-06-052-7/+51
| | | | | | | | | | | This is https://bugs.llvm.org/show_bug.cgi?id=41897. Previously -d + -j .data had no effect, that wasn't consistent with GNU, which proccesses .data in that case. With this patch we follow this behavior. Diffeential revision: https://reviews.llvm.org/D62848 llvm-svn: 362596
* [llvm-objdump/llvm-readobj/obj2yaml/yaml2obj] Support DT_PPC_GOT and DT_PPC_OPTFangrui Song2019-06-051-6/+17
| | | | | | | | | | | | | | In glibc, DT_PPC_GOT indicates that PowerPC32 Secure PLT ABI is used. I plan to use it in D62464. DT_PPC_OPT currently indicates if a TLSDESC inspired TLS optimization is enabled. Reviewed By: grimar, jhenderson, rupprecht Differential Revision: https://reviews.llvm.org/D62851 llvm-svn: 362569
* [AArch64][ELF] Add support for PLT decoding with BTI instructions presentPeter Smith2019-06-041-1/+56
| | | | | | | | | | | | | | | | | | | | | | Arm Architecture v8.5a introduces Branch Target Identification (BTI). When enabled all indirect branches must target a bti instruction of the appropriate form. As PLT sequences may sometimes be the target of an indirect branch and PLT[0] always is, a static linker may need to generate PLT sequences that contain "bti c" as the first instruction. In effect: bti c adrp x16, page offset to .got.plt ... Instead of: adrp x16, page offset to .got.plt ... At present the PLT decoding assumes the adrp will always be the first instruction. This patch adds support for a single "bti c" to prefix it. A test binary has been uploaded with such a PLT sequence. A forthcoming LLD patch will make heavy use of the PLT decoding code. Differential Revision: https://reviews.llvm.org/D62598 llvm-svn: 362523
* [llvm] [test] Remove non-portable EISDIR test from macho-disassemble-g-dsym.testMichal Gorny2019-06-031-5/+0
| | | | | | | | | | | | | | Remove the test checking error message for 'is a directory'. It does not seem to serve any real purpose, and it relies on matching platform error strings which are unpredictable and makes the test fragile. Furthermore, it fails on NetBSD where read() works on directories, and therefore does not return EISDIR at all. Fixes r362141. Differential Revision: https://reviews.llvm.org/D62773 llvm-svn: 362404
* Fix test to add missing '|' to regex.Douglas Yung2019-05-301-1/+1
| | | | llvm-svn: 362168
* Update the tests in r362121 / r362141 to allow for Windows-specific errorMichael Trent2019-05-301-1/+2
| | | | | | | | messages: "Is a directory" instead of "is a directory" This should resolve the errors being reported on clang-x64-windows-msvc. llvm-svn: 362167
* Write new tests for r362121Michael Trent2019-05-305-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The tests for r362121 ran dsymutil against a test binary every time. This caused problems on lld-x86_64-ubuntu-fast as dsymutil required a lipo tool be available to process those binaries. This change rewrites the new test cases in macho-disassemble-g-dsym to use bespoke test binaries (exe and dwarf) simplifying the test's runtime dependencies. The changes to tools/llvm-objdump/MachODump.cpp are unchanged from r362121 Reviewers: pete, lhames, JDevlieghere Reviewed By: pete Subscribers: smeenai, aprantl, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62694 llvm-svn: 362141
* Reverting change r362121 due to lld-x86_64-ubuntu-fast test failuresMichael Trent2019-05-301-11/+0
| | | | llvm-svn: 362123
* Support Universal dSYM files in llvm-objdumpMichael Trent2019-05-301-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Commonly programmers use llvm-objdump to disassemble Mach-O target binaries with Mach-O dSYMS. While llvm-objdump allows programmers to disassemble Universal binaries, it previously did not recognize Universal dSYM files. This change updates llvm-objdump to support passing in Universal files via the -dsym option. Now, when disassembling a Mach-O file either as a stand alone file or as an entry in a Universal binariy, llvm-objdump will search through a Universal dSYM for a Mach-O matching the architecture flag of the file being disassembled. Reviewers: pete, lhames Reviewed By: pete Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62642 llvm-svn: 362121
* [llvm-objdump][test] Fix for spurious matches against file pathsJames Henderson2019-05-243-10/+10
| | | | | | | | | r361479 added tests that did --implicit-check-not=main, but a user found that they failed on his machine, due to it having 'main' in a file path printed earlier in the output. This test fixes this issue by making the check pattern more explicit. llvm-svn: 361621
* fix accidental implicit matches in elf-disassemble-symbol-labels-rel.testBob Haarman2019-05-231-0/+1
| | | | | | | | | | | | llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-labels-rel.test uses --implicit-check-not to verify that certain patterns do not occur in llvm-objdump's output, except in places where they are explicitly checked. Unfortunately, the patterns are generic enough that they may be part of the file name which is also output by llvm-objdump. This change matches the line with the filename explicitly so that the implicit patterns are not applied to it. llvm-svn: 361563
* [llvm-objdump][test] Make MachO test names consistentFangrui Song2019-05-233-0/+0
| | | | | | | We have macho-disassembl{e,y}-*. Rename macho-disassembly-* to macho-disassemble-* for consistency. llvm-svn: 361492
* [llvm-objdump][test] Make test names consistentJames Henderson2019-05-235-0/+0
| | | | | | | | This change renames a number of the disassembly tests to standardise disasm/diassemble/disassembly to disassemble. Requested in https://reviews.llvm.org/D62255. llvm-svn: 361491
* [llvm-objdump][test] Improve testing of some switches #3James Henderson2019-05-2314-34/+604
| | | | | | | | | | | | This is the third commit in a series of patches to improve test coverage of llvm-objdump. In this patch I have added a number of tests testing various aspects of disassembly. Reviewed by: MaskRay, grimar, rupprecht Differential Revision: https://reviews.llvm.org/D62255 llvm-svn: 361489
* [llvm-objdump][test] Improve testing of some switches #2James Henderson2019-05-236-16/+100
| | | | | | | | | | | | | This patch focuses on adding additional testing for the --source switch. For reference, the source-interleave-x86_64.ll test file has been split into two parts - the input (shared with the other tests) and the test itself. Reviewed by: MaskRay, rupprecht, grimar Differential Revision: https://reviews.llvm.org/D61996 llvm-svn: 361479
* [llvm-objdump] Dump inline relocations if the relocated section is specified ↵Fangrui Song2019-05-221-11/+2
| | | | | | | | | | | | | | with --section This fixes PR41886: llvm-objdump -d -r -j .text doesn't show inline relocations of .text While here, switch to stable_sort() because we don't want to change the order of relocations applied to the same location. gABI says consecutive relocation records are composed together and their order matters. In practise it is difficult to see relocations applied to the same location not consecutive, we just have to keep the relative order of relocations with the same offset. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D62253 llvm-svn: 361395
* [llvm-objdump] Make --disassemble-functions imply -dGeorge Rimar2019-05-211-0/+22
| | | | | | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=41903 Patch by Mike Pozulp! Differential revision: https://reviews.llvm.org/D62054 llvm-svn: 361240
* [llvm-objdump]Move test code missed in r360904James Henderson2019-05-162-24/+24
| | | | llvm-svn: 360909
* [llvm-objdump]Split section-filter.test in two to remove X86 dependencyJames Henderson2019-05-162-87/+85
| | | | | | | This allows the generic parts of section-filter.test to be tested on all targets. The X86-specific parts have been moved to another test. llvm-svn: 360904
* [llvm-objdump] Add "REQUIES: x86-registered-target" to section-filter.test ↵Fangrui Song2019-05-161-0/+1
| | | | | | | | | after rL360893 Appease the hexagon buildbot that doesn't build X86. Disassemblers require Target/X86 support. llvm-svn: 360901
* [llvm-objdump]Improve testing of some switches #1James Henderson2019-05-164-34/+255
| | | | | | | | | | | | | This is the first in a set of patches I have to improve testing of llvm-objdump. This patch targets --all-headers, --section, and --full-contents. In the --section case, it deletes a pre-canned binary which is only used by the one test and replaces it with yaml. Reviewed by: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D61941 llvm-svn: 360893
* AArch64: support binutils-like things on arm64_32.Tim Northover2019-05-145-0/+34
| | | | | | | | This adds support for the arm64_32 watchOS ABI to LLVM's low level tools, teaching them about the specific MachO choices and constants needed to disassemble things. llvm-svn: 360663
* [test]Make test work on WindowsJames Henderson2019-05-141-2/+1
| | | | | | | | | | | | | Previously, the test didn't work because '\' characters appeared in the sed string, causing bogus escape characters to form in the substituted string literal. Switching to using '%/p' causes the path to be emitted with '/' characters instead, so that there are are no escaping issues. Reviewed by: kzhuravl, grimar Differential Revision: https://reviews.llvm.org/D61856 llvm-svn: 360660
* [llvm-objdump] Print st_otherFangrui Song2019-05-101-0/+36
| | | | | | | | | | | Add support for ".hidden" ".internal" ".protected" and " 0x%02x" for other st_other bits used by some architectures. Reviewed By: sfertile Differential Revision: https://reviews.llvm.org/D61718 llvm-svn: 360439
* AMDGPU: Select VOP3 form of addMatt Arsenault2019-05-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The VOP3 form should always be the preferred selection, to be shrunk later. This should only be an optimization issue, but this partially works around a problem from clobbering VCC when SIFixSGPRCopies rewrites an SCC defining operation directly to VCC. 3 of the testcases are regressions from failing to fold the immediate in cases it should. These can be avoided by improving the VCC liveness handling in SIFoldOperands. Simply increasing the threshold to computeRegisterLiveness works, although this is common enough that VCC liveness should probably be tracked throughout the pass. The hack of leaving behind an implicit_def instruction to avoid breaking iterator wastes instruction count, which inhibits finding the VCC def in long chains of adds. Doing this however exposes different, worse looking regressions from poor scheduling behavior. This could probably be avoided around by forcing the shrink of the addc here, but the scheduler should probably be fixed. The r600 add test needs to be split out because it asserts on the arguments in the new test during the calling convention lowering. llvm-svn: 360293
* [llvm-objdump] - Print relocation record in a GNU format.George Rimar2019-05-071-11/+30
| | | | | | | | | | | | | | | This fixes the https://bugs.llvm.org/show_bug.cgi?id=41355. Previously with -r we printed relocation section name instead of the target section name. It was like this: "RELOCATION RECORDS FOR [.rel.text]" Now it is: "RELOCATION RECORDS FOR [.text]" Also when relocation target section has more than one relocation section, we did not combine the output. Now we do. Differential revision: https://reviews.llvm.org/D61312 llvm-svn: 360143
* [llvm-objdump] Print newlines before and after "Disassembly of section ...:"Fangrui Song2019-05-015-0/+16
| | | | | | | | | | | This improves readability and the behavior is consistent with GNU objdump. The new test test/tools/llvm-objdump/X86/disassemble-section-name.s checks we print newlines before and after "Disassembly of section ...:" Differential Revision: https://reviews.llvm.org/D61127 llvm-svn: 359668
* [Object][XCOFF] Add intial support for section header table.Sean Fertile2019-04-254-0/+43
| | | | | | | | | Adds a representation of the section header table to XCOFFObjectFile, and implements enough to dump the section headers with llvm-obdump. Differential Revision: https://reviews.llvm.org/D60784 llvm-svn: 359244
* [llvm-objdump] Prep for adding newlines before and after "Disassembly of ↵Fangrui Song2019-04-254-30/+17
| | | | | | section ...:" llvm-svn: 359181
* [llvm] Prevent duplicate files in debug line header in dwarf 5: another attemptAli Tamur2019-04-192-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Another attempt to land the changes in debug line header to prevent duplicate files in Dwarf 5. I rolled back my previous commit because of a mistake in generating the object file in a test. Meanwhile, I addressed some offline comments and changed the implementation; the largest difference is that MCDwarfLineTableHeader does not keep DwarfVersion but gets it as a parameter. I also merged the patch to fix two lld tests that will strt to fail into this patch. Original Commit: https://reviews.llvm.org/D59515 Original Message: Motivation: In previous dwarf versions, file name indexes started from 1, and the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes the primary source file to be explicitly given an entry with an index number 0. The current implementation honors the specification by just duplicating the main source file, once with index number 0, and later maybe with another index number. While this is compliant with the letter of the standard, the duplication causes problems for consumers of this information such as lldb. (Some files are duplicated, where only some of them have a line table although all refer to the same file) With this change, dwarf 5 debug line section files always start from 0, and the zeroth entry is not duplicated whenever possible. This requires different handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns an index zero for a file name, it signals an error in dwarf 4, but not in dwarf 5) However, I think the minor complication is worth it, because it enables all consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the file name list homogenously. llvm-svn: 358732
* [llvm-objdump] Test tabs in disassemble-align.s with a more visible characterFangrui Song2019-04-161-14/+16
| | | | | | | | | | | | | | | | Summary: Apply rupprecht's suggestion in D60376 Reviewers: rupprecht Reviewed By: rupprecht Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60777 llvm-svn: 358504
* [llvm-objdump] Align instructions to a tab stop in disassembly outputFangrui Song2019-04-161-0/+29
| | | | | | | | | | | | | | | | | | | | | | | This relands D60376/rL358405, with the difference: sed 'y/\t/ /' -> tr '\t' ' ' BSD sed doesn't support escape characters for the 'y' command. I didn't use it in rL358405 because it was not listed at https://llvm.org/docs/GettingStarted.html#software but it should be available. Original description: In GNU objdump, -w/--wide aligns instructions in the disassembly output. This patch does the same to llvm-objdump. However, we always use the wide format (-w/--wide is ignored), because the narrow format (instructions are misaligned) is probably not very useful. In llvm-readobj, we made a similar decision: always use the wide format, accept but ignore -W/--wide. To save some columns, we change the tab before hex bytes (controlled by --[no-]show-raw-insn) to a space. llvm-svn: 358474
OpenPOWER on IntegriCloud