summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objdump/X86
Commit message (Collapse)AuthorAgeFilesLines
* Migrate function attribute "no-frame-pointer-elim-non-leaf" to ↵Fangrui Song2019-12-241-1/+1
| | | | "frame-pointer"="non-leaf" as cleanups after D56351
* Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" ↵Fangrui Song2019-12-242-2/+2
| | | | as cleanups after D56351
* [test][tools] Add missing and improve testingJames Henderson2019-12-091-0/+1
| | | | | | | | | | | Mostly this adds testing for certain aliases in more explicit ways. There are also a few tidy-ups, and additions of missing testing, where the feature was either not tested at all, or not tested explicitly and sufficiently. Reviewed by: MaskRay, rupprecht, grimar Differential Revision: https://reviews.llvm.org/D71116
* [llvm-objdump] Print relocation addends in hexadecimalDavid Bozier2019-11-193-6/+59
| | | | | | | | | | | | | | Summary: Matches GNU objdump. Makes debugging easier for me as I'm working out addresses from symbol+addend, so it would be good to be calculating in a single format. Reviewers: MaskRay, grimar, jhenderson, bd1976llvm Reviewed By: jhenderson Subscribers: sdardis, jrtc27, atanasyan, rupprecht, seiya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69997
* [llvm-objdump] Fix spurious "The end of the file was unexpectedly ↵Sid Manning2019-11-051-0/+37
| | | | | | | | | | | | | | | | | | | | | encountered" if a SHT_NOBITS sh_offset is larger than the file size llvm-objdump -D this file: int a[100000]; int main() { return 0; } Will produce an error: "The end of the file was unexpectedly encountered". This happens because of a check in Binary.h checkOffset. (Addr + Size > M.getBufferEnd()). The sh_offset and sh_size fields can be ignored for SHT_NOBITS sections. Fix the error by changing ELFObjectFile<ELFT>::getSectionContents to use the file base for SHT_NOBITS sections. Reviewed By: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D69192
* [llvm/Object] - Make ELFObjectFile::getRelocatedSection return ↵George Rimar2019-10-211-2/+23
| | | | | | | | | | | | | Expected<section_iterator> It returns just a section_iterator currently and have a report_fatal_error call inside. This change adds a way to return errors and handle them on caller sides. The patch also changes/improves current users and adds test cases. Differential revision: https://reviews.llvm.org/D69167 llvm-svn: 375408
* Fix test to avoid check-not matching the temp file absolute pathReid Kleckner2019-10-101-0/+3
| | | | | | Fix for PR43636 llvm-svn: 374404
* [llvm-objdump][test] Move test to X86 dir to avoid errors disassembling on ↵Jordan Rupprecht2019-10-031-0/+70
| | | | | | non-x86 llvm-svn: 373676
* [llvm-objdump] Further rearrange llvm-objdump sections for compatabilityJordan Rupprecht2019-10-033-37/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more. I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump: * Archive headers * File headers * Section headers * Symbol table * Dwarf debugging * Relocations (if `--disassemble` is not used) * Section contents * Disassembly Reviewers: jhenderson, justice_adams, grimar, ychen, espindola Reviewed By: jhenderson Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay Tags: #llvm Differential Revision: https://reviews.llvm.org/D68066 llvm-svn: 373671
* [llvm-objdump] - Cleanup the error reporting.George Rimar2019-08-216-9/+9
| | | | | | | | | | | | | | | | | | | The error reporting function are not consistent. Before this change: * They had inconsistent naming (e.g. 'error' vs 'report_error'). * Some of them reported the object name, others - dont. * Some of them accepted the case when there was no error. (i.e. error code or Error had a success value). This patch tries to cleanup it a bit. It also renames report_error -> reportError, report_warning -> reportWarning and removes a full stop from messages. Differential revision: https://reviews.llvm.org/D66418 llvm-svn: 369515
* [test] - Remove precomiled openbsd-phdrs.elf-x86-64 objects.George Rimar2019-08-172-20/+0
| | | | | | | | | | | There are 2 similar openbsd-phdrs.elf-x86-64 objects committed and used in test/Object and test/tools/llvm-objdump test cases. There is no reason to have them, we can use YAML instead. Patch does that. Differential revision: https://reviews.llvm.org/D66342 llvm-svn: 369189
* [llvm-objdump] Add warning messages if disassembly + source for problematic ↵Michael Pozulp2019-08-153-6/+12
| | | | | | | | | | | | | | | | | | inputs Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=41905 Reviewers: jhenderson, rupprecht, grimar Reviewed By: jhenderson, grimar Subscribers: RKSimon, MaskRay, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62462 llvm-svn: 368963
* Revert "[llvm-objdump] Re-commit r367284."Michael Pozulp2019-08-053-12/+6
| | | | | | | | This reverts r367776 (git commit d34099926e909390cb0254bebb4b7f5cf15467c7). My changes to llvm-objdump tests caused them to fail on windows: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/27368 llvm-svn: 367816
* [llvm-objdump] Re-commit r367284.Michael Pozulp2019-08-043-6/+12
| | | | | | | | | | | | | | | | | | Add warning messages if disassembly + source for problematic inputs Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=41905 Reviewers: jhenderson, rupprecht, grimar Reviewed By: jhenderson, grimar Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62462 llvm-svn: 367776
* Move macho-data-in-code.ll to X86/macho-data-in-code.ll (to only run when ↵Kuba Mracek2019-08-011-0/+45
| | | | | | x86 is a valid target). llvm-svn: 367583
* Revert "[llvm-objdump] Add warning messages if disassembly + source for ↵Michael Pozulp2019-07-303-12/+6
| | | | | | | | | | problematic inputs" This reverts r367284 (git commit b1cbe51bdf44098c74f5c74b7bcd8c041a7c6772). My changes to LLVMSymbolizer caused a test to fail: http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29488 llvm-svn: 367286
* [llvm-objdump] Add warning messages if disassembly + source for problematic ↵Michael Pozulp2019-07-303-6/+12
| | | | | | | | | | | | | | | | | | inputs Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=41905 Reviewers: jhenderson, rupprecht, grimar Reviewed By: jhenderson, grimar Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62462 llvm-svn: 367284
* [llvm-objdump] - Import the test/Object/X86/no-start-symbol.test test case ↵George Rimar2019-07-241-0/+28
| | | | | | | | | | | | | | and rewrite it to use YAML. This patch removes test/Object/X86/no-start-symbol.test (rewrites it to use YAML and moves it to llvm-objdump tests folder). (This test was initially introduced in rL239039, but now there is no reason to keep the precompiled binary it seems). DIfferential revision: https://reviews.llvm.org/D65136 llvm-svn: 366896
* [llvm-objdump] Keep warning for --disassemble-functions in correct order.Yuanfang Chen2019-07-091-1/+11
| | | | | | | | | | | | | | relative to normal output when dumping archive files. prepare for PR35351. Reviewers: jhenderson, grimar, MaskRay, rupprecht Reviewed by: MaskRay, jhenderson Differential Revision: https://reviews.llvm.org/D64165 llvm-svn: 365564
* Add lit.local.cfg to llvm-objdump testsSteven Wu2019-07-091-1/+1
| | | | | | | Add configuration file to llvm-objdump tests to treat files with .yaml extension as tests. llvm-svn: 365519
* Teach the symbolizer lib symbolize objects directly.Yuanfang Chen2019-07-081-0/+49
| | | | | | | | | | | | | | Currently, the symbolizer lib can only symbolize a file on disk. This patch teaches the symbolizer lib to symbolize objects. llvm-objdump needs this to support archive disassembly with source info. https://bugs.llvm.org/show_bug.cgi?id=41871 Reviewed by: jhenderson, grimar, MaskRay Differential Revision: https://reviews.llvm.org/D63521 llvm-svn: 365376
* [macCatalyst] Print out macCatalyst in llvm-objdump for the platformAlex Lorenz2019-07-031-1/+1
| | | | | | 'macCatalyst' is more readable than 'maccatalyst'. llvm-svn: 365064
* Add support for the 'macCatalyst' MachO platformAlex Lorenz2019-07-021-0/+54
| | | | | | | | | Mac Catalyst is a new MachO platform in macOS Catalina. It always uses the build_version MachO load command. Differential Revision: https://reviews.llvm.org/D64107 llvm-svn: 364981
* [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
* [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-171-15/+20
| | | | | | | | | | binaries Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D63398 llvm-svn: 363539
* [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] [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
OpenPOWER on IntegriCloud