Commit Graph

252 Commits

Author SHA1 Message Date
Iain Sandoe
b90c2c4c0b re PR libffi/49594 (bootstrap failure in libffi:darwin_closure for powerpc-darwin8)
PR libffi/49594
	* src/powerpc/darwin_closure.S (stubs): Make the stub binding
	helper reference track the architecture pointer size.

From-SVN: r178512
2011-09-04 19:19:39 +00:00
Andrew Haley
4ac9cf2b5d ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly instructions.
2011-08-25  Andrew Haley  <aph@redhat.com>

        * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly
        instructions.
        * src/arm/sysv.S (ffi_arm_trampoline): Put them here instead.

From-SVN: r178060
2011-08-25 10:37:36 +00:00
Andrew Haley
4d4a9b72be ffi.c (FFI_INIT_TRAMPOLINE): Clear icache.
2011-07-11  Andrew Haley  <aph@redhat.com>

        * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Clear icache.

From-SVN: r176172
2011-07-11 17:50:04 +00:00
Rainer Orth
9d9305ea5d osf.S (UA_SI, [...]): Define.
* src/alpha/osf.S (UA_SI, FDE_ENCODING, FDE_ENCODE, FDE_ARANGE):
	Define.
	Use them to handle ELF vs. ECOFF differences.
	[__osf__] (_GLOBAL__F_ffi_call_osf): Define.

From-SVN: r173151
2011-04-29 08:49:08 +00:00
Joel Sherrill
9993cf6070 ffi.c: Add RTEMS support for cache flushing.
2011-02-07  Joel Sherrill <joel.sherrill@oarcorp.com>

	* libffi/src/m68k/ffi.c: Add RTEMS support for cache flushing.
	Handle case when CPU variant does not have long double support.
	* libffi/src/m68k/sysv.S: Add support for mc68000, Coldfire,
	and cores with soft floating point.

From-SVN: r169938
2011-02-08 19:19:01 +00:00
Joel Sherrill
38db4d09fa configure.ac: Add mips*-*-rtems* support.
2011-02-07  Joel Sherrill <joel.sherrill@oarcorp.com>

	* configure.ac: Add mips*-*-rtems* support.
	* configure: Regenerate.
	* src/mips/ffitarget.h: Ensure needed constants are available
	for targets which do not have sgidefs.h.

From-SVN: r169936
2011-02-08 19:17:55 +00:00
Jakub Jelinek
d652f226fc Update Copyright years for files modified in 2010.
From-SVN: r168438
2011-01-03 21:52:22 +01:00
Iain Sandoe
3a9f56e8c8 re PR libffi/29152 (64-bit darwin ppc port needed for libffi)
libffi:
	PR libffi/29152
	PR libffi/42378
	* src/powerpc/darwin_closure.S: Provide Darwin64 implementation,
	update comments.
	* src/powerpc/ffitarget.h (POWERPC_DARWIN64): New,
	(FFI_TRAMPOLINE_SIZE): Update for Darwin64.
	* src/powerpc/darwin.S: Provide Darwin64 implementation,
	update comments.
	* src/powerpc/ffi_darwin.c: Likewise.

