372 Commits

Author SHA1 Message Date
Fangrui Song
029dd82a55 [llvm-objdump] Migrate some functions from std::error_code to Error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357965 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 05:41:24 +00:00
Shoaib Meenai
c9c739b63f [BinaryFormat] Update Mach-O ARM64E CPU subtype and dumping
The new value is taken from <mach/machine.h> in the MacOSX10.14 SDK from
Xcode 10.1. Update llvm-objdump and llvm-readobj accordingly.

Differential Revision: https://reviews.llvm.org/D58636

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357945 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 21:37:08 +00:00
Fangrui Song
7ac74fb0ca [llvm-objdump] Migrate relocation handling functions from error_code to Error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357920 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 16:24:08 +00:00
Fangrui Song
582aba066d [llvm-objdump] Simplify Expected<T> handling with unwrapOrError
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357855 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 08:19:55 +00:00
Fangrui Song
9cc714957f Change some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromStringRef()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357852 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 03:58:42 +00:00
Alexey Lapshin
a15cff122c [DebugInfo] add SectionedAddress to DebugInfo interfaces.
That patch is the fix for https://bugs.llvm.org/show_bug.cgi?id=40703
   "wrong line number info for obj file compiled with -ffunction-sections"
   bug. The problem happened with only .o files. If object file contains
   several .text sections then line number information showed incorrectly.
   The reason for this is that DwarfLineTable could not detect section which
   corresponds to specified address(because address is the local to the
   section). And as the result it could not select proper sequence in the
   line table. The fix is to pass SectionIndex with the address. So that it
   would be possible to differentiate addresses from various sections. With
   this fix llvm-objdump shows correct line numbers for disassembled code.

   Differential review: https://reviews.llvm.org/D58194

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354972 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 13:17:36 +00:00
Matthew Voss
26dfbddae1 Revert "Revert "[llvm-objdump] Allow short options without arguments to be grouped""
- Tests that use multiple short switches now test them grouped and ungrouped.

  - Ensure the output of ungrouped and grouped variants is identical

Differential Revision: https://reviews.llvm.org/D57904

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354375 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-19 19:46:08 +00:00
Matthew Voss
1854768f0f Revert "[llvm-objdump] Allow short options without arguments to be grouped"
Reverted due to failures on the llvm-hexagon-elf.

This reverts commit 77e1f27476c89f65eeb496d131065177e6417f23.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354002 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-14 01:39:43 +00:00
Matthew Voss
dce0292ccb [llvm-objdump] Allow short options without arguments to be grouped
Summary:

https://bugs.llvm.org/show_bug.cgi?id=31679

Reviewers: kristina, jhenderson, grimar, jakehehrlich, rupprecht

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D57904

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353998 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-14 00:39:40 +00:00
Chandler Carruth
6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
George Rimar
605942eacd [llvm-objdump] - Move getRelocationValueString and dependenices out of the llvm-objdump.cpp
getRelocationValueString is a dispatcher function that calls the
corresponding ELF/COFF/Wasm/MachO implementations
that currently live in the llvm-objdump.cpp file.

These implementations better be moved to ELFDump.cpp,
COFFDump.cpp and other corresponding files, to move platform specific
implementation out from the common logic.

The patch does that. Also, I had to move ToolSectionFilter helper
and SectionFilterIterator, SectionFilter to a header to make them
available across the objdump code.

Differential revision: https://reviews.llvm.org/D56842

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351545 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-18 11:33:26 +00:00
Michael Trent
e9414c26ce llvm-objdump -m -D should disassemble all text segments
Summary:
When running llvm-objdump with the -macho option objdump will by default
disassemble only the __TEXT,__text section (or __TEXT_EXEC,__text when
disassembling MH_KEXT_BUNDLE files). The -disassemble-all option is
treated no diferently than -disassemble.

This change upates llvm-objdump's MachO parsing code to disassemble all
__text sections found in a file when -disassemble-all is specified. This
is useful for disassembling files with more than one __text section, or
when disassembling files whose __text section is not present in __TEXT.

I added a lit test case that verifies "llvm-objdump -m -d" and 
"llvm-objdump -m -D" produce the expected results on a reference binary. 
I also updated the CommandGuide documentation for llvm-objdump.rst and
verified it renders correctly as man and html.

rdar://42899338

Reviewers: ab, pete, lhames

Reviewed By: lhames

Subscribers: rupprecht, llvm-commits

Differential Revision: https://reviews.llvm.org/D56649

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351238 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 20:41:30 +00:00
George Rimar
45d116d45e [llvm-objdump] - Cleanup the code. NFCI.
This is a cosmetic cleanup for the llvm-objdump code.

