Bill Wendling
4e68e0673a
Remove tabs.
...
llvm-svn: 160480
2012-07-19 00:17:40 +00:00
Evan Cheng
58aeca0878
Need a space.
...
llvm-svn: 159565
2012-07-02 19:45:42 +00:00
Kevin Enderby
badd100c26
Fixed a bug in llvm-objdump when disassembling using -macho option for a binary
...
containing no symbols. Fixed the crash and fixed it not disassembling anything.
llvm-svn: 157031
2012-05-18 00:13:56 +00:00
Kevin Enderby
edd5872f33
Fixed a bug in llvm-objdump when disassembling using -macho option for a binary
...
that has more than one symbol. The last symbol was not being disassembled to
the end of the section.
llvm-svn: 156840
2012-05-15 18:57:14 +00:00
Kevin Enderby
fe3d005ca5
Fix it so llvm-objdump -arch does accept x86 and x86-64 as valid arch names.
...
PR12731. Patch by Meador Inge!
llvm-svn: 156444
2012-05-08 23:38:45 +00:00
Pete Cooper
28fb4fc91b
PR12729: Change 'llvm-objdump' to display the available targets.
...
Patch by Meador Inge.
llvm-svn: 156128
2012-05-03 23:20:10 +00:00
Craig Topper
54bfde79db
Make MCInstrInfo available to the MCInstPrinter. This will be used to remove getInstructionName and the static data it contains since the same tables are already in MCInstrInfo.
...
llvm-svn: 153860
2012-04-02 06:09:36 +00:00
Benjamin Kramer
a5177e63a6
Include cctype for std::isprint.
...
This should unbreak the msvc build.
llvm-svn: 153329
2012-03-23 11:49:32 +00:00
Benjamin Kramer
82803112da
Fix uses of the C99 PRI format macros not to conflict with C++11 UDLs.
...
llvm-svn: 152474
2012-03-10 02:04:38 +00:00
Jim Grosbach
fd93a59557
Make MCRegisterInfo available to the the MCInstPrinter.
...
Used to allow context sensitive printing of super-register or sub-register
references.
llvm-svn: 152043
2012-03-05 19:33:20 +00:00
David Meyer
7e4b976c36
[Object] Add symbol attribute flags: ST_ThreadLocal, ST_Common, and ST_Undefined. Implement these completely for ELF.
...
Rename ST_External to ST_Unknown, and slightly change its semantics. It now only indicates that the symbol's type
is unknown, not that the symbol is undefined. (For that, use ST_Undefined).
llvm-svn: 151696
2012-02-29 02:11:55 +00:00
Derek Schuff
56b662ce0f
Make MemoryObject accessor members const again
...
llvm-svn: 151687
2012-02-29 01:09:06 +00:00
David Meyer
1df4b84db4
In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), and isWeak(), with a bitset of flags.
...
llvm-svn: 151670
2012-02-28 23:47:53 +00:00
Derek Schuff
8b2dcad4b5
Enable streaming of bitcode
...
This CL delays reading of function bodies from initial parse until
materialization, allowing overlap of compilation with bitcode download.
llvm-svn: 149918
2012-02-06 22:30:29 +00:00
Cameron Zwarich
88cc16aeb5
Allow command-line overrides of the target triple with the Mach-O
...
disassembler, just like the generic disassembler.
llvm-svn: 149681
2012-02-03 06:35:22 +00:00
Cameron Zwarich
54478a514c
Do the same fix as r149667, but for the Mach-O disassembler.
...
llvm-svn: 149674
2012-02-03 05:42:17 +00:00
Cameron Zwarich
07f0f77629
Fix llvm-objdump disassembly for interesting Mach-O binaries, e.g. any MacOS
...
dylib. This regressed with r145408. I will try to make a test case and add it
so that this doesn't happen again.
llvm-svn: 149667
2012-02-03 04:13:37 +00:00
David Blaikie
a379b18173
Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
...
llvm-svn: 146960
2011-12-20 02:50:00 +00:00
Daniel Dunbar
27a7489a03
LLVMBuild: Remove trailing newline, which irked me.
...
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Danil Malyshev
cbe72fc959
Fixed ObjectFile functions:
...
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.
llvm-svn: 145408
2011-11-29 17:40:10 +00:00
Chandler Carruth
37ab257b88
Revert r145180 as it is causing test failures on all the bots.
...
Original commit message:
Fixed ObjectFile functions:
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.
llvm-svn: 145182
2011-11-27 10:37:47 +00:00
Danil Malyshev
2631f93f7d
Fixed ObjectFile functions:
...
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.
llvm-svn: 145180
2011-11-27 10:12:52 +00:00
Michael J. Spencer
53723de5b8
llvm-objdump: Ignore non-objects in archives.
...
llvm-svn: 144755
2011-11-16 01:24:41 +00:00
Daniel Dunbar
57fb3ae997
LLVMBuild: Add description files for the LLVM tools.
...
llvm-svn: 144417
2011-11-11 22:59:39 +00:00
Owen Anderson
7635bb7ae2
Fix llvm-objdump's MachO mode to not depend on the value returned by RelocationRef::getInfo().
...
llvm-svn: 143966
2011-11-07 17:21:36 +00:00
Benjamin Kramer
f3da529028
Add more PRI.64 macros for MSVC and use them throughout the codebase.
...
llvm-svn: 143799
2011-11-05 08:57:40 +00:00
Stepan Dyatkovskiy
07c0d4091f
uint64 formatted output: replaced %llx with PRIx64 macro.
...
llvm-svn: 143191
2011-10-28 13:07:32 +00:00
Owen Anderson
bf3bc1db22
Revert r143149, stubbing out symbolic disassembly support. The symbolic disassembly support is too MC-engrained to be useful in llvm-objdump.
...
llvm-svn: 143152
2011-10-27 21:55:13 +00:00
Owen Anderson
8f167d4861
Stub out support for symbol disassembly in llvm-objdump.
...
llvm-svn: 143149
2011-10-27 21:46:31 +00:00
Stepan Dyatkovskiy
4b96dc7167
Fixed llvm-objdump uint64_t formatted output.
...
llvm-svn: 143120
2011-10-27 18:40:45 +00:00
Owen Anderson
7be76590e6
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
fa3e5200b8
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
f20e3e5774
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
bfa067862c
llvm-objdump: Add static symbol table dumping.
...
llvm-svn: 142404
2011-10-18 19:32:17 +00:00
Daniel Dunbar
96d812a68d
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
81c80ddb0c
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
6b22ef8af2
llvm-objdump: Add static symbol table dumping.
...
llvm-svn: 142319
2011-10-17 23:55:22 +00:00
Owen Anderson
d9243c4689
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
4e25c02487
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
51862b3890
llvm-object: Add inline relocation information to disassembly.
...
llvm-svn: 141897
2011-10-13 22:17:18 +00:00
Michael J. Spencer
8f67d47d0d
llvm-objdump: Fix whitespace.
...
llvm-svn: 141886
2011-10-13 20:37:20 +00:00
Michael J. Spencer
ee84f64f0b
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
bd926cbdb5
llvm-objdump.cpp: Use PRIx64 as format specifier for int64_t.
...
llvm-svn: 141664
2011-10-11 12:51:50 +00:00
Nick Lewycky
fcf8462583
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
357d7dcbf4
llvm-objdump: Take ownership of MCInstrInfos.
...
llvm-svn: 141535
2011-10-10 13:10:09 +00:00
Michael J. Spencer
ba4a362276
llvm-objdump: Add relocation and archive support.
...
llvm-svn: 141451
2011-10-08 00:18:30 +00:00
Michael J. Spencer
c1363cf21a
Fix spelling in comment.
...
llvm-svn: 141386
2011-10-07 19:25:47 +00:00
Michael J. Spencer
e5fd004719
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
206d8a7f48
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
350c71b2d8
Fix spelling in comment.
...
llvm-svn: 141377
2011-10-07 18:15:40 +00:00
Michael J. Spencer
b0d61540cb
Change relocation API to be per section.
...
llvm-svn: 141376
2011-10-07 18:15:25 +00:00
Benjamin Kramer
8a529dc10a
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
37a7151b1f
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
9eaefa9786
llvm-objdump: Fix use after free.
...
llvm-svn: 140237
2011-09-21 04:01:19 +00:00
Benjamin Kramer
699128e58a
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
2ad2eb527b
llvm-objdump: factor code better, add comments.
...
llvm-svn: 140153
2011-09-20 17:53:01 +00:00
Benjamin Kramer
444f079d34
Nope, there's another one!
...
llvm-svn: 140045
2011-09-19 20:23:01 +00:00
Benjamin Kramer
babc5291f4
Missed one instance of implicit pointer conversion.
...
llvm-svn: 140044
2011-09-19 20:14:46 +00:00
Benjamin Kramer
78ee973788
Try to make MSVC 2010 happy.
...
llvm-svn: 140042
2011-09-19 20:08:52 +00:00
Benjamin Kramer
43a772eda1
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
a0c3b97221
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
75d1cf3391
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
4c493e8050
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
2bb4035707
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
4d6c9d711d
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
c22d50e5c3
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
4c0423bc8f
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
5d173c0dab
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
9ea35e470c
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
bf11531492
llvm-objdump: Ignore unreachable blocks when printing the CFG.
...
llvm-svn: 136000
2011-07-25 23:04:36 +00:00
Evan Cheng
61faa55b74
Separate MCInstPrinter registration from AsmPrinter registration.
...
llvm-svn: 135974
2011-07-25 21:20:24 +00:00
Evan Cheng
f60768a14e
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
8c886a40d2
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
39e05ac3d7
llvm-objdump: Don't ignore errors from raw_fd_ostream.
...
llvm-svn: 135787
2011-07-22 18:35:11 +00:00
Benjamin Kramer
cb2d7bee35
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
2d71c421f9
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
7f023ae4bb
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
82f64488ec
Fix cmake.
...
llvm-svn: 135609
2011-07-20 19:43:38 +00:00
Benjamin Kramer
87ee76ca73
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
46d9cd5f72
Fix off-by-one.
...
llvm-svn: 135533
2011-07-19 22:59:25 +00:00
Evan Cheng
2129f59637
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
e0dda9c1c8
Teach llvm-objdump to disassemble sections symbol by symbol.
...
llvm-svn: 135289
2011-07-15 18:39:24 +00:00
Evan Cheng
1705ab00ab
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
402339b875
Remove some unnecessary includes.
...
llvm-svn: 134528
2011-07-06 20:48:27 +00:00
Evan Cheng
ab37af9af3
createMCInstPrinter doesn't need TargetMachine anymore.
...
llvm-svn: 134525
2011-07-06 19:45:42 +00:00
Evan Cheng
fe6e405e8c
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
1d6167fd30
Object: Add proper error handling.
...
llvm-svn: 133872
2011-06-25 17:55:23 +00:00
Jay Foad
1a180156b6
Remove unused STL header includes.
...
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Bill Wendling
00f0cddfd4
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
c6bc900893
llvm-objdump: Remove redundant includes.
...
llvm-svn: 123902
2011-01-20 07:22:13 +00:00
Michael J. Spencer
05350e6d7c
llvm-nm: Fix warning.
...
llvm-svn: 123901
2011-01-20 07:22:04 +00:00
Michael J. Spencer
2670c2528c
Add llvm-objdump
...
llvm-svn: 123898
2011-01-20 06:39:06 +00:00