Commit Graph

336 Commits

Author SHA1 Message Date
Kevin Enderby cd66be5dda Add the option, -info-plist to llvm-objdump used with -macho to print the
Mach-O info plist section as strings.

llvm-svn: 231974
2015-03-11 22:06:32 +00:00
Benjamin Kramer f044d3f93b Make helper functions static.
Found by -Wmissing-prototypes. NFC.

llvm-svn: 231664
2015-03-09 16:23:46 +00:00
Kevin Enderby 578fe5a303 Add code to llvm-objdump so the -section option with -macho will dump literal pointer sections
with the Mach-O S_LITERAL_POINTERS section type.

Also fix the printing of the leading addresses for literal sections to be consistent and
not print the 0x prefix.  Updated test cases to match.

llvm-svn: 229548
2015-02-17 21:35:48 +00:00
Kevin Enderby 74b43cb403 Add code to llvm-objdump so the -section option with -macho will dump literal
sections with the Mach-O S_{4,8,16}BYTE_LITERALS section types.

llvm-svn: 228465
2015-02-06 23:25:38 +00:00
Sylvestre Ledru 648cced01c Identical code for different branches (CID 1254883)
Reviewers: kledzik, rafael

Reviewed By: rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6303

llvm-svn: 228313
2015-02-05 17:00:23 +00:00
Sylvestre Ledru fe0c7ad852 revert 228308. The code has changed since the review
llvm-svn: 228309
2015-02-05 16:35:44 +00:00
Sylvestre Ledru d0ee6daffd Identical code for different branches (CID 1254883)
Reviewers: kledzik, rafael

Reviewed By: rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6303

llvm-svn: 228308
2015-02-05 16:30:25 +00:00
Kevin Enderby 10ba041188 Add code to llvm-objdump so the -section option with -macho will dump ‘C’ string
sections with the Mach-O S_CSTRING_LITERALS section type.

llvm-svn: 228198
2015-02-04 21:38:42 +00:00
Kevin Enderby 95df54c819 Add code to llvm-objdump so the -section option with -macho will disassemble sections
that have attributes indicating they contain instructions.

llvm-svn: 228101
2015-02-04 01:01:38 +00:00
Kevin Enderby f6d258537d Add the -section option to llvm-objdump used with -macho that takes the argument
segname,sectname to specify a Mach-O section to print.  The printing is based on
the section type or section attributes.

The printing of the module initialization and termination section types is printed
with this change.  Printing of other section types will be added next.

llvm-svn: 227649
2015-01-31 00:37:11 +00:00
Zachary Turner 82af9438d0 Move DebugInfo to DebugInfo/DWARF.
In preparation for adding PDB support to LLVM, this moves the
DWARF parsing code to its own subdirectory under DebugInfo, and
renames LLVMDebugInfo to LLVMDebugInfoDWARF.

This is purely a mechanical / build system change.

Differential Revision: http://reviews.llvm.org/D7269
Reviewed by: Eric Christopher

llvm-svn: 227586
2015-01-30 18:07:45 +00:00
Kevin Enderby 9a50944ca0 dd the option, -link-opt-hints to llvm-objdump used with -macho to print the
Mach-O AArch64 linker optimization hints for ADRP code optimization.

llvm-svn: 227246
2015-01-27 21:28:24 +00:00
Kevin Enderby 479ee6135d Fix the problem with llvm-objdump and -archive-headers in printing the archive header size field.
This problem showed up with the clang-cmake-armv7-a15-full bot.  Thanks to Renato Golin for his help.

llvm-svn: 226936
2015-01-23 21:02:44 +00:00
Colin LeMahieu bc2f47a76e [Objdump] Output information about common symbols in a way closer to GNU objdump.
llvm-svn: 226932
2015-01-23 20:06:24 +00:00
Kevin Enderby 69fe98da14 Add the option, -data-in-code, to llvm-objdump used with -macho to print the Mach-O data in code table.
llvm-svn: 226921
2015-01-23 18:52:17 +00:00
Kevin Enderby a7bdc7e671 Add the option, -indirect-symbols, used with -macho to print the Mach-O indirect symbol table to llvm-objdump.
llvm-svn: 226848
2015-01-22 18:55:27 +00:00
Kevin Enderby 98da6136d0 For llvm-objdump, hook up existing options to work when using -macho (the Mach-O parser).
llvm-svn: 226612
2015-01-20 21:47:46 +00:00
David Blaikie 186db431c0 unique_ptrify the RelInfo parameter to TargetRegistry::createMCSymbolizer
llvm-svn: 226416
2015-01-18 20:45:48 +00:00
Kevin Enderby c1271893af Fix the Archive::Child::getRawSize() method used by llvm-objdump’s -archive-headers option
and tweak its use in llvm-objdump.  Add back the test case for the -archive-headers option.