This patch:
* Renames things to match the official LLVM code style (lower case -> upper case).
* Removes few obviously excessive variables.
* Moves a few lines closer to the place of use, reorders the code a bit to simplify it,
to avoid doing excessive returns and to avoid using 'else` after returns.

I focused only on a llvm-objdump.h/llvm-objdump.cpp files. Few changes in the
MachODump.cpp and COFFDump.cpp are a result of llvm-objdump.h modification.

Differential revision: https://reviews.llvm.org/D56637

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351171 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 09:19:18 +00:00
Francis Visoiu Mistrih
b40f52c029 [llvm-objdump][MachO] Fix error reporting after r350848 and r350849
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350851 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-10 17:36:54 +00:00
Francis Visoiu Mistrih
74733b9cac [llvm-objdump][MachO] Use the -dsym file name when reporting errors
Instead of using the binary filename.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350849 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-10 17:16:42 +00:00
Francis Visoiu Mistrih
c54f433f45 [llvm-objdump][MachO] Correctly handle the llvm::Error when -dsym has errors
In an assert build, the Error gets destroyed and we get "Program aborted
due to an unhandled Error:".

In release, we get an empty message.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350848 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-10 17:16:37 +00:00
Jordan Rupprecht
f6ea1298bb [binutils] NFC: fix clang-tidy warning: use empty() instead of size() == 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349710 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-20 00:57:06 +00:00
Michael Trent
f66defb43a Update the Swift version numbers reported by objdump
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348632 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-07 19:55:03 +00:00
Jonas Devlieghere
8e8485eda3 [llvm-objdump] Use WithColor for error reporting
Use helpers from Support/WithError.h to print errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346623 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-11 22:12:04 +00:00
Fangrui Song
3b35e17b21 llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343163 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-27 02:13:45 +00:00
Francis Visoiu Mistrih
73e2113025 [llvm-objdump] Keep the memory buffer from the dSYM alive when using -g -dsym
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341209 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-31 13:10:54 +00:00
Fangrui Song
18aa36fa4f [llvm-objdump] Remove continue after report_error which is unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338951 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-04 05:19:00 +00:00
Dave Lee
58b1de483d objdump: Better handling of Mach-O universal binaries
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338792 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03 00:06:38 +00:00
Dave Lee
145133c348 Reapply: "objdump: Support newer ObjC image info flags"
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336411 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06 05:11:35 +00:00
Dave Lee
d20537eca5 Revert "objdump: Support newer ObjC image info flags"
This reverts commit 8c4cc472e7a67bd3b2b20cc4cf32d31af29bc7e9.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336402 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-06 00:13:21 +00:00
Dave Lee
8c4cc472e7 objdump: Support newer ObjC image info flags
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336399 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 23:32:15 +00:00
Paul Semel
fd46678873 [llvm-objdump] Add --archive-headers (-a) option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336357 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 14:43:29 +00:00
Adrian Prantl
26b584c691 Remove \brief commands from doxygen comments.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331272 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-01 15:54:18 +00:00
Gerolf Hoflehner
c475d7913d [llvm-objdump] Issue error message when object file cannot be created
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330364 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-19 20:48:35 +00:00
Mandeep Singh Grang
4ead3eb171 [tools] Change std::sort to llvm::sort in response to r327219
Summary:
r327219 added wrappers to std::sort which randomly shuffle the container before sorting.
This will help in uncovering non-determinism caused due to undefined sorting
order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.

Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort.
Refer the comments section in D44363 for a list of all the required patches.

Reviewers: JDevlieghere, zturner, echristo, dberris, friss

Reviewed By: echristo

Subscribers: gbedwell, llvm-commits

Differential Revision: https://reviews.llvm.org/D45141

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328943 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-01 21:24:53 +00:00
Kevin Enderby
a17a5fa0b6 For llvm-objdump and Mach-O files, fix the printing of module init and
term sections from .o files to look to see if the pointers have a relocation
entry and if so print the symbol name from the relocation entry.  If not fall
back to the existing code and use the pointer value to look up that value
in the symbol table.

rdar://38337506


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328037 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20 20:29:52 +00:00
Kevin Enderby
0e9471b453 For llvm-objdump and Mach-O files, update the printing of some thread states
from core files.  I tested this against the couple of core files that were
getting errors about unknown thread flavors and it now produce the same output as
the Xcode otool-classic(1) tool.  Since the core files are huge I didn’t include
them as test cases.

