aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorNicolas Geoffray <nicolas.geoffray@lip6.fr>2009-02-15 20:49:23 +0000
committerNicolas Geoffray <nicolas.geoffray@lip6.fr>2009-02-15 20:49:23 +0000
commit86f6c77754c020a845df327e4f6d937c0d03f85e (patch)
tree608d69256d158afa1969162251b0eb964c2ea8ad /lib/ExecutionEngine
parente10858a8c639c317d884eaface2a253d6793c077 (diff)
downloadexternal_llvm-86f6c77754c020a845df327e4f6d937c0d03f85e.zip
external_llvm-86f6c77754c020a845df327e4f6d937c0d03f85e.tar.gz
external_llvm-86f6c77754c020a845df327e4f6d937c0d03f85e.tar.bz2
On 64bit we may have a personality function which requires 64 bits to
be encoded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64600 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp b/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
index 694da1f..bb2f92b 100644
--- a/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
@@ -519,14 +519,20 @@ JITDwarfEmitter::EmitCommonEHFrame(const Function* Personality) const {
MCE->emitByte(RI->getDwarfRegNum(RI->getRARegister(), true));
if (Personality) {
- MCE->emitULEB128Bytes(7);
+ // Augmentation Size: 3 small ULEBs of one byte each, and the personality
+ // function which size is PointerSize.
+ MCE->emitULEB128Bytes(3 + PointerSize);
- // Direct encoding, because we use the function pointer. Not relative,
- // because the current PC value may be bigger than the personality
- // function pointer.
- MCE->emitByte(dwarf::DW_EH_PE_sdata4);
-
- MCE->emitInt32(((intptr_t)Jit.getPointerToGlobal(Personality)));
+ // We set the encoding of the personality as direct encoding because we use
+ // the function pointer. The encoding is not relative because the current
+ // PC value may be bigger than the personality function pointer.
+ if (PointerSize == 4) {
+ MCE->emitByte(dwarf::DW_EH_PE_sdata4);
+ MCE->emitInt32(((intptr_t)Jit.getPointerToGlobal(Personality)));
+ } else {
+ MCE->emitByte(dwarf::DW_EH_PE_sdata8);
+ MCE->emitInt64(((intptr_t)Jit.getPointerToGlobal(Personality)));
+ }
MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
MCE->emitULEB128Bytes(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);