summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMJITInfo.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-11-10 23:14:47 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-11-10 23:14:47 +0000
commit588920b9a5f7004e330e3597872908b4d57e9355 (patch)
treeaf11be82ec56972c7dc70d2130c892fc07307310 /lib/Target/ARM/ARMJITInfo.h
parent0ef3b61c98c54b766564fb757c408f2999aa56a0 (diff)
downloadllvm-588920b9a5f7004e330e3597872908b4d57e9355.tar.gz
llvm-588920b9a5f7004e330e3597872908b4d57e9355.tar.bz2
llvm-588920b9a5f7004e330e3597872908b4d57e9355.tar.xz
Correct PIC function stub codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMJITInfo.h')
-rw-r--r--lib/Target/ARM/ARMJITInfo.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMJITInfo.h b/lib/Target/ARM/ARMJITInfo.h
index a35611eaa3..8bcaa4c066 100644
--- a/lib/Target/ARM/ARMJITInfo.h
+++ b/lib/Target/ARM/ARMJITInfo.h
@@ -37,6 +37,10 @@ namespace llvm {
// PCLabelMap - A map from PC labels to addresses.
DenseMap<unsigned, intptr_t> PCLabelMap;
+ // Sym2IndirectSymMap - A map from symbol (GlobalValue and ExternalSymbol)
+ // addresses to their indirect symbol addresses.
+ DenseMap<void*, intptr_t> Sym2IndirectSymMap;
+
// IsPIC - True if the relocation model is PIC. This is used to determine
// how to codegen function stubs.
bool IsPIC;
@@ -147,6 +151,22 @@ namespace llvm {
PCLabelMap.insert(std::make_pair(Id, Addr));
}
+ /// getIndirectSymAddr - Retrieve the address of the indirect symbol of the
+ /// specified symbol located at address. Returns 0 if the indirect symbol
+ /// has not been emitted.
+ intptr_t getIndirectSymAddr(void *Addr) const {
+ DenseMap<void*,intptr_t>::const_iterator I= Sym2IndirectSymMap.find(Addr);
+ if (I != Sym2IndirectSymMap.end())
+ return I->second;
+ return 0;
+ }
+
+ /// addIndirectSymAddr - Add a mapping from address of an emitted symbol to
+ /// its indirect symbol address.
+ void addIndirectSymAddr(void *SymAddr, intptr_t IndSymAddr) {
+ Sym2IndirectSymMap.insert(std::make_pair(SymAddr, IndSymAddr));
+ }
+
private:
/// resolveRelocDestAddr - Resolve the resulting address of the relocation
/// if it's not already solved. Constantpool entries must be resolved by