1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

163 Commits

Author SHA1 Message Date
Stepan Dyatkovskiy
7942165053 Fixed llvm-objdump uint64_t formatted output.
llvm-svn: 143120
2011-10-27 18:40:45 +00:00
Owen Anderson
7a9bb4d47f Expand relocation type field to 64 bits. MachO scattered relocations require 33 bits of type info.
llvm-svn: 143032
2011-10-26 17:08:49 +00:00
Owen Anderson
69d98376b9 Add support for the notion of "hidden" relocations. On MachO, these are relocation entries that are used as additional information for other, real relocations, rather than being relocations themselves.
I'm not familiar enough with ELF or COFF to know if they should have any relocations marked hidden.

llvm-svn: 142961
2011-10-25 20:35:53 +00:00
Owen Anderson
df9058b98c Fix off-by-one error when printing relocations inline with disassembly.
llvm-svn: 142952
2011-10-25 20:15:39 +00:00
Michael J. Spencer
f21a701890 llvm-objdump: Add static symbol table dumping.
llvm-svn: 142404
2011-10-18 19:32:17 +00:00
Daniel Dunbar
81780d9982 build: Tidy up a bunch of tool Makefiles, and simplify where possible using the
new all-targets pseudo-component.

llvm-svn: 142401
2011-10-18 19:27:24 +00:00
Michael J. Spencer
00c39291ef Revert "llvm-objdump: Add static symbol table dumping."
This reverts commit 0c30d4e4f5f9110c5a67bd0ca84444dc58697596.

llvm-svn: 142320
2011-10-18 00:17:04 +00:00
Michael J. Spencer
8c590fd08d llvm-objdump: Add static symbol table dumping.
llvm-svn: 142319
2011-10-17 23:55:22 +00:00
Owen Anderson
e607004d1b Rewrite most of MachODump to work through the generic libObject interfaces rather than accessing the MachO internals directly.
llvm-svn: 142263
2011-10-17 21:37:35 +00:00
Michael J. Spencer
277eaf9f19 llvm-objdump: Add -s, which prints the contents of each section.
llvm-svn: 142199
2011-10-17 17:13:22 +00:00
Michael J. Spencer
4ee36e15ad llvm-object: Add inline relocation information to disassembly.
llvm-svn: 141897
2011-10-13 22:17:18 +00:00
Michael J. Spencer
309e0cb513 llvm-objdump: Fix whitespace.
llvm-svn: 141886
2011-10-13 20:37:20 +00:00
Michael J. Spencer
fa3f63c14a llvm-objdump: Fix dumping of multiple symbols with the same address.
This happens in COFF because there is a symbol for the beginning of each
section.

llvm-svn: 141885
2011-10-13 20:37:08 +00:00
NAKAMURA Takumi
bf2fb9b9e2 llvm-objdump.cpp: Use PRIx64 as format specifier for int64_t.
llvm-svn: 141664
2011-10-11 12:51:50 +00:00
Nick Lewycky
73e4d372d0 Add support for dumping section headers to llvm-objdump. This uses the same
flags as binutils objdump but the output is different, not just in format but
also showing different sections. Compare its results against readelf, not
objdump.

llvm-svn: 141579
2011-10-10 21:21:34 +00:00
Benjamin Kramer
05836b12fd llvm-objdump: Take ownership of MCInstrInfos.
llvm-svn: 141535
2011-10-10 13:10:09 +00:00
Michael J. Spencer
e497728e76 llvm-objdump: Add relocation and archive support.
llvm-svn: 141451
2011-10-08 00:18:30 +00:00
Michael J. Spencer
022d2639d9 Fix spelling in comment.
llvm-svn: 141386
2011-10-07 19:25:47 +00:00
Michael J. Spencer
34d76cf95b Change relocation API to be per section. This time without breaking GCC.
llvm-svn: 141385
2011-10-07 19:25:32 +00:00
Bill Wendling
ecbddb2b9e Revert 141376 and 141377 due to breaking the build.
--- Reverse-merging r141377 into '.':
U    tools/llvm-objdump/MachODump.cpp
--- Reverse-merging r141376 into '.':
U    include/llvm/Object/COFF.h
U    include/llvm/Object/ObjectFile.h
U    include/llvm-c/Object.h
U    tools/llvm-objdump/llvm-objdump.cpp
U    lib/Object/MachOObjectFile.cpp
U    lib/Object/COFFObjectFile.cpp
U    lib/Object/Object.cpp
U    lib/Object/ELFObjectFile.cpp

llvm-svn: 141379
2011-10-07 18:25:37 +00:00
Michael J. Spencer
8c104f4259 Fix spelling in comment.
llvm-svn: 141377
2011-10-07 18:15:40 +00:00
Michael J. Spencer
14925a859b Change relocation API to be per section.
llvm-svn: 141376
2011-10-07 18:15:25 +00:00
Benjamin Kramer
e106715386 llvm-objdump: Detach symbol listing from section enumeration for mach-o.
This reduces memory usage as we don't add the same symbol multiple times anymore.

