2009-06-23 22:01:43 +00:00
|
|
|
add_llvm_library(LLVMMC
|
2014-06-18 18:17:25 +00:00
|
|
|
ConstantPools.cpp
|
2010-08-16 18:35:43 +00:00
|
|
|
ELFObjectWriter.cpp
|
2011-09-24 22:06:35 +00:00
|
|
|
MCAsmBackend.cpp
|
2009-08-22 22:07:08 +00:00
|
|
|
MCAsmInfo.cpp
|
|
|
|
MCAsmInfoCOFF.cpp
|
|
|
|
MCAsmInfoDarwin.cpp
|
2013-10-16 01:34:32 +00:00
|
|
|
MCAsmInfoELF.cpp
|
2009-06-24 10:03:44 +00:00
|
|
|
MCAsmStreamer.cpp
|
2009-08-21 11:28:56 +00:00
|
|
|
MCAssembler.cpp
|
2009-08-27 02:08:37 +00:00
|
|
|
MCCodeEmitter.cpp
|
2011-07-19 06:37:02 +00:00
|
|
|
MCCodeGenInfo.cpp
|
2009-06-23 22:01:43 +00:00
|
|
|
MCContext.cpp
|
2011-09-24 22:06:35 +00:00
|
|
|
MCDwarf.cpp
|
2011-02-28 21:45:04 +00:00
|
|
|
MCELF.cpp
|
2010-12-17 17:45:22 +00:00
|
|
|
MCELFObjectTargetWriter.cpp
|
2010-08-16 18:35:43 +00:00
|
|
|
MCELFStreamer.cpp
|
2009-08-31 08:06:59 +00:00
|
|
|
MCExpr.cpp
|
2009-08-27 07:57:12 +00:00
|
|
|
MCInst.cpp
|
2009-09-14 05:22:47 +00:00
|
|
|
MCInstPrinter.cpp
|
2011-08-08 19:09:02 +00:00
|
|
|
MCInstrAnalysis.cpp
|
2010-05-17 23:08:19 +00:00
|
|
|
MCLabel.cpp
|
2014-03-29 07:34:53 +00:00
|
|
|
MCLinkerOptimizationHint.cpp
|
2009-08-21 11:28:56 +00:00
|
|
|
MCMachOStreamer.cpp
|
2010-12-16 16:09:19 +00:00
|
|
|
MCMachObjectTargetWriter.cpp
|
2009-08-21 11:28:56 +00:00
|
|
|
MCNullStreamer.cpp
|
2011-07-20 06:35:24 +00:00
|
|
|
MCObjectFileInfo.cpp
|
2010-06-16 20:04:22 +00:00
|
|
|
MCObjectStreamer.cpp
|
2010-03-19 09:28:59 +00:00
|
|
|
MCObjectWriter.cpp
|
2012-07-27 16:25:20 +00:00
|
|
|
MCRegisterInfo.cpp
|
2009-07-31 17:02:00 +00:00
|
|
|
MCSection.cpp
|
2010-05-07 17:29:48 +00:00
|
|
|
MCSectionCOFF.cpp
|
2009-08-13 05:07:35 +00:00
|
|
|
MCSectionELF.cpp
|
2009-08-10 18:15:01 +00:00
|
|
|
MCSectionMachO.cpp
|
2009-06-24 10:03:44 +00:00
|
|
|
MCStreamer.cpp
|
2011-07-01 20:45:01 +00:00
|
|
|
MCSubtargetInfo.cpp
|
2009-08-14 04:14:45 +00:00
|
|
|
MCSymbol.cpp
|
Add MCSymbolizer for symbolic/annotated disassembly.
This is a basic first step towards symbolization of disassembled
instructions. This used to be done using externally provided (C API)
callbacks. This patch introduces:
- the MCSymbolizer class, that mimics the same functions that were used
in the X86 and ARM disassemblers to symbolize immediate operands and
to annotate loads based off PC (for things like c string literals).
- the MCExternalSymbolizer class, which implements the old C API.
- the MCRelocationInfo class, which provides a way for targets to
translate relocations (either object::RelocationRef, or disassembler
C API VariantKinds) to MCExprs.
- the MCObjectSymbolizer class, which does symbolization using what it
finds in an object::ObjectFile. This makes simple symbolization (with
no fancy relocation stuff) work for all object formats!
- x86-64 Mach-O and ELF MCRelocationInfos.
- A basic ARM Mach-O MCRelocationInfo, that provides just enough to
support the C API VariantKinds.
Most of what works in otool (the only user of the old symbolization API
that I know of) for x86-64 symbolic disassembly (-tvV) works, namely:
- symbol references: call _foo; jmp 15 <_foo+50>
- relocations: call _foo-_bar; call _foo-4
- __cf?string: leaq 193(%rip), %rax ## literal pool for "hello"
Stub support is the main missing part (because libObject doesn't know,
among other things, about mach-o indirect symbols).
As for the MCSymbolizer API, instead of relying on the disassemblers
to call the tryAdding* methods, maybe this could be done automagically
using InstrInfo? For instance, even though PC-relative LEAs are used
to get the address of string literals in a typical Mach-O file, a MOV
would be used in an ELF file. And right now, the explicit symbolization
only recognizes PC-relative LEAs. InstrInfo should have already have
most of what is needed to know what to symbolize, so this can
definitely be improved.
I'd also like to remove object::RelocationRef::getValueString (it seems
only used by relocation printing in objdump), as simply printing the
created MCExpr is definitely enough (and cleaner than string concats).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182625 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 00:39:57 +00:00
|
|
|
MCSymbolizer.cpp
|
2014-04-23 11:16:03 +00:00
|
|
|
MCTargetOptions.cpp
|
2009-08-14 04:14:45 +00:00
|
|
|
MCValue.cpp
|
2011-05-22 03:01:05 +00:00
|
|
|
MCWin64EH.cpp
|
2014-08-07 02:59:41 +00:00
|
|
|
MCWinEH.cpp
|
2010-03-19 10:43:15 +00:00
|
|
|
MachObjectWriter.cpp
|
2014-07-03 02:01:39 +00:00
|
|
|
StringTableBuilder.cpp
|
2011-06-29 03:26:17 +00:00
|
|
|
SubtargetFeature.cpp
|
2011-09-24 22:06:35 +00:00
|
|
|
WinCOFFObjectWriter.cpp
|
|
|
|
WinCOFFStreamer.cpp
|
2014-07-03 02:01:39 +00:00
|
|
|
YAML.cpp
|
2009-06-23 22:01:43 +00:00
|
|
|
)
|
2011-02-18 22:06:14 +00:00
|
|
|
|
|
|
|
add_subdirectory(MCParser)
|
|
|
|
add_subdirectory(MCDisassembler)
|