Merge pull request #66 from ppizarro/master
BlackFin fixes - Fatal error when calling a function defined in a shared library from within the function called by FFI
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2014-02-28 Paulo Pizarro <paulo.pizarro@gmail.com>
|
||||||
|
|
||||||
|
* src/bfin/sysv.S: Calling functions in shared libraries requires
|
||||||
|
considering the GOT.
|
||||||
|
|
||||||
2014-02-28 Josh Triplett <josh@joshtriplett.org>
|
2014-02-28 Josh Triplett <josh@joshtriplett.org>
|
||||||
|
|
||||||
* src/x86/ffi64.c (classify_argument): Handle case where
|
* src/x86/ffi64.c (classify_argument): Handle case where
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
ffi.c - Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>
|
ffi.c - Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>,
|
||||||
|
Paulo Pizarro <paulo.pizarro@gmail.com>
|
||||||
|
|
||||||
Blackfin Foreign Function Interface
|
Blackfin Foreign Function Interface
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
sysv.S - Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>
|
sysv.S - Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>,
|
||||||
|
Paulo Pizarro <paulo.pizarro@gmail.com>
|
||||||
|
|
||||||
Blackfin Foreign Function Interface
|
Blackfin Foreign Function Interface
|
||||||
|
|
||||||
@@ -40,25 +41,26 @@
|
|||||||
.func ffi_call_SYSV
|
.func ffi_call_SYSV
|
||||||
|
|
||||||
/*
|
/*
|
||||||
cif->bytes = R0 (fp+8)
|
cif->bytes = R0 (fp+8)
|
||||||
&ecif = R1 (fp+12)
|
&ecif = R1 (fp+12)
|
||||||
ffi_prep_args = R2 (fp+16)
|
ffi_prep_args = R2 (fp+16)
|
||||||
ret_type = stack (fp+20)
|
ret_type = stack (fp+20)
|
||||||
ecif.rvalue = stack (fp+24)
|
ecif.rvalue = stack (fp+24)
|
||||||
fn = stack (fp+28)
|
fn = stack (fp+28)
|
||||||
got (fp+32)
|
got (fp+32)
|
||||||
There is room for improvement here (we can use temporary registers
|
|
||||||
instead of saving the values in the memory)
|
|
||||||
REGS:
|
|
||||||
P5 => Stack pointer (function arguments)
|
|
||||||
R5 => cif->bytes
|
|
||||||
R4 => ret->type
|
|
||||||
|
|
||||||
FP-20 = P3
|
There is room for improvement here (we can use temporary registers
|
||||||
FP-16 = SP (parameters area)
|
instead of saving the values in the memory)
|
||||||
FP-12 = SP (temp)
|
REGS:
|
||||||
FP-08 = function return part 1 [R0]
|
P5 => Stack pointer (function arguments)
|
||||||
FP-04 = function return part 2 [R1]
|
R5 => cif->bytes
|
||||||
|
R4 => ret->type
|
||||||
|
|
||||||
|
FP-20 = P3
|
||||||
|
FP-16 = SP (parameters area)
|
||||||
|
FP-12 = SP (temp)
|
||||||
|
FP-08 = function return part 1 [R0]
|
||||||
|
FP-04 = function return part 2 [R1]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
_ffi_call_SYSV:
|
_ffi_call_SYSV:
|
||||||
|
|||||||
Reference in New Issue
Block a user