llvm-svn: 140278
2011-09-21 22:16:43 +00:00
Benjamin Kramer
abc83415a1 llvm-objdump: Take the data from the right object when there's no dSYM around.
llvm-svn: 140269
2011-09-21 18:18:53 +00:00
Benjamin Kramer
e55a93f3a1 llvm-objdump: Fix use after free.
llvm-svn: 140237
2011-09-21 04:01:19 +00:00
Benjamin Kramer
703be6434e llvm-objdump: Output line info next to the disassembly if available.
MachO-only at the moment, sorry.

Usage:
$ llvm-objdump -d -m -g -dsym=a.out.dSYM/Contents/Resources/DWARF/a.out a.out
_main:
100000e90:	55	pushq %rbp	## test.c:11:3
…

llvm-svn: 140224
2011-09-21 01:13:19 +00:00
Benjamin Kramer
c4ca0b476f llvm-objdump: factor code better, add comments.
llvm-svn: 140153
2011-09-20 17:53:01 +00:00
Benjamin Kramer
0f569dc6bf Nope, there's another one!
llvm-svn: 140045
2011-09-19 20:23:01 +00:00
Benjamin Kramer
804be3463c Missed one instance of implicit pointer conversion.
llvm-svn: 140044
2011-09-19 20:14:46 +00:00
Benjamin Kramer
06a87d562a Try to make MSVC 2010 happy.
llvm-svn: 140042
2011-09-19 20:08:52 +00:00
Benjamin Kramer
82df2a3e37 Add a MachO-specific "mode" to llvm-objdump, that, if enabled, gathers additional information that are only available on MachO.
- It can take FunctionStarts from a binary to find entry points more accurately.
- Symbol offsets in executables are correct now.

llvm-svn: 140028
2011-09-19 17:56:04 +00:00
Owen Anderson
e54c4beb5a Don't attach annotations to MCInst's. Instead, have the disassembler return, and the printer accept, an annotation string which can be passed through if the client cares about annotations.
llvm-svn: 139876
2011-09-15 23:38:46 +00:00
Benjamin Kramer
52607b3842 Object: make the following changes into SymbolRef
- Add enum SymbolType and function getSymbolType()
- Add function isGlobal() - it's returns true for symbols that can be used in another objects, such as library functions.
- Rename function getAddress() to getOffset() and add new function getAddress(), because currently getAddress() returns section offset of symbol first byte. new getAddress() return symbol address.
- Change usage SymbolRef::getAddress() to getOffset() in tools/llvm-nm and tools/llvm-objdump.

Patch by Danil Malyshev!

llvm-svn: 139683
2011-09-14 01:22:52 +00:00
James Molloy
f781d3d8e9 Refactor instprinter and mcdisassembler to take a SubtargetInfo. Add -mattr= handling to llvm-mc. Reviewed by Owen Anderson.
llvm-svn: 139237
2011-09-07 17:24:38 +00:00
Evan Cheng
420bf5446c Move TargetRegistry and TargetSelect from Target to Support where they belong.
These are strictly utilities for registering targets and components.

llvm-svn: 138450
2011-08-24 18:08:43 +00:00
Evan Cheng
ed13551c1d Some refactoring so TargetRegistry.h no longer has to include any files
from MC.

llvm-svn: 138367
2011-08-23 20:15:21 +00:00
Benjamin Kramer
8c3f23ec80 Add MCInstrAnalysis class. This allows the targets to specify own versions of MCInstrDescs functions.
- Add overrides for ARM.
- Teach llvm-objdump to use this instead of plain MCInstrDesc.

llvm-svn: 137059
2011-08-08 18:56:44 +00:00
Benjamin Kramer
d4dc8d86f4 llvm-objdump: disassembly enhancements
- Indent simple loops
- Print unreachable blocks as .byte directives

llvm-svn: 137058
2011-08-08 18:41:34 +00:00
Benjamin Kramer
26d5603f54 llvm-objdump: Use help of CFG to print assembly when --cfg is passed.
This way we can avoid printing unreachable code (data).

llvm-svn: 137057
2011-08-08 18:32:12 +00:00
Benjamin Kramer
246f1a33d5 I will save before I commit.
I will save before I commit.
I will save before I commit.
I will save before I commit.

llvm-svn: 136007
2011-07-25 23:10:23 +00:00
Benjamin Kramer
ec7f4c86d6 llvm-objdump: Ignore unreachable blocks when printing the CFG.
llvm-svn: 136000
2011-07-25 23:04:36 +00:00
Evan Cheng
040076bda2 Separate MCInstPrinter registration from AsmPrinter registration.
llvm-svn: 135974
2011-07-25 21:20:24 +00:00
Evan Cheng
1d04cd9b26 Fix last bits of MC layer issues. llvm-mc doesn't need to initialize TargetMachine's anymore.
llvm-svn: 135963
2011-07-25 20:53:02 +00:00
Evan Cheng
7b4cb12a95 Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,
InitializeX86MCInstrInfo, etc. are combined into InitializeX86TargetMC.