From-SVN: r168016
2010-12-18 08:56:46 +00:00
Chung-Lin Tang
fac6806566 sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive.
2010-12-03  Chung-Lin Tang  <cltang@codesourcery.com>

	* src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive.
	(ffi_closure_VFP): Same.
	(ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp'
	directive.

From-SVN: r167434
2010-12-03 16:15:26 +00:00
Richard Henderson
e12bcbf492 sysv.S (FDE_ENCODING, FDE_ENCODE): Define.
2010-11-29  Richard Henderson  <rth@redhat.com>
	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* src/x86/sysv.S (FDE_ENCODING, FDE_ENCODE): Define.
	(.eh_frame): Use FDE_ENCODING.
	(.LASFDE1, .LASFDE2, LASFDE3): Simplify with FDE_ENCODE.

Co-Authored-By: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>

From-SVN: r167251
2010-11-29 16:43:24 +00:00
Chung-Lin Tang
46e0720d66 Add ARM VFP ABI support to libffi.
From-SVN: r166032
2010-10-28 18:11:11 +00:00
Jakub Jelinek
731fc5f040 re PR libffi/45677 (Bad stack allocation for ffi function calls on x86-64)
PR libffi/45677
	* src/x86/ffi64.c (ffi_prep_cif_machdep): Ensure cif->bytes is
	a multiple of 8.
	* testsuite/libffi.call/many2.c: New test.

From-SVN: r164829
2010-10-01 09:31:49 +02:00
Mark Wielaard
2cd8686617 closures.c (open_temp_exec_file_mnt): Check if getmntent_r returns NULL.
* src/closures.c (open_temp_exec_file_mnt): Check if getmntent_r
	returns NULL.

From-SVN: r163809
2010-09-03 10:35:35 +00:00
Dan Witte
7862d49629 Remove warnings
From-SVN: r162959
2010-08-06 20:05:33 +00:00
Dan Witte
49f6cd1f25 Add OS/2 Support
Co-Authored-By: Walter Meinl <wuno@lsvw.de>

From-SVN: r162946
2010-08-06 12:36:26 +00:00
Dan Horák
3d420bdf4d Define libffi macros carefully
From-SVN: r162945
2010-08-06 12:26:52 +00:00
Michael Kohler
0af2372948 Fix spelling errors
From-SVN: r162938
2010-08-06 05:45:23 +00:00
Evan Phoenix
07b6d9efd9 Fix SELinux test
From-SVN: r162937
2010-08-06 05:40:15 +00:00
Matthias Klose
4736718a4e Improve libffi comments
From-SVN: r162936
2010-08-06 05:28:37 +00:00
Anthony Green
3ac097a580 Enable build with microsoft compiler
From-SVN: r162935
2010-08-06 05:24:11 +00:00
Oliver Kiddle
fc28e435cf Enable build with sun compiler
From-SVN: r162933
2010-08-06 04:55:25 +00:00
Neil Roberts
4138b429ca sysv.S (ffi_call_SYSV): Align the stack pointer to 16-bytes.
2010-07-07   Neil Roberts <neil@linux.intel.com>

	* src/x86/sysv.S (ffi_call_SYSV): Align the stack pointer to
	16-bytes.

From-SVN: r161922
2010-07-07 15:59:30 +00:00
Rainer Orth
d416abb494 configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as output, too.
* configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as
	output, too.
	(libffi_cv_as_ascii_pseudo_op): Check for .ascii.
	(libffi_cv_as_string_pseudo_op): Check for .string.
	* configure: Regenerate.
	* fficonfig.h.in: Regenerate.
	* src/x86/sysv.S (.eh_frame): Use .ascii, .string or error.

From-SVN: r159570
2010-05-19 15:31:36 +00:00
Rainer Orth
f4b130bb74 configure.ac (libffi_cv_as_x86_64_unwind_section_type): New test.
* configure.ac (libffi_cv_as_x86_64_unwind_section_type): New test.
	* configure: Regenerate.
	* fficonfig.h.in: Regenerate.
	* libffi/src/x86/unix64.S (.eh_frame)
	[HAVE_AS_X86_64_UNWIND_SECTION_TYPE]: Use @unwind section type.

From-SVN: r157466
2010-03-15 19:36:26 +00:00
Matthias Klose
694d3cfd60 sysv.S (__ARM_ARCH__): Define for processor __ARM_ARCH_7EM__.
2010-02-15  Matthias Klose  <doko@ubuntu.com>

        * src/arm/sysv.S (__ARM_ARCH__): Define for processor
        __ARM_ARCH_7EM__.

From-SVN: r156771
2010-02-15 15:19:30 +00:00
Rainer Orth
86d1b9d1e0 * src/mips/n32.S: Use .abicalls and .eh_frame with __GNUC__.
From-SVN: r155674
2010-01-06 14:22:26 +00:00
David Edelsohn
72b79d3945 ffi_darwin.c (ffi_prep_args): Copy abi and nargs to local variables.
* src/powerpc/ffi_darwin.c (ffi_prep_args): Copy abi and nargs to
        local variables.
        (aix_adjust_aggregate_sizes): New function.
        (ffi_prep_cif_machdep): Call it.

From-SVN: r155492
2009-12-28 13:19:18 -05:00
Andreas Tobler
99fba2c42a configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets.
2009-12-26  Andreas Tobler  <a.tobler@schweiz.org>

	* configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets.
	* configure: Regenerate.
	* fficonfig.h.in: Likewise.
	* src/closures.c: Remove the FFI_MMAP_EXEC_WRIT definition for
	Solaris/x86.

From-SVN: r155475
2009-12-26 19:49:55 +01:00
Andreas Schwab
302486f4fb ffi.c (ffi_prep_args_SYSV): Advance intarg_count when a float arguments is passed in memory.
* src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count
when a float arguments is passed in memory.
(ffi_closure_helper_SYSV): Mark general registers as used up when
a 64bit or soft-float long double argument is passed in memory.

From-SVN: r155473
2009-12-26 12:40:27 +00:00
Frank Everdij
c4205f77f3 IRIX support
From-SVN: r155470
2009-12-26 04:59:25 +00:00
Bradley Smith
124f60ab29 avr32 libffi port
From-SVN: r155469
2009-12-26 04:21:07 +00:00
John David Anglin
f93a40eaa3 ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE type on HP-UX.
* src/pa/ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE
	type on HP-UX.

From-SVN: r155205
2009-12-14 02:42:18 +00:00
Eric Botcazou
fb01d970c4 ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long double' arguments.
* src/sparc/ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long
	double' arguments.

From-SVN: r155152
2009-12-11 10:06:18 +00:00
Rainer Orth
dcb00f2e8e re PR libffi/40700 (All amd64 libffi execution tests fail on Solaris 10/x86)
PR libffi/40700
	* src/closures.c [X86_64 && __sun__ && __svr4__]
	(FFI_MMAP_EXEC_WRIT): Define.

From-SVN: r155124
2009-12-10 10:09:17 +00:00
David Edelsohn
9e7e65a08b aix_closure.S (libffi_closure_ASM): Fix tablejump typo.
* src/powerpc/aix_closure.S (libffi_closure_ASM): Fix tablejump
        typo.

From-SVN: r155070
2009-12-07 19:41:10 -05:00
David Edelsohn
5d7fc9412c aix.S: Update AIX32 code to be consistent with AIX64 code.
* src/powerpc/aix.S: Update AIX32 code to be consistent with AIX64
        code.
        * src/powerpc/aix_closure.s: Same.

From-SVN: r155016
2009-12-05 16:48:58 -05:00
David Edelsohn
2f2d73866b aix_closure.S: Reorganize 64-bit code to match linux64_closure.S.
* src/powerpc/aix_closure.S: Reorganize 64-bit code to match
        linux64_closure.S.

From-SVN: r155001
2009-12-04 17:24:05 -05:00
Uros Bizjak
6078f50a12 re PR libffi/41908 (closures fail for some structure arguments containing floats)
PR libffi/41908
	* src/x86/ffi64.c (classify_argument): Update from
	gcc/config/i386/i386.c.
	(ffi_closure_unix64_inner): Do not use the address of two consecutive
	SSE registers directly.
	* testsuite/libffi.call/cls_dbls_struct.c (main): Remove xfail
	for x86_64 linux targets.

From-SVN: r154988
2009-12-04 19:41:59 +01:00
David Edelsohn
0c5526222c ffi_darwin.c (ffi_closure_helper_DARWIN): Increment pfr for long double split between fpr13 and stack.
* src/powerpc/ffi_darwin.c (ffi_closure_helper_DARWIN): Increment
        pfr for long double split between fpr13 and stack.

From-SVN: r154983
2009-12-04 10:36:50 -05:00
David Edelsohn
afb5e62297 ffi_darwin.c (ffi_prep_args): Increment next_arg and fparg_count twice for long double.
* src/powerpc/ffi_darwin.c (ffi_prep_args): Increment next_arg and
        fparg_count twice for long double.

From-SVN: r154967
2009-12-03 22:43:40 -05:00
David Edelsohn
be311914b8 re PR libffi/42243 (powerpc-apple-darwin9 libffi failures)
PR libffi/42243
        * src/powerpc/ffi_darwin.c (ffi_prep_args): Remove extra parentheses.

From-SVN: r154956
2009-12-03 14:09:29 -05:00
David Edelsohn
7837c24708 ffi_darwin.c (ffi_prep_args): Fix typo in INT64 case.
* src/powerpc/ffi_darwin.c (ffi_prep_args): Fix typo in INT64
        case.

From-SVN: r154932
2009-12-02 20:32:21 -05:00
David Edelsohn
6d518d3b72 aix.S (ffi_call_AIX): Convert to more standard register usage.
* src/powerpc/aix.S (ffi_call_AIX): Convert to more standard
        register usage.  Call ffi_prep_args directly.  Add long double
        return value support.
        * src/powerpc/ffi_darwin.c (ffi_prep_args): Double arg increment
        applies to FFI_TYPE_DOUBLE.  Correct fpr_base increment typo.
        Separate FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases.
        (ffi_prep_cif_machdep): Only 16 byte stack alignment in 64 bit
        mode.
        (ffi_closure_helper_DARWIN): Remove nf and ng counters.  Move temp
        into case.
        * src/powerpc/aix_closure.S: Maintain 16 byte stack alignment.
        Allocate result area between params and FPRs.

From-SVN: r154892
2009-12-01 23:21:08 -05:00
David Edelsohn
5751cf6fef re PR libffi/35484 (libffi doesn't support AIX 64bit)
2009-11-30  David Edelsohn  <edelsohn@gnu.org>

        PR target/35484
        * src/powerpc/ffitarget.h (POWERPC64): Define for PPC64 Linux and
        AIX64.
        * src/powerpc/aix.S: Implement AIX64 version.
        * src/powerpc/aix_closure.S: Implement AIX64 version.
        (ffi_closure_ASM): Use extsb, lha and displament addresses.
        * src/powerpc/ffi_darwin.c (ffi_prep_args): Implement AIX64
        support.
        (ffi_prep_cif_machdep): Same.
        (ffi_call): Same.
        (ffi_closure_helper_DARWIN): Same.

From-SVN: r154855
2009-11-30 18:34:33 -05:00
Kai Tietz
ef6ed66d16 win64.S (_ffi_call_win64 stack): Remove for gnu assembly version use of ___chkstk.
2009-09-28  Kai Tietz  <kai.tietz@onevision.com>

        * src/x86/win64.S (_ffi_call_win64 stack): Remove for gnu
        assembly version use of ___chkstk.

From-SVN: r152256
2009-09-29 00:26:25 +02:00
Matthias Klose
29d1370a8f PR libffi/40242, PR libffi/41443
2009-09-23  Matthias Klose  <doko@ubuntu.com>

        PR libffi/40242, PR libffi/41443
        * src/arm/sysv.S (__ARM_ARCH__): Define for processors
        __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__,
        __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__.
        Change the conditionals to __SOFTFP__ || __ARM_EABI__
        for -mfloat-abi=softfp to work.

From-SVN: r152075
2009-09-23 14:50:35 +00:00
Loren J. Rittle
987ce5575c PR testsuite/32843 (strikes again)
2009-09-17  Loren J. Rittle  <ljrittle@acm.org>

	PR testsuite/32843 (strikes again)
	* src/x86/ffi.c (ffi_prep_cif_machdep): Add X86_FREEBSD to
	enable proper extension on char and short.

From-SVN: r151819
2009-09-17 20:54:56 +00:00
David Daney
5cbf8c8d0b java_raw_api.c (ffi_java_raw_to_rvalue): Remove special handling for FFI_TYPE_POINTER.
2009-09-15  David Daney  <ddaney@caviumnetworks.com>

	* src/java_raw_api.c (ffi_java_raw_to_rvalue): Remove special
	handling for FFI_TYPE_POINTER.
	* src/mips/ffitarget.h (FFI_TYPE_STRUCT_D_SOFT,
	FFI_TYPE_STRUCT_F_SOFT, FFI_TYPE_STRUCT_DD_SOFT,
	FFI_TYPE_STRUCT_FF_SOFT, FFI_TYPE_STRUCT_FD_SOFT,
	FFI_TYPE_STRUCT_DF_SOFT, FFI_TYPE_STRUCT_SOFT): New defines.
	(FFI_N32_SOFT_FLOAT, FFI_N64_SOFT_FLOAT): New ffi_abi enumerations.
	(enum ffi_abi): Set FFI_DEFAULT_ABI for soft-float.
	* src/mips/n32.S (ffi_call_N32): Add handling for soft-float
	structure and pointer returns.
	(ffi_closure_N32): Add handling for pointer returns.
	* src/mips/ffi.c (ffi_prep_args, calc_n32_struct_flags,
	calc_n32_return_struct_flags): Handle soft-float.
	(ffi_prep_cif_machdep):  Handle soft-float, fix pointer handling.
	(ffi_call_N32): Declare proper argument types.
	(ffi_call, copy_struct_N32, ffi_closure_mips_inner_N32): Handle
	soft-float.

From-SVN: r151726
2009-09-15 17:15:33 +00:00
Dave Korn
723512bab1 re PR libffi/40807 (libffi.call/return_sc.c)
PR libffi/40807
	* src/x86/ffi.c (ffi_prep_cif_machdep): Also use sign/zero-extending
	return types for X86_WIN32.
	* src/x86/win32.S (_ffi_call_SYSV): Handle omitted return types.
	(_ffi_call_STDCALL, _ffi_closure_SYSV, _ffi_closure_raw_SYSV,
	_ffi_closure_STDCALL): Likewise.

	* src/closures.c (is_selinux_enabled): Define to const 0 for Cygwin.
	(dlmmap, dlmunmap): Also use these functions on Cygwin.

From-SVN: r150042
2009-07-24 10:12:16 +00:00
Wim Lewis
6975f17fe7 ffi.c: Avoid clobbering cr3 and cr4, which are supposed to be callee-saved.
2009-06-16  Wim Lewis  <wiml@hhhh.org>

	* src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are
	supposed to be callee-saved.
	* src/powerpc/sysv.S (small_struct_return_value): Fix overrun of
	return buffer for odd-size structs.

From-SVN: r148543
2009-06-16 19:55:39 +02:00