search for: callfuncptr

Displaying 2 results from an estimated 2 matches for "callfuncptr".

2015 Feb 18
3
[LLVMdev] Calling into non-linked function via a pointer
...ruce Hoult <bruce at hoult.org> wrote: > Naturally you can, since C can. As usual, it's instructive to see what > Clang generates e.g. > > typedef int fn(int); > > int test(fn f, int val){ > return f(val); > } > > ----------- > > Compiled with: clang callfuncptr.c -O -S -emit-llvm -o callfuncptr.ll > > ; ModuleID = 'callfuncptr.c' > > target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" > > target triple = "x86_64-apple-macosx10.10.0" > > > ; Function Attrs: nounwind ssp uwtable > > define...
2015 Feb 18
3
[LLVMdev] Calling into non-linked function via a pointer
I'm having a problem of being unable to call into an arbitrary function that is loaded into memory whose pointer address is known to me but was not linked into LLVM. I have added the function and called LLVMAddGlobalMapping with the pointer, and the program segfaults. I was wondering if it is a supported scenario that LLVM can generate a call into an arbitrary function that is not linked.