llvm-svn: 226332
2015-01-16 22:10:36 +00:00
Kevin Enderby 13023a1af6 Add the option, -archive-headers, used with -macho to print the Mach-O archive headers to llvm-objdump.
llvm-svn: 226228
2015-01-15 23:19:11 +00:00
Chandler Carruth d9903888d9 [cleanup] Re-sort all the #include lines in LLVM using
utils/sort_includes.py.

I clearly haven't done this in a while, so more changed than usual. This
even uncovered a missing include from the InstrProf library that I've
added. No functionality changed here, just mechanical cleanup of the
include order.

llvm-svn: 225974
2015-01-14 11:23:27 +00:00
Kevin Enderby 0512bd75f7 Fix an ASAN failure introduced with r225537 (adding the -universal-headers to llvm-obdump).
And a fly by fix to some formatting issues with the same commit.

llvm-svn: 225550
2015-01-09 21:55:03 +00:00
Kevin Enderby 131d1770f6 Add the option, -universal-headers, used with -macho to print the Mach-O universal headers to llvm-objdump.
llvm-svn: 225537
2015-01-09 19:22:37 +00:00
Kevin Enderby 66d51fc41a Run clang-format on tools/llvm-objdump/MachODump.cpp again as some of my
previous changes got in with incorrect formatting. No functional change.

llvm-svn: 225417
2015-01-08 00:25:24 +00:00
Kevin Enderby e2297ddd11 Slightly refactor things for llvm-objdump and the -macho option so it can be used with
options other than just -disassemble so that universal files can be used with other
options combined with -arch options.

No functional change to existing options and use.  One test case added for the
additional functionality with a universal file an a -arch option.

llvm-svn: 225383
2015-01-07 21:02:18 +00:00
Filipe Cabecinhas e71bd0c89b Don't loop endlessly for MachO files with 0 ncmds
llvm-svn: 225271
2015-01-06 17:08:26 +00:00
Kevin Enderby aefb00337f Another attempt to fix the LLVM Windows build bot lld-x86_64-win7, one last place to fix I think.
llvm-svn: 224794
2014-12-24 00:16:51 +00:00
Kevin Enderby 227df348cc Attempt to fix the LLVM Windows build bot lld-x86_64-win7.
llvm-svn: 224793
2014-12-23 23:43:59 +00:00
Kevin Enderby 48ef534b74 Add printing the LC_THREAD load commands with llvm-objdump’s -private-headers.
llvm-svn: 224792
2014-12-23 22:56:39 +00:00
David Majnemer d4449ed0f2 strnlen isn't available on some platforms, use StringRef instead
llvm-svn: 224679
2014-12-20 08:24:43 +00:00
Kevin Enderby 52e4ce4a53 Add printing the LC_ROUTINES load commands with llvm-objdump’s -private-headers.
llvm-svn: 224627
2014-12-19 22:25:22 +00:00
Kevin Enderby 186eac3c0c Add printing the LC_SUB_CLIENT load command with llvm-objdump’s -private-headers.
llvm-svn: 224616
2014-12-19 21:06:24 +00:00
Kevin Enderby 36c8d3ae63 Add printing the LC_SUB_LIBRARY load command with llvm-objdump’s -private-headers.
llvm-svn: 224607
2014-12-19 19:48:16 +00:00
Kevin Enderby a2bd8d98a1 Add printing the LC_SUB_UMBRELLA load command with llvm-objdump’s -private-headers.
llvm-svn: 224548
2014-12-18 23:13:26 +00:00
Kevin Enderby b4b7931748 Add printing the LC_SUB_FRAMEWORK load command with llvm-objdump’s -private-headers.
llvm-svn: 224534
2014-12-18 19:24:35 +00:00
Kevin Enderby d0b6b7fb7f Add printing the LC_LINKER_OPTION load command with llvm-objdump’s -private-headers.
Also corrected the name of the load command to not end in an ’S’ as well as corrected
the name of the MachO::linker_option_command struct and other places that had the
word option as plural which did not match the Mac OS X headers.

