summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objdump/X86
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix tests after move to utohexstr.Benjamin Kramer2017-12-281-1/+1
| | | | llvm-svn: 321527
* Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent2017-12-154-6/+13
| | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-objdump's Mach-O parser was updated in r306037 to display external relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O parser to display local relocations for MH_PRELOAD files. When used with the -macho option relocations will be displayed in a historical format. All tests are passing for llvm, clang, and lld. llvm-objdump builds without compiler warnings. rdar://35778019 Reviewers: enderby Reviewed By: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41199 llvm-svn: 320832
* reverting out -r320532 because a warning is breaking the lld buildMichael Trent2017-12-134-13/+6
| | | | llvm-svn: 320534
* Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent2017-12-124-6/+13
| | | | | | | | | | | | | | | | | | Summary: llvm-objdump's Mach-O parser was updated in r306037 to display external relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O parser to display local relocations for MH_PRELOAD files. When used with the -macho option relocations will be displayed in a historical format. rdar://35778019 Reviewers: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41061 llvm-svn: 320532
* Reverting r320166 to fix test failures.Michael Trent2017-12-082-6/+0
| | | | llvm-svn: 320174
* Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent2017-12-082-0/+6
| | | | | | | | | | | | | | | | | | | | Summary: llvm-objdump's Mach-O parser was updated in r306037 to display external relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O parser to display local relocations for MH_PRELOAD files. When used with the -macho option relocations will be displayed in a historical format. rdar://35778019 Reviewers: enderby Reviewed By: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40867 llvm-svn: 320166
* Fix a crash in llvm-objdump when printing a bad x86_64 relocation in a Mach-OKevin Enderby2017-11-032-0/+3
| | | | | | | | file with a bad section number. rdar://35207539 llvm-svn: 317373
* Update test:Konstantin Zhuravlyov2017-08-311-1/+1
| | | | | | | | - REQUIRES: x86_64-linux -> REQUIRES: shell Differential Revision: https://reviews.llvm.org/D37316 llvm-svn: 312245
* Fix test after rL312144Konstantin Zhuravlyov2017-08-301-1/+1
| | | | llvm-svn: 312176
* Updated llvm-objdump symbolic disassembly with x86_64 Mach-O MH_KEXT_BUNDLEKevin Enderby2017-06-222-0/+9
| | | | | | | | | file types so it symbolically disassembles operands using the external relocation entries. rdar://31521343 llvm-svn: 306037
* Updated llvm-objdump with Mach-O files and the -objc-meta-data option soKevin Enderby2017-06-201-2/+2
| | | | | | | | that it symbolically prints the superclass when it has dyld bind info for it. rdar://7638823 llvm-svn: 305866
* Change llvm-objdump with Mach-O files and the -info-plist option with theKevin Enderby2017-06-201-0/+4
| | | | | | | | -no-leading-headers option so that it does not print the leading header. rdar://27378808 llvm-svn: 305849
* [llvm-objdump] Don't attempt to print lines beyond the end of filePetr Hosek2017-04-252-0/+27
| | | | | | | | | | | | | This may trigger a segfault in llvm-objdump when the line number stored in debug infromation points beyond the end of file; lines in LineBuffer are stored in std::vector which is allocated in chunks, so even if the debug info points beyond the end of the file, this doesn't necessarily trigger the segfault unless the line number points beyond the allocated space. Differential Revision: https://reviews.llvm.org/D32466 llvm-svn: 301347
* Add the rest of the error checking for Mach-O dyld compact bind entry errorsKevin Enderby2017-03-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | and test cases for each of the error checks. To do this more plumbing was needed so that the segment indexes and segment offsets can be checked. Basically what was done was the SegInfo from llvm-objdump’s MachODump.cpp was moved into libObject for Mach-O objects as BindRebaseSegInfo and it is only created when an iterator for bind or rebase entries are created. This commit really only adds the error checking and test cases for the bind table entires and the checking for the lazy bind and weak bind entries are still to be fully done as well as the rebase entires. Though some of the plumbing for those are added with this commit. Those other error checks and test cases will be added in follow on commits. Note, the two llvm_unreachable() calls should now actually be unreachable with the error checks in place and would take a logic bug in the error checking code to be reached if the segment indexes and segment offsets are used from a checked bind entry. Comments have been added to the methods that require the arguments to have been checked prior to calling. llvm-svn: 298292
* Tweak the implementation of llvm-objdump’s -objc-meta-data option soKevin Enderby2017-02-092-0/+62
| | | | | | | | | that it works when the ObjC metadata sections end up in the __DATA_CONST or __DATA_DIRTY segments. rdar://26315238 llvm-svn: 294599
* Move test from r294430 to target-specific directoryDiana Picus2017-02-082-0/+10
| | | | | | | The test is X86-specific, and it broke on the ARM bots because they don't build the X86 target. llvm-svn: 294446
* Fix a bug in llvm-obdump(1) with the -macho and -info-plist optionsKevin Enderby2017-02-061-0/+10
| | | | | | | | | which caused it to print more than the (__TEXT,__info_plist) if that section did not end with a null. rdar://27378808 llvm-svn: 294236
* Fix a bug in llvm-obdump(1) with the -macho and -disassemble optionsKevin Enderby2017-02-062-0/+8
| | | | | | | | | | which caused it to not disassemble the bytes a the start of the section if the section had symbols and the first symbol was not at the start of the section. rdar://30143243 llvm-svn: 294212
* Fix a bug in llvm-obdump(1) with the -objc-meta-data flag with -machoKevin Enderby2017-02-032-0/+3
| | | | | | | | which caused a hang on a malformed binary with bad bind info. rdar://29672108 llvm-svn: 294021
* Fix a bug in llvm-obdump(1) with the -macho flag disassembling an objectKevin Enderby2017-01-312-0/+3
| | | | | | | | | | | | | without symbols that makes calls through a symbol stub which were not correctly being annotated with “## symbol stub for: _foo”. Just adds the same parameters for getting the annotations from DisAsm->getInstruction() and passing them to IP->printInst() from the code above when boolean variable symbolTableWorked was true. rdar://29791952 llvm-svn: 293662
* Add support for the x86_thread_state32_t andKevin Enderby2017-01-232-0/+11
| | | | | | | | | | | | | in llvm-objdump for Mach-O files add the printing of the x86_thread_state32_t in the same format as otool-classic(1) on darwin. To do this the 32-bit x86 general tread state needed to be defined in include/llvm/Support/MachO.h . rdar://30110111 llvm-svn: 292829
* Add LC_BUILD_VERSION load commandSteven Wu2017-01-232-0/+101
| | | | | | | | | | | | | | | | | | | Summary: Add a new load command LC_BUILD_VERSION. It is a generic version of LC_*_VERSION_MIN load_command used on Apple platforms. Instead of having a seperate load command for each platform, LC_BUILD_VERSION is recording platform info as an enum. It also records SDK version, min_os, and tools that used to build the binary. rdar://problem/29781291 Reviewers: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29044 llvm-svn: 292824
* Add support for the new LC_NOTE load command.Kevin Enderby2017-01-192-0/+8
| | | | | | | | | | It describes a region of arbitrary data included in a Mach-O file. Its initial use is to record extra data in MH_CORE files. rdar://30001545 rdar://30001731 llvm-svn: 292500
* [llvm-objdump tests] Copy the inputs of tests closer to tests.Krasimir Georgiev2017-01-175-3/+3
| | | | | | | | | | | | | | | | | Summary: Tests under tools/llvm-objdump should not use inputs from Object. Copied the required inputs and aligned the new tests to be more consistent with the existing tests in this respect. Reviewers: ioeric Reviewed By: ioeric Subscribers: davide, djasper, cfe-commits Differential Revision: https://reviews.llvm.org/D28799 llvm-svn: 292222
* [llvm-objdump] Dump PT_NOTE as part of -p.Davide Italiano2017-01-161-0/+14
| | | | | PR: 31641 llvm-svn: 292170
* [llvm-objdump] Dump PT_GNU_RELRO as part of -p.Davide Italiano2017-01-161-0/+18
| | | | | PR: 31641 llvm-svn: 292169
* [llvm-objdump] Dump PT_OPENBSD_{BOOTDATA,RANDOMIZE,WXNEEDED}.Davide Italiano2017-01-161-0/+20
| | | | | PR: 31641 llvm-svn: 292167
* [IR] Remove the DIExpression field from DIGlobalVariable.Adrian Prantl2016-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements PR31013 by introducing a DIGlobalVariableExpression that holds a pair of DIGlobalVariable and DIExpression. Currently, DIGlobalVariables holds a DIExpression. This is not the best way to model this: (1) The DIGlobalVariable should describe the source level variable, not how to get to its location. (2) It makes it unsafe/hard to update the expressions when we call replaceExpression on the DIGLobalVariable. (3) It makes it impossible to represent a global variable that is in more than one location (e.g., a variable with multiple DW_OP_LLVM_fragment-s). We also moved away from attaching the DIExpression to DILocalVariable for the same reasons. This reapplies r289902 with additional testcase upgrades and a change to the Bitcode record for DIGlobalVariable, that makes upgrading the old format unambiguous also for variables without DIExpressions. <rdar://problem/29250149> https://llvm.org/bugs/show_bug.cgi?id=31013 Differential Revision: https://reviews.llvm.org/D26769 llvm-svn: 290153
* Revert "[IR] Remove the DIExpression field from DIGlobalVariable."Adrian Prantl2016-12-161-1/+1
| | | | | | | | | | | | | | | | | This reverts commit 289920 (again). I forgot to implement a Bitcode upgrade for the case where a DIGlobalVariable has not DIExpression. Unfortunately it is not possible to safely upgrade these variables without adding a flag to the bitcode record indicating which version they are. My plan of record is to roll the planned follow-up patch that adds a unit: field to DIGlobalVariable into this patch before recomitting. This way we only need one Bitcode upgrade for both changes (with a version flag in the bitcode record to safely distinguish the record formats). Sorry for the churn! llvm-svn: 289982
* [IR] Remove the DIExpression field from DIGlobalVariable.Adrian Prantl2016-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements PR31013 by introducing a DIGlobalVariableExpression that holds a pair of DIGlobalVariable and DIExpression. Currently, DIGlobalVariables holds a DIExpression. This is not the best way to model this: (1) The DIGlobalVariable should describe the source level variable, not how to get to its location. (2) It makes it unsafe/hard to update the expressions when we call replaceExpression on the DIGLobalVariable. (3) It makes it impossible to represent a global variable that is in more than one location (e.g., a variable with multiple DW_OP_LLVM_fragment-s). We also moved away from attaching the DIExpression to DILocalVariable for the same reasons. This reapplies r289902 with additional testcase upgrades. <rdar://problem/29250149> https://llvm.org/bugs/show_bug.cgi?id=31013 Differential Revision: https://reviews.llvm.org/D26769 llvm-svn: 289920
* Add to llvm-objdump the -no-leading-headers option with the use of the ↵Kevin Enderby2016-11-291-0/+4
| | | | | | | | | | | | | -macho option. In some cases the leading headers of the file name, archive member and architecture slice name in the output of lvm-objdump is not wanted so the tool’s output can be directly used by scripts. This matches the -X option of the Apple otool(1) program. rdar://28491674 llvm-svn: 288199
* General clean up of error handling in llvm-objdump to remove its use of ↵Kevin Enderby2016-11-161-0/+3
| | | | | | | | | | | | | | | | | | report_fatal_error(). No real functional change with this commit. The problem with report_fatal_error() is it does not include the tool name and the file name the for which the error message was generated. Uses of report_fatal_error() were change to report_error() or error() to get a better error and to make the code smaller and cleaner. Also changed things like error(errorToErrorCode(SOrErr.takeError())) to use report_error() with a file name and the llvm::Error (as well as the ArchitectureName if available) so the error message is printed. llvm-svn: 287163
* General clean up of Mach-O error handling in llvm-objdump.Kevin Enderby2016-11-154-0/+9
| | | | | | | | | | | | | | | | | | | | | To get a good error message for all files that could contain Mach-O files the code in llvm-objdump needs to use the archive member name and name of the architecture of a slice of a universal file in those cases where the error come from a Mach-O file in an archive or a universal file. Most of this is fixed by moving the call to checkSymbolTable() into ProcessMachO() and calling it when the operation needs the symbol table. And then calling the form of report_error() that has the ArchiveName and ArchitectureName arguments. One other place needed to call this form of report_error() also with these arguments. Also changed the code in MachODump.cpp to not use report_fatal_error() and use report_error() instead to make the code smaller and cleaner. All cases of this are for errors with the symbol table which should now never be tripped since checkSymbolTable() should be called first to get a good error message in these cases. llvm-svn: 287050
* Add a checkSymbolTable() method to the MachOObjectFile class.Kevin Enderby2016-11-145-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The philosophy of the error checking in libObject for Mach-O files is that the constructor will check the load commands so for their tables the offsets and sizes are properly contained in the file. But there is no checking of the entries of any of the tables. For the contents of the tables themselves the methods accessing the contents of the entries return errors as needed. In some cases this however makes it difficult or cumbersome to produce a good error message which would include the tool name, file name, archive member, and name of the architecture of a slice of a universal file the error occurred in. So idea is that there will be a method to check a table which can be called up front before using it allowing a good error message to be produced before a table is used. And if only verification of the Mach-O file and its tables are wanted a new possible method checkAllTables() could be added to call all of the methods to check all the tables at some time when such methods exist. The checkSymbolTable() is the first of such methods to check one of the Mach-O file tables. This method initially will used in llvm-objdump’s DisassembleMachO() routine before it gets the section and symbol information. As if there are problems with the symbol table currently the error is first encountered by the bool operator() in the SymbolSorter() struct which passed to std::sort(). In this case there is no context as to the file name the symbol which results a poor error message: LLVM ERROR: truncated or malformed object (bad string index: 22 for symbol at index 1) with the added call to the checkSymbolTable() method the error message includes the tool name and file name: llvm-objdump: 'macho-invalid-symbol-strx': truncated or malformed object (bad string table index: 22 past the end of string table, for symbol at index 1) llvm-svn: 286887
* Add the rest of the additional error checks for invalid Mach-O files whenKevin Enderby2016-11-021-9/+9
| | | | | | | | | | the offsets and sizes of an element of the Mach-O file overlaps with another element in the Mach-O file. Some other tests for malformed Mach-O files now run into these checks so their tests were also adjusted. llvm-svn: 285860
* DebugInfo: New metadata representation for global variables.Peter Collingbourne2016-09-131-2/+2
| | | | | | | | | | | | | This patch reverses the edge from DIGlobalVariable to GlobalVariable. This will allow us to more easily preserve debug info metadata when manipulating global variables. Fixes PR30362. A program for upgrading test cases is attached to that bug. Differential Revision: http://reviews.llvm.org/D20147 llvm-svn: 281284
* Fix test failure in r281232Hemant Kulkarni2016-09-122-0/+102
| | | | llvm-svn: 281240
* Add an c++ itanium demangler to llvm.Rafael Espindola2016-09-061-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a copy of the demangler in libcxxabi. The code also has no dependencies on anything else in LLVM. To enforce that I added it as another library. That way a BUILD_SHARED_LIBS will fail if anyone adds an use of StringRef for example. The no llvm dependency combined with the fact that this has to build on linux, OS X and Windows required a few changes to the code. In particular: No constexpr. No alignas On OS X at least this library has only one global symbol: __ZN4llvm16itanium_demangleEPKcPcPmPi My current plan is: Commit something like this Change lld to use it Change lldb to use it as the fallback Add a few #ifdefs so that exactly the same file can be used in libcxxabi to export abi::__cxa_demangle. Once the fast demangler in lldb can handle any names this implementation can be replaced with it and we will have the one true demangler. llvm-svn: 280732
* llvm-objdump: ELF: Handle code and data mix in all scenariosHemant Kulkarni2016-08-251-0/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D23621 llvm-svn: 279770
* Really fix the issue with 502957cc9cf805dc6093950e8cdcd0db4969d933. Windows ↵Hemant Kulkarni2016-08-151-0/+1
| | | | | | %p and FileCheck limitations makes the test linux only llvm-svn: 278748
* Fix a test that failed due to:Hemant Kulkarni2016-08-151-1/+1
| | | | | | https://llvm.org/svn/llvm-project/llvm/trunk@278725 91177308-0d34-0410-b5e6-96231b3b80d8 llvm-svn: 278732
* llvm-objdump: Implement source[line numbers] interleavingHemant Kulkarni2016-08-152-0/+81
| | | | | | Differential Revsion: https://reviews.llvm.org/D22932 llvm-svn: 278725
* Next set of additional error checks for invalid Mach-O files.Kevin Enderby2016-08-121-9/+9
| | | | | | | | | | This contains the two missing checks for LC_SEGMENT load command fields. And checks for the Mach-O sections fields that would make them invalid. With the new checks, some of the existing malformed file checks now trips one of these instead of the issue it was having before so those tests were adjusted. llvm-svn: 278557
* llvm-objdump: handle stubbed and malformed dylibs betterTim Northover2016-07-144-0/+12
| | | | | | | | We were quite happy to read past the end of the valid section data when disassembling. Instead we entirely skip stub dylibs, and tell the user what's happened if their section only has partial data. llvm-svn: 275487
* Update llvm-obdump(1) to print FAT_MAGIC_64 for Darwin’s 64-bit universal ↵Kevin Enderby2016-06-212-0/+6
| | | | | | | | | | | | | files with the -macho and -universal-headers flags. Just a follow on to r273207, I missed updating the printing of the fat magic number when the universal file is a 64-bit universal file. rdar://26899493 llvm-svn: 273324
* Fix llvm-objdump when disassembling a stripped Mach-O binary with the -macho ↵Kevin Enderby2016-06-153-0/+12
| | | | | | | | | | | | | | | | | | option. It was printing out nothing in this case. llvm-objdump tries to disassemble sections a symbol at a time. In the case of a fully stripped Mach-O executable the only symbol remaining in the (__TEXT,__text) section is the special linker defined symbol __mh_execute_header . This symbol is special in that while it is N_SECT symbol in the (__TEXT,__text) its address is before the start of the (__TEXT,__text). It’s address is the start of the __TEXT segment which is where the mach header is statically linked. So the code in DisassembleMachO() needs to deal with this case specially. rdar://26778273 llvm-svn: 272837
* Fix a bug in llvm-objdump for -private-headers printing the ↵Kevin Enderby2016-04-282-0/+7
| | | | | | | | LC_CODE_SIGNATURE Mach-O load command. rdar://25985653 llvm-svn: 267940
* Revert r265817Colin LeMahieu2016-04-088-23/+23
| | | | | | lld tests need to be addressed. llvm-svn: 265822
* [llvm-objdump] Printing hex instead of dec by defaultColin LeMahieu2016-04-088-23/+23
| | | | | | Differential Revision: http://reviews.llvm.org/D18770 llvm-svn: 265817
* Revert "[llvm-objdump] Printing relocations in executable and shared object ↵Rafael Espindola2016-03-212-9/+0
| | | | | | | | | files. This partially reverts r215844 by removing test objdump-reloc-shared.test which stated GNU objdump doesn't print relocations, it does." This reverts commit r263971. It produces the wrong results for .rela.dyn. I will add a test. llvm-svn: 263987
OpenPOWER on IntegriCloud