rdar://38216356


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327077 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08 23:10:38 +00:00
David Blaikie
adbbd24452 [llvm-objdump] Use unique_ptr to simplify memory ownership
Followup to r325099/r325100 to simplify further.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325612 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-20 18:48:51 +00:00
Serge Pavlov
e019ebf361 Use delete[] instead of free
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325100 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-14 06:14:30 +00:00
Serge Pavlov
fef5198e5c Use delete[] to deallocate array of chars
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325099 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-14 05:14:31 +00:00
Serge Pavlov
35abcb5e69 Refactor DisassembleInfo in MachODump.cpp
The change implements constructor of DisassembleInfo to avoid duplication
of initialization code and gets rid of malloc/free where possible.

Differential Revision: https://reviews.llvm.org/D43003


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325098 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-14 03:26:27 +00:00
Kevin Enderby
6ccb37f13a llvm-objdump when printing the Objective-C meta data also prints the Swift ABI
from the value stored in swift_version bits in the flags field in the
objc_image_info struct.  ABI version 3 thru 6 were previously added but this
code was not updated to print the Swift version.

rdar://35624067


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324767 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-09 19:31:27 +00:00
Tim Northover
f864e512de llvm-objdump: prevent out of bounds accesses during unwind dumping.
We were a bit too trusting about the offsets encoded in MachO compact unwind
sections, so this passes every access through a bounds check just in case. It
prevents a few segfaults on malformed object files, if one should ever come
along.

Mostly to silence fuzzers in the vague hope they might be able to produce
something useful without the noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323198 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-23 13:51:57 +00:00
Michael Trent
6469bc65e3 Updated llvm-objdump to display local relocations in Mach-O binaries
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320832 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-15 17:57:40 +00:00
Michael Trent
87e8c32e0f reverting out -r320532 because a warning is breaking the lld build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 00:36:13 +00:00
Michael Trent
2aa4a861a6 Updated llvm-objdump to display local relocations in Mach-O binaries
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320532 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 23:53:46 +00:00
Michael Trent
fc1d511f89 Reverting r320166 to fix test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320174 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 19:09:26 +00:00
Michael Trent
bed8c447e4 Updated llvm-objdump to display local relocations in Mach-O binaries
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 17:51:04 +00:00
Michael Trent
59d4cbbf8e Test commit, as per the LLVM Developer Policy.
Commit message, as per the same policy. I added a blank space to the end
of the file. Excelsior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319743 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 07:50:00 +00:00
NAKAMURA Takumi
d8ff2f49ce Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316079 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 13:31:28 +00:00
Francis Ricci
890f4dee43 [llvm-objdump] Use initializer list for scoped xar api constructors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315243 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-09 20:27:14 +00:00
Francis Ricci
5124768496 Guard xar RAII behind HAVE_LIBXAR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315072 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-06 15:54:20 +00:00
Francis Ricci
d7c6322074 [llvm-objdump] Add RAII for xar apis
Summary:
xar_open and xar_iter_new require manual calls to close/free functions
to deallocate resources. This makes it easy to introduce memory leaks,
so add RAII struct wrappers for these resources.

Reviewers: enderby, rafael, compnerd, lhames, dblaikie

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D38598

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-06 15:33:28 +00:00
Reid Kleckner
97ca964f3d [Support] Rename tool_output_file to ToolOutputFile, NFC
This class isn't similar to anything from the STL, so it shouldn't use
the STL naming conventions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314050 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-23 01:03:17 +00:00
Kevin Enderby
4d7a2deb50 Fix a bug in llvm-objdump when disassembling using the wrong default CPU
in the second slice of a Mach-O universal file.

The code in llvm-objdump in in DisassembleMachO() was getting the default
CPU then incorrectly setting into the global variable used for the -mcpu option
if that was not set.  This caused a second call to DisassembleMachO() to use
the wrong default CPU when disassembling the next slice in a Mach-O universal
file.  And would result in bad disassembly and an error message about an
recognized processor for the target:

% llvm-objdump -d -m -arch all  fat.macho-armv7s-arm64 
fat.macho-armv7s-arm64 (architecture armv7s):
(__TEXT,__text) section
armv7:
       0:	60 47 	bx	r12
fat.macho-armv7s-arm64 (architecture arm64):
'cortex-a7' is not a recognized processor for this target (ignoring processor)
'cortex-a7' is not a recognized processor for this target (ignoring processor)
(__TEXT,__text) section
___multc3:
       0:		.long	0x1e620810

rdar://34439149


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313921 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 21:45:02 +00:00