llvm-svn: 224485
2014-12-18 00:53:40 +00:00
Rafael Espindola 839353bca0 Remove unused includes and out of date comment. NFC.
llvm-svn: 224413
2014-12-17 03:07:20 +00:00
Kevin Enderby 57538299e8 Add printing the LC_ENCRYPTION_INFO_64 load command with llvm-objdump’s -private-headers
and add tests for the two AArch64 binaries.

llvm-svn: 224400
2014-12-17 01:01:30 +00:00
Kevin Enderby 0804f467f2 Add printing the LC_ENCRYPTION_INFO load command with llvm-objdump’s -private-headers.
llvm-svn: 224390
2014-12-16 23:25:52 +00:00
Kevin Enderby 1ff0ecc7a1 Fix a bug in llvm-objdump’s -private-headers for the LC_VERSION_MIN_IPHONEOS
load command not getting printed.

llvm-svn: 224376
2014-12-16 21:48:27 +00:00
Kevin Enderby 75594b6142 Fix another use of PRIx32 that should have been PRIx64.
llvm-svn: 224368
2014-12-16 21:00:25 +00:00
Kevin Enderby adb7c43c40 Fix the arm build bots for a test that was added. A printing routine was incorrectly using PRIx32
when it should have been using PRIx64 for the value that was passed as uint64_t .

llvm-svn: 224350
2014-12-16 18:58:11 +00:00
Kevin Enderby c971338def Fix a bug in llvm-objdump’s -private-headers for 32-bit Mach-O files
printing the section header.  And add some tests for this for 32-bit files.

llvm-svn: 224302
2014-12-16 01:14:45 +00:00
Rafael Espindola 0bfe828f7a Return ErrorOr<std::unique_ptr<Archive>> form getAsArchive.
This is the same return type of Archive::create.

llvm-svn: 223827
2014-12-09 21:05:36 +00:00
Kevin Enderby ef3ad2ff32 Re-add support to llvm-objdump for Mach-O universal files and archives with -macho
with fixes.  Includes the move of tests for llvm-objdump for universal files to an X86
directory.  And the fix where it was failing on linux Rafael tracked down with asan.
I had both Jim Grosbach and Adam Hemet look over the second fix since I could not
set up asan to reproduce with the old version but not with the fix.

llvm-svn: 223416
2014-12-04 23:56:27 +00:00
Jean-Daniel Dupas 00cc1f5cab Add mach-o LC_RPATH support to llvm-objdump
Summary: Add rpath load command support in Mach-O object and update llvm-objdump to use it.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6512

llvm-svn: 223343
2014-12-04 07:37:02 +00:00
Rafael Espindola de882cd1c7 This reverts commit r223306 and r223277.
The code is using uninitialized memory and failing on linux.

llvm-svn: 223315
2014-12-03 23:29:34 +00:00
Kevin Enderby 3f0ffab2b0 Add support to llvm-objdump for Mach-O universal files and archives with -macho.
llvm-svn: 223277
2014-12-03 22:29:40 +00:00
Rui Ueyama 98fe58a3a7 Object/COFF: Fix off-by-one error for object having lots of relocations
llvm-objdump printed out an error message for this off-by-one error,
but because it always exits with 0 whether or not it found an error,
the test (llvm-objdump/coff-many-relocs.test) succeeded.
I made llvm-objdump exit with EXIT_FAILURE when an error is found.

llvm-svn: 222852
2014-11-26 22:17:25 +00:00
Kevin Enderby 10738229c9 Fix Use-of-uninitialized-value for adrp_addr and adrp_inst in MachODump.cpp
Fixes PR21607

llvm-svn: 222385
2014-11-19 20:20:16 +00:00