aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/MCObjectSymbolizer.h
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-02-11 20:01:10 -0800
committerStephen Hines <srhines@google.com>2014-02-11 20:01:10 -0800
commitce9904c6ea8fd669978a8eefb854b330eb9828ff (patch)
tree2418ee2e96ea220977c8fb74959192036ab5b133 /include/llvm/MC/MCObjectSymbolizer.h
parentc27b10b198c1d9e9b51f2303994313ec2778edd7 (diff)
parentdbb832b83351cec97b025b61c26536ef50c3181c (diff)
downloadexternal_llvm-ce9904c6ea8fd669978a8eefb854b330eb9828ff.zip
external_llvm-ce9904c6ea8fd669978a8eefb854b330eb9828ff.tar.gz
external_llvm-ce9904c6ea8fd669978a8eefb854b330eb9828ff.tar.bz2
Merge remote-tracking branch 'upstream/release_34' into merge-20140211
Conflicts: lib/Linker/LinkModules.cpp lib/Support/Unix/Signals.inc Change-Id: Ia54f291fa5dc828052d2412736e8495c1282aa64
Diffstat (limited to 'include/llvm/MC/MCObjectSymbolizer.h')
-rw-r--r--include/llvm/MC/MCObjectSymbolizer.h32
1 files changed, 19 insertions, 13 deletions
diff --git a/include/llvm/MC/MCObjectSymbolizer.h b/include/llvm/MC/MCObjectSymbolizer.h
index 555cf51..64b932e 100644
--- a/include/llvm/MC/MCObjectSymbolizer.h
+++ b/include/llvm/MC/MCObjectSymbolizer.h
@@ -32,22 +32,14 @@ class MCObjectSymbolizer : public MCSymbolizer {
protected:
const object::ObjectFile *Obj;
- typedef DenseMap<uint64_t, object::RelocationRef> AddrToRelocMap;
- typedef std::vector<object::SectionRef> SortedSectionList;
- SortedSectionList SortedSections;
-
// Map a load address to the first relocation that applies there. As far as I
// know, if there are several relocations at the exact same address, they are
// related and the others can be determined from the first that was found in
// the relocation table. For instance, on x86-64 mach-o, a SUBTRACTOR
// relocation (referencing the minuend symbol) is followed by an UNSIGNED
// relocation (referencing the subtrahend symbol).
- AddrToRelocMap AddrToReloc;
-
- // Helpers around SortedSections.
- SortedSectionList::const_iterator findSectionContaining(uint64_t Addr) const;
- void insertSection(object::SectionRef Section);
-
+ const object::RelocationRef *findRelocationAt(uint64_t Addr);
+ const object::SectionRef *findSectionContaining(uint64_t Addr);
MCObjectSymbolizer(MCContext &Ctx, OwningPtr<MCRelocationInfo> &RelInfo,
const object::ObjectFile *Obj);
@@ -56,18 +48,32 @@ public:
/// \name Overridden MCSymbolizer methods:
/// @{
bool tryAddingSymbolicOperand(MCInst &MI, raw_ostream &cStream,
- int64_t Value,
- uint64_t Address, bool IsBranch,
- uint64_t Offset, uint64_t InstSize);
+ int64_t Value, uint64_t Address,
+ bool IsBranch, uint64_t Offset,
+ uint64_t InstSize);
void tryAddingPcLoadReferenceComment(raw_ostream &cStream,
int64_t Value, uint64_t Address);
/// @}
+ /// \brief Look for an external function symbol at \p Addr.
+ /// (References through the ELF PLT, Mach-O stubs, and similar).
+ /// \returns An MCExpr representing the external symbol, or 0 if not found.
+ virtual StringRef findExternalFunctionAt(uint64_t Addr);
+
/// \brief Create an object symbolizer for \p Obj.
static MCObjectSymbolizer *
createObjectSymbolizer(MCContext &Ctx, OwningPtr<MCRelocationInfo> &RelInfo,
const object::ObjectFile *Obj);
+
+private:
+ typedef DenseMap<uint64_t, object::RelocationRef> AddrToRelocMap;
+ typedef std::vector<object::SectionRef> SortedSectionList;
+ SortedSectionList SortedSections;
+ AddrToRelocMap AddrToReloc;
+
+ void buildSectionList();
+ void buildRelocationByAddrMap();
};
}