llvm-svn: 135812
2011-07-22 21:58:54 +00:00
Benjamin Kramer
7ca016ba15 llvm-objdump: Don't ignore errors from raw_fd_ostream.
llvm-svn: 135787
2011-07-22 18:35:11 +00:00
Benjamin Kramer
3a31700631 llvm-objdump: Skip branches that leave the current function.
In "normal" code these only happen when disassembling data, so we
won't lose anything if we just drop them.

llvm-svn: 135786
2011-07-22 18:35:09 +00:00
Chandler Carruth
9df16051f4 Move the registered target printing in version strings completely out of
the Support library. Now its part of the TargetRegistry, and the three
commands that care about this explicitly register this extra bit of
version information.

The set of commands which care was computed by intersecting those which
use the Support library's version string printing and those that
initialize all the registered targets in a way that produces
a meaningful list. The only odd ball out is that 'clang -cc1as -version'
no longer prints the registered targets. I don't think anyone is really
interested in that (especially as the fact that llvm-mc does so is under
a FIXME), but if someone really does want this back I'll happily apply
the same patch there.

llvm-svn: 135757
2011-07-22 07:50:48 +00:00
Francois Pichet
1b727ad694 Unbreak the MSVC build. Since the "next" function already exists in the MSVC headers, we need the explicit llvm:: qualifier to prevent a conflict.
llvm-svn: 135623
2011-07-20 21:35:29 +00:00
Benjamin Kramer
73b85ba883 Fix cmake.
llvm-svn: 135609
2011-07-20 19:43:38 +00:00
Benjamin Kramer
6c9a683f71 Sketch out an CFG reconstruction mode for llvm-objdump.
- Not great yet, but it's a start.
- Requires an object file with a symbol table. (I really want to fix this, but it'll need a whole new algorithm)
- ELF and COFF won't work at the moment due to libObject shortcomings.

To try it out run
$ llvm-objdump -d --cfg foo.o

This will create a graphviz file for every symbol in the object file's text section containing a CFG.

llvm-svn: 135608
2011-07-20 19:37:35 +00:00
Benjamin Kramer
f5ca440fd0 Fix off-by-one.
llvm-svn: 135533
2011-07-19 22:59:25 +00:00
Evan Cheng
bfc0cac54d Introduce MCCodeGenInfo, which keeps information that can affect codegen
(including compilation, assembly). Move relocation model Reloc::Model from
TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine.

llvm-svn: 135468
2011-07-19 06:37:02 +00:00
Benjamin Kramer
5836701780 Teach llvm-objdump to disassemble sections symbol by symbol.
llvm-svn: 135289
2011-07-15 18:39:24 +00:00
Evan Cheng
9e8f90a020 Rename createAsmInfo to createMCAsmInfo and move registration code to MCTargetDesc to prepare for next round of changes.
llvm-svn: 135219
2011-07-14 23:50:31 +00:00
Eli Friedman
4a5a5b1a0a Remove some unnecessary includes.
llvm-svn: 134528
2011-07-06 20:48:27 +00:00
Evan Cheng
dcd3ea7062 createMCInstPrinter doesn't need TargetMachine anymore.
llvm-svn: 134525
2011-07-06 19:45:42 +00:00
Evan Cheng
034261674b Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name to
be the first encoded as the first feature. It then uses the CPU name to look up
features / scheduling itineray even though clients know full well the CPU name
being used to query these properties.

The fix is to just have the clients explictly pass the CPU name!

llvm-svn: 134127
2011-06-30 01:53:36 +00:00
Michael J. Spencer
83e956656a Object: Add proper error handling.
llvm-svn: 133872
2011-06-25 17:55:23 +00:00
Jay Foad
c146569beb Remove unused STL header includes.
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Bill Wendling
a2eec46242 We need to pass the TargetMachine object to the InstPrinter if we are printing
the alias of an InstAlias instead of the thing being aliased. Because we need to
know the features that are valid for an InstAlias.

This is part of a work-in-progress.

llvm-svn: 127986
2011-03-21 04:13:46 +00:00
Michael J. Spencer
628bf0cbdb llvm-objdump: Remove redundant includes.
llvm-svn: 123902
2011-01-20 07:22:13 +00:00
Michael J. Spencer
7bcf23aa12 llvm-nm: Fix warning.
llvm-svn: 123901
2011-01-20 07:22:04 +00:00
Michael J. Spencer
f4f22037ca Add llvm-objdump
llvm-svn: 123898
2011-01-20 06:39:06 +00:00