aboutsummaryrefslogtreecommitdiff
path: root/libffi/src/closures.c
AgeCommit message (Collapse)AuthorFilesLines
2015-01-12Merge libffi to upstream commit c82cc159426d8d4402375fa1ae3f045b9cf82e16Richard Henderson1-10/+54
From-SVN: r219477
2013-03-07closures.c (is_emutramp_enabled [!FFI_MMAP_EXEC_EMUTRAMP_PAX]): Move default ↵Dave Korn1-2/+4
definition outside enclosing #if scope. * src/closures.c (is_emutramp_enabled [!FFI_MMAP_EXEC_EMUTRAMP_PAX]): Move default definition outside enclosing #if scope. From-SVN: r196527
2012-12-26libffi mergeAnthony Green1-0/+27
From-SVN: r194722
2012-03-04Merge upstream libffiAnthony Green1-9/+14
From-SVN: r184897
2011-01-03Update Copyright years for files modified in 2010.Jakub Jelinek1-1/+1
From-SVN: r168438
2010-09-03closures.c (open_temp_exec_file_mnt): Check if getmntent_r returns NULL.Mark Wielaard1-1/+1
* src/closures.c (open_temp_exec_file_mnt): Check if getmntent_r returns NULL. From-SVN: r163809
2010-08-06Add OS/2 SupportDan Witte1-5/+5
Co-Authored-By: Walter Meinl <wuno@lsvw.de> From-SVN: r162946
2010-08-06Fix SELinux testEvan Phoenix1-1/+1
From-SVN: r162937
2009-12-26configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets.Andreas Tobler1-5/+0
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-10re PR libffi/40700 (All amd64 libffi execution tests fail on Solaris 10/x86)Rainer Orth1-1/+6
PR libffi/40700 * src/closures.c [X86_64 && __sun__ && __svr4__] (FFI_MMAP_EXEC_WRIT): Define. From-SVN: r155124
2009-07-24re PR libffi/40807 (libffi.call/return_sc.c)Dave Korn1-5/+13
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-06-12[multiple changes]Andrew Haley1-0/+27
2009-06-12 Andrew Haley <aph@redhat.com> * ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c, testsuite/libffi.call/cls_align_uint64.c, testsuite/libffi.call/cls_ulonglong.c, testsuite/libffi.call/return_ll1.c, testsuite/libffi.call/stret_medium2.c: Fix printf format specifiers. testsuite/libffi.special/unwindtest.cc: include stdint.h. 2009-06-11 Timothy Wall <twall@users.sf.net> * Makefile.am, configure.ac, include/ffi.h.in, include/ffi_common.h, src/closures.c, src/dlmalloc.c, src/x86/ffi.c, src/x86/ffitarget.h, src/x86/win64.S (new), README: Added win64 support (mingw or MSVC) * Makefile.in, include/Makefile.in, man/Makefile.in, testsuite/Makefile.in, configure, aclocal.m4: Regenerated * ltcf-c.sh: properly escape cygwin/w32 path * man/ffi_call.3: Clarify size requirements for return value. * src/x86/ffi64.c: Fix filename in comment. * src/x86/win32.S: Remove unused extern. * testsuite/libffi.call/closure_fn0.c, testsuite/libffi.call/closure_fn1.c, testsuite/libffi.call/closure_fn2.c, testsuite/libffi.call/closure_fn3.c, testsuite/libffi.call/closure_fn4.c, testsuite/libffi.call/closure_fn5.c, testsuite/libffi.call/closure_fn6.c, testsuite/libffi.call/closure_stdcall.c, testsuite/libffi.call/cls_12byte.c, testsuite/libffi.call/cls_16byte.c, testsuite/libffi.call/cls_18byte.c, testsuite/libffi.call/cls_19byte.c, testsuite/libffi.call/cls_1_1byte.c, testsuite/libffi.call/cls_20byte.c, testsuite/libffi.call/cls_20byte1.c, testsuite/libffi.call/cls_24byte.c, testsuite/libffi.call/cls_2byte.c, testsuite/libffi.call/cls_3_1byte.c, testsuite/libffi.call/cls_3byte1.c, testsuite/libffi.call/cls_3byte2.c, testsuite/libffi.call/cls_4_1byte.c, testsuite/libffi.call/cls_4byte.c, testsuite/libffi.call/cls_5_1_byte.c, testsuite/libffi.call/cls_5byte.c, testsuite/libffi.call/cls_64byte.c, testsuite/libffi.call/cls_6_1_byte.c, testsuite/libffi.call/cls_6byte.c, testsuite/libffi.call/cls_7_1_byte.c, testsuite/libffi.call/cls_7byte.c, testsuite/libffi.call/cls_8byte.c, testsuite/libffi.call/cls_9byte1.c, testsuite/libffi.call/cls_9byte2.c, testsuite/libffi.call/cls_align_double.c, testsuite/libffi.call/cls_align_float.c, testsuite/libffi.call/cls_align_longdouble.c, testsuite/libffi.call/cls_align_longdouble_split.c, testsuite/libffi.call/cls_align_longdouble_split2.c, testsuite/libffi.call/cls_align_pointer.c, testsuite/libffi.call/cls_align_sint16.c, testsuite/libffi.call/cls_align_sint32.c, testsuite/libffi.call/cls_align_sint64.c, testsuite/libffi.call/cls_align_uint16.c, testsuite/libffi.call/cls_align_uint32.c, testsuite/libffi.call/cls_align_uint64.c, testsuite/libffi.call/cls_dbls_struct.c, testsuite/libffi.call/cls_double.c, testsuite/libffi.call/cls_double_va.c, testsuite/libffi.call/cls_float.c, testsuite/libffi.call/cls_longdouble.c, testsuite/libffi.call/cls_longdouble_va.c, testsuite/libffi.call/cls_multi_schar.c, testsuite/libffi.call/cls_multi_sshort.c, testsuite/libffi.call/cls_multi_sshortchar.c, testsuite/libffi.call/cls_multi_uchar.c, testsuite/libffi.call/cls_multi_ushort.c, testsuite/libffi.call/cls_multi_ushortchar.c, testsuite/libffi.call/cls_pointer.c, testsuite/libffi.call/cls_pointer_stack.c, testsuite/libffi.call/cls_schar.c, testsuite/libffi.call/cls_sint.c, testsuite/libffi.call/cls_sshort.c, testsuite/libffi.call/cls_uchar.c, testsuite/libffi.call/cls_uint.c, testsuite/libffi.call/cls_ulonglong.c, testsuite/libffi.call/cls_ushort.c, testsuite/libffi.call/err_bad_abi.c, testsuite/libffi.call/err_bad_typedef.c, testsuite/libffi.call/float2.c, testsuite/libffi.call/huge_struct.c, testsuite/libffi.call/nested_struct.c, testsuite/libffi.call/nested_struct1.c, testsuite/libffi.call/nested_struct10.c, testsuite/libffi.call/nested_struct2.c, testsuite/libffi.call/nested_struct3.c, testsuite/libffi.call/nested_struct4.c, testsuite/libffi.call/nested_struct5.c, testsuite/libffi.call/nested_struct6.c, testsuite/libffi.call/nested_struct7.c, testsuite/libffi.call/nested_struct8.c, testsuite/libffi.call/nested_struct9.c, testsuite/libffi.call/problem1.c, testsuite/libffi.call/return_ldl.c, testsuite/libffi.call/return_ll1.c, testsuite/libffi.call/stret_large.c, testsuite/libffi.call/stret_large2.c, testsuite/libffi.call/stret_medium.c, testsuite/libffi.call/stret_medium2.c, testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead of checking for MMAP. Use intptr_t instead of long casts. 2009-06-12 Andrew Haley <aph@redhat.com> * Makefile.am: Remove info_TEXINFOS. From-SVN: r148433
2009-06-042009-06-04 Andrew Haley <aph@redhat.com>Andrew Haley1-7/+8
include/ffi.h.in, src/arm/ffitarget.h, src/arm/ffi.c, src/arm/sysv.S, src/powerpc/ffitarget.h, src/closures.c, src/sh64/ffitarget.h, src/sh64/ffi.c, src/sh64/sysv.S, src/types.c, src/x86/ffi64.c, src/x86/ffitarget.h, src/x86/win32.S, src/x86/darwin.S, src/x86/ffi.c, src/x86/sysv.S, src/x86/unix64.S, src/alpha/ffitarget.h, src/alpha/ffi.c, src/alpha/osf.S, src/m68k/ffitarget.h, src/frv/ffitarget.h, src/frv/ffi.c, src/s390/ffitarget.h, src/s390/sysv.S, src/cris/ffitarget.h, src/pa/linux.S, src/pa/ffitarget.h, src/pa/ffi.c, src/raw_api.c, src/ia64/ffitarget.h, src/ia64/unix.S, src/ia64/ffi.c, src/ia64/ia64_flags.h, src/java_raw_api.c, src/debug.c, src/sparc/v9.S, src/sparc/ffitarget.h, src/sparc/ffi.c, src/sparc/v8.S, src/mips/ffitarget.h, src/mips/n32.S, src/mips/o32.S, src/mips/ffi.c, src/prep_cif.c, src/sh/ffitarget.h, src/sh/ffi.c, src/sh/sysv.S: Update license text. From-SVN: r148171
2007-11-25closures.c: Move defintion of MAYBE_UNUSED from here to ...Andreas Tobler1-2/+1
2007-11-25 Andreas Tobler <a.tobler@schweiz.org> * src/closures.c: Move defintion of MAYBE_UNUSED from here to ... * include/ffi_common.h: ... here. Update copyright. From-SVN: r130413
2007-04-03closures.c: Include sys/statfs.h.Jakub Jelinek1-1/+63
* src/closures.c: Include sys/statfs.h. (_GNU_SOURCE): Define on Linux. (FFI_MMAP_EXEC_SELINUX): Define. (selinux_enabled): New variable. (selinux_enabled_check): New function. (is_selinux_enabled): Define. (dlmmap): Use it. * configure.ac (NO_EXECUTE_PERMISSION): Set by default. * configure: Rebuilt. From-SVN: r123457
2007-03-07ffi.h.in (ffi_closure_alloc, [...]): New.Alexandre Oliva1-0/+513
libffi/ChangeLog: * include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New. (ffi_prep_closure_loc): New. (ffi_prep_raw_closure_loc): New. (ffi_prep_java_raw_closure_loc): New. * src/closures.c: New file. * src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment): Replace sflags with exec_offset. [FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset, sub_segment_exec_offset): New macros. (get_segment_flags, set_segment_flags, check_segment_merge): New macros. (is_mmapped_segment, is_extern_segment): Use get_segment_flags. (add_segment, sys_alloc, create_mspace, create_mspace_with_base, destroy_mspace): Use new macros. (sys_alloc): Silence warning. * Makefile.am (libffi_la_SOURCES): Add src/closures.c. * Makefile.in: Rebuilt. * src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in terms of ffi_prep_closure_loc. * src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted from... (ffi_prep_raw_closure): ... this. Re-implement in terms of the renamed version. * src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and adjusted from... (ffi_prep_java_raw_closure): ... this. Re-implement in terms of the renamed version. * src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from (ffi_prep_closure): ... this. * src/pa/ffi.c: Likewise. * src/cris/ffi.c: Likewise. Adjust. * src/frv/ffi.c: Likewise. * src/ia64/ffi.c: Likewise. * src/mips/ffi.c: Likewise. * src/powerpc/ffi_darwin.c: Likewise. * src/s390/ffi.c: Likewise. * src/sh/ffi.c: Likewise. * src/sh64/ffi.c: Likewise. * src/sparc/ffi.c: Likewise. * src/x86/ffi64.c: Likewise. * src/x86/ffi.c: Likewise. (FFI_INIT_TRAMPOLINE): Adjust. (ffi_prep_raw_closure_loc): Renamed and adjusted from... (ffi_prep_raw_closure): ... this. * src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from (ffi_prep_closure): ... this. (flush_icache): Adjust. boehm-gc/ChangeLog: * include/gc.h (GC_REGISTER_FINALIZER_UNREACHABLE): New. (GC_register_finalizer_unreachable): Declare. (GC_debug_register_finalizer_unreachable): Declare. * finalize.c (GC_unreachable_finalize_mark_proc): New. (GC_register_finalizer_unreachable): New. (GC_finalize): Handle it. * dbg_mlc.c (GC_debug_register_finalizer_unreachable): New. (GC_debug_register_finalizer_no_order): Fix whitespace. libjava/ChangeLog: * include/jvm.h (_Jv_ClosureListFinalizer): New. (_Jv_Linker::create_error_method): Adjust. * boehm.cc (_Jv_ClosureListFinalizer): New. * nogc.cc (_Jv_ClosureListFinalizer): New. * java/lang/Class.h (class _Jv_ClosureList): New. (class java::lang::Class): Declare it as friend. * java/lang/natClass.cc (_Jv_ClosureList::releaseClosures): New. (_Jv_ClosureList::registerClousure): New. * include/execution.h (_Jv_ExecutionEngine): Add get_closure_list. (_Jv_CompiledEngine::do_get_closure_list): New. (_Jv_CompiledEngine::_Jv_CompiledEngine): Use it. (_Jv_IndirectCompiledClass): Add closures. (_Jv_IndirectCompiledEngine::get_aux_info): New. (_Jv_IndirectCompiledEngine::do_allocate_field_initializers): Use it. (_Jv_IndirectCompiledEngine::do_get_closure_list): New. (_Jv_IndirectCompiledEngine::_Jv_IndirectCompiledEngine): Use it. (_Jv_InterpreterEngine::do_get_closure_list): Declare. (_Jv_InterpreterEngine::_Jv_InterpreterEngine): Use it. * interpret.cc (FFI_PREP_RAW_CLOSURE): Use _loc variants. (node_closure): Add closure list. (_Jv_InterpMethod::ncode): Add jclass argument. Use ffi_closure_alloc and the separate code pointer. Register the closure for finalization. (_Jv_JNIMethod::ncode): Likewise. (_Jv_InterpreterEngine::do_create_ncode): Pass klass to ncode. (_Jv_InterpreterEngine::do_get_closure_list): New. * include/java-interp.h (_Jv_InterpMethod::ncode): Adjust. (_Jv_InterpClass): Add closures field. (_Jv_JNIMethod::ncode): Adjust. * defineclass.cc (_Jv_ClassReader::handleCodeAttribute): Adjust. (_Jv_ClassReader::handleMethodsEnd): Likewise. * link.cc (struct method_closure): Add closure list. (_Jv_Linker::create_error_method): Add jclass argument. Use ffi_closure_alloc and the separate code pointer. Register the closure for finalization. (_Jv_Linker::link_symbol_table): Remove outdated comment about sharing of otable and atable. Adjust. * java/lang/reflect/natVMProxy.cc (ncode_closure): Add closure list. (ncode): Add jclass argument. Use ffi_closure_alloc and the separate code pointer. Register the closure for finalization. (java::lang::reflect::VMProxy::generateProxyClass): Adjust. * testsuite/libjava.jar/TestClosureGC.java: New. * testsuite/libjava.jar/TestClosureGC.out: New. * testsuite/libjava.jar/TestClosureGC.xfail: New. * testsuite/libjava.jar/TestClosureGC.jar: New. From-SVN: r122652