diff options
| author | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2009-02-15 20:49:23 +0000 |
|---|---|---|
| committer | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2009-02-15 20:49:23 +0000 |
| commit | 7f543ba9fa1dc3dde925ea32d77a64c2bff84115 (patch) | |
| tree | 2d01942084e7f88ab1028e38e5122ce5508444a0 /llvm/lib | |
| parent | f898638eee496756c73f2933f6a9f6f81c1b193d (diff) | |
| download | bcm5719-llvm-7f543ba9fa1dc3dde925ea32d77a64c2bff84115.tar.gz bcm5719-llvm-7f543ba9fa1dc3dde925ea32d77a64c2bff84115.zip | |
On 64bit we may have a personality function which requires 64 bits to
be encoded.
llvm-svn: 64600
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp index 694da1f0b56..bb2f92bb029 100644 --- a/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp +++ b/llvm/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); |

