[LLVMdev] high bit of function address set incorrectly?

Maurice Gittens mainmanmauricio at gmail.com
Fri Aug 5 06:02:06 PDT 2011


Hi,

The llvm::ExecutionEngine::createJIT has a 'CodeModel' enum parameter
taking values: JITDefault, Small, Kernel, Medium or Large.

An appropriate value for this parameter fixes the my problem.

Kind regards,
Maurice

On Sun, Jul 31, 2011 at 2:42 PM, Maurice Gittens
<mainmanmauricio at gmail.com> wrote:
> Hi,
>
> I recently updated to current llvm svn and fixed-up the minor compiler
> errors I encountered.
> However, at run-time even my Hello world programs crash with a
> segmentation fault.
>
> A concrete program that crashes on my Linux x86_64 Fedora box is:
>
> declare void @__ot_runtime_print_int(i8*, i32)
>
> define void @main() {
> entry:
>  call void @__ot_runtime_print_int(i8* null, i32 12)
>  br label %return
>
> return:                                           ; preds = %entry
>  ret void
> }
>
> LLVM magic turns this into the assember shown in the attached image.
>
> I am no expert but is seems to me that the address generated
> (0x8000012c1eea) for the __ot_runtime_print_int function is incorrect.
> As both  nm and the debugger (kdbg) suggest that the address of the
> function in question is: 0x12c1eea.
>
> So why is the high bit of the function address set? Anybody willing to
> shed some light on what is happening here?
>
> Thanks,
> Maurice
>




More information about the llvm-dev mailing list