ffi 1.1.5 → 1.15.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +338 -0
- data/COPYING +49 -0
- data/Gemfile +14 -0
- data/LICENSE +21 -11
- data/LICENSE.SPECS +22 -0
- data/README.md +136 -0
- data/Rakefile +149 -154
- data/ext/ffi_c/AbstractMemory.c +133 -57
- data/ext/ffi_c/AbstractMemory.h +21 -12
- data/ext/ffi_c/ArrayType.c +27 -14
- data/ext/ffi_c/ArrayType.h +21 -12
- data/ext/ffi_c/Buffer.c +29 -25
- data/ext/ffi_c/Call.c +154 -125
- data/ext/ffi_c/Call.h +43 -20
- data/ext/ffi_c/ClosurePool.c +100 -42
- data/ext/ffi_c/ClosurePool.h +24 -13
- data/ext/ffi_c/DynamicLibrary.c +47 -28
- data/ext/ffi_c/DynamicLibrary.h +70 -12
- data/ext/ffi_c/Function.c +119 -167
- data/ext/ffi_c/Function.h +23 -19
- data/ext/ffi_c/FunctionInfo.c +55 -25
- data/ext/ffi_c/LastError.c +70 -21
- data/ext/ffi_c/LastError.h +21 -12
- data/ext/ffi_c/LongDouble.c +15 -9
- data/ext/ffi_c/LongDouble.h +21 -16
- data/ext/ffi_c/MappedType.c +22 -15
- data/ext/ffi_c/MappedType.h +21 -12
- data/ext/ffi_c/MemoryPointer.c +58 -33
- data/ext/ffi_c/MemoryPointer.h +22 -19
- data/ext/ffi_c/MethodHandle.c +49 -50
- data/ext/ffi_c/MethodHandle.h +24 -14
- data/ext/ffi_c/Platform.c +28 -62
- data/ext/ffi_c/Platform.h +21 -12
- data/ext/ffi_c/Pointer.c +63 -46
- data/ext/ffi_c/Pointer.h +22 -19
- data/ext/ffi_c/Struct.c +198 -80
- data/ext/ffi_c/Struct.h +33 -18
- data/ext/ffi_c/StructByValue.c +23 -20
- data/ext/ffi_c/StructByValue.h +21 -12
- data/ext/ffi_c/StructLayout.c +184 -39
- data/ext/ffi_c/Thread.c +73 -270
- data/ext/ffi_c/Thread.h +32 -35
- data/ext/ffi_c/Type.c +26 -32
- data/ext/ffi_c/Type.h +24 -10
- data/ext/ffi_c/Types.c +28 -20
- data/ext/ffi_c/Types.h +25 -16
- data/ext/ffi_c/Variadic.c +78 -39
- data/ext/ffi_c/compat.h +25 -17
- data/ext/ffi_c/extconf.rb +68 -31
- data/ext/ffi_c/ffi.c +27 -20
- data/ext/ffi_c/libffi/.appveyor.yml +66 -0
- data/ext/ffi_c/libffi/.gitattributes +4 -0
- data/ext/ffi_c/libffi/.github/issue_template.md +10 -0
- data/ext/ffi_c/libffi/.gitignore +38 -0
- data/ext/ffi_c/libffi/.travis/ar-lib +270 -0
- data/ext/ffi_c/libffi/.travis/bfin-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +14 -0
- data/ext/ffi_c/libffi/.travis/build-in-container.sh +12 -0
- data/ext/ffi_c/libffi/.travis/build.sh +142 -0
- data/ext/ffi_c/libffi/.travis/compile +351 -0
- data/ext/ffi_c/libffi/.travis/install.sh +71 -0
- data/ext/ffi_c/libffi/.travis/m32r-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/moxie-sim.exp +60 -0
- data/ext/ffi_c/libffi/.travis/or1k-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/site.exp +27 -0
- data/ext/ffi_c/libffi/.travis/wine-sim.exp +55 -0
- data/ext/ffi_c/libffi/.travis.yml +83 -0
- data/ext/ffi_c/libffi/{ChangeLog → ChangeLog.old} +6366 -3559
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +353 -0
- data/ext/ffi_c/libffi/Makefile.am +123 -169
- data/ext/ffi_c/libffi/Makefile.in +1243 -1003
- data/ext/ffi_c/libffi/README.md +486 -0
- data/ext/ffi_c/libffi/acinclude.m4 +387 -0
- data/ext/ffi_c/libffi/autogen.sh +2 -0
- data/ext/ffi_c/libffi/config.guess +690 -504
- data/ext/ffi_c/libffi/config.sub +1353 -1207
- data/ext/ffi_c/libffi/configure +7308 -2449
- data/ext/ffi_c/libffi/configure.ac +178 -259
- data/ext/ffi_c/libffi/configure.host +311 -4
- data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
- data/ext/ffi_c/libffi/doc/Makefile.in +815 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +455 -58
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +37 -13
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +201 -0
- data/ext/ffi_c/libffi/include/Makefile.am +3 -3
- data/ext/ffi_c/libffi/include/Makefile.in +196 -75
- data/ext/ffi_c/libffi/include/ffi.h.in +163 -67
- data/ext/ffi_c/libffi/include/ffi_cfi.h +55 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +39 -12
- data/ext/ffi_c/libffi/install-sh +207 -209
- data/ext/ffi_c/libffi/libffi.map.in +76 -0
- data/ext/ffi_c/libffi/libffi.pc.in +3 -2
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +997 -0
- data/ext/ffi_c/libffi/libtool-ldflags +106 -0
- data/ext/ffi_c/libffi/libtool-version +1 -1
- data/ext/ffi_c/libffi/ltmain.sh +3641 -2026
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +50 -0
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +32 -14
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +33 -106
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +53 -0
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +38 -13
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +8 -29
- data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +11 -9
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +104 -52
- data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +18 -8
- data/ext/ffi_c/libffi/m4/ax_require_defined.m4 +37 -0
- data/ext/ffi_c/libffi/make_sunver.pl +333 -0
- data/ext/ffi_c/libffi/man/Makefile.am +2 -2
- data/ext/ffi_c/libffi/man/Makefile.in +151 -55
- data/ext/ffi_c/libffi/man/ffi.3 +10 -0
- data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +6 -4
- data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +73 -0
- data/ext/ffi_c/libffi/missing +153 -314
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
- data/ext/ffi_c/libffi/{include/ffi.h.vc64 → msvc_build/aarch64/aarch64_include/ffi.h} +151 -67
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
- data/ext/ffi_c/libffi/msvcc.sh +176 -20
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +1025 -0
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +97 -0
- data/ext/ffi_c/libffi/src/aarch64/internal.h +68 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +451 -0
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
- data/ext/ffi_c/libffi/src/alpha/ffi.c +335 -98
- data/ext/ffi_c/libffi/src/alpha/ffitarget.h +10 -1
- data/ext/ffi_c/libffi/src/alpha/internal.h +23 -0
- data/ext/ffi_c/libffi/src/alpha/osf.S +161 -266
- data/ext/ffi_c/libffi/src/arc/arcompact.S +135 -0
- data/ext/ffi_c/libffi/src/arc/ffi.c +266 -0
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +663 -515
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +32 -8
- data/ext/ffi_c/libffi/src/arm/internal.h +7 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +305 -417
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/avr32/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/bfin/ffi.c +196 -0
- data/ext/ffi_c/libffi/src/bfin/ffitarget.h +43 -0
- data/ext/ffi_c/libffi/src/bfin/sysv.S +179 -0
- data/ext/ffi_c/libffi/src/closures.c +465 -59
- data/ext/ffi_c/libffi/src/cris/ffi.c +10 -7
- data/ext/ffi_c/libffi/src/cris/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
- data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
- data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
- data/ext/ffi_c/libffi/src/debug.c +6 -1
- data/ext/ffi_c/libffi/src/dlmalloc.c +17 -12
- data/ext/ffi_c/libffi/src/frv/ffi.c +2 -2
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/ia64/ffi.c +35 -13
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +8 -2
- data/ext/ffi_c/libffi/src/ia64/unix.S +8 -1
- data/ext/ffi_c/libffi/src/java_raw_api.c +23 -5
- data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
- data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
- data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
- data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
- data/ext/ffi_c/libffi/src/m32r/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/m32r/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/m68k/ffi.c +87 -13
- data/ext/ffi_c/libffi/src/m68k/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/m68k/sysv.S +119 -32
- data/ext/ffi_c/libffi/src/m88k/ffi.c +400 -0
- data/ext/ffi_c/libffi/src/m88k/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/m88k/obsd.S +209 -0
- data/ext/ffi_c/libffi/src/metag/ffi.c +330 -0
- data/ext/ffi_c/libffi/{fficonfig.hw → src/metag/ffitarget.h} +22 -26
- data/ext/ffi_c/libffi/src/metag/sysv.S +311 -0
- data/ext/ffi_c/libffi/src/microblaze/ffi.c +321 -0
- data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/microblaze/sysv.S +302 -0
- data/ext/ffi_c/libffi/src/mips/ffi.c +135 -37
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +16 -14
- data/ext/ffi_c/libffi/src/mips/n32.S +128 -56
- data/ext/ffi_c/libffi/src/mips/o32.S +150 -27
- data/ext/ffi_c/libffi/src/moxie/eabi.S +55 -82
- data/ext/ffi_c/libffi/src/moxie/ffi.c +55 -46
- data/ext/ffi_c/libffi/src/moxie/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/ffi.c +304 -0
- data/ext/ffi_c/libffi/src/nios2/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/sysv.S +136 -0
- data/ext/ffi_c/libffi/src/or1k/ffi.c +328 -0
- data/ext/ffi_c/libffi/src/or1k/ffitarget.h +58 -0
- data/ext/ffi_c/libffi/src/or1k/sysv.S +107 -0
- data/ext/ffi_c/libffi/src/pa/ffi.c +46 -91
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +9 -7
- data/ext/ffi_c/libffi/src/pa/hpux32.S +4 -2
- data/ext/ffi_c/libffi/src/pa/linux.S +27 -4
- data/ext/ffi_c/libffi/src/powerpc/aix.S +245 -7
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +253 -4
- data/ext/ffi_c/libffi/src/powerpc/asm.h +2 -2
- data/ext/ffi_c/libffi/src/powerpc/darwin.S +2 -7
- data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +22 -26
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +105 -1378
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +123 -30
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1153 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +105 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +110 -45
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +189 -85
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +436 -108
- data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +138 -68
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +73 -119
- data/ext/ffi_c/libffi/src/prep_cif.c +111 -25
- data/ext/ffi_c/libffi/src/raw_api.c +18 -5
- data/ext/ffi_c/libffi/src/riscv/ffi.c +481 -0
- data/ext/ffi_c/libffi/src/riscv/ffitarget.h +69 -0
- data/ext/ffi_c/libffi/src/riscv/sysv.S +293 -0
- data/ext/ffi_c/libffi/src/s390/ffi.c +294 -318
- data/ext/ffi_c/libffi/src/s390/ffitarget.h +9 -1
- data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
- data/ext/ffi_c/libffi/src/s390/sysv.S +257 -366
- data/ext/ffi_c/libffi/src/sh/ffi.c +4 -3
- data/ext/ffi_c/libffi/src/sh/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/sh64/ffi.c +3 -2
- data/ext/ffi_c/libffi/src/sh64/ffitarget.h +6 -1
- data/ext/ffi_c/libffi/src/sparc/ffi.c +326 -527
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +608 -0
- data/ext/ffi_c/libffi/src/sparc/ffitarget.h +20 -7
- data/ext/ffi_c/libffi/src/sparc/internal.h +26 -0
- data/ext/ffi_c/libffi/src/sparc/v8.S +364 -234
- data/ext/ffi_c/libffi/src/sparc/v9.S +340 -207
- data/ext/ffi_c/libffi/src/tile/ffi.c +355 -0
- data/ext/ffi_c/libffi/src/tile/ffitarget.h +65 -0
- data/ext/ffi_c/libffi/src/tile/tile.S +360 -0
- data/ext/ffi_c/libffi/src/types.c +46 -15
- data/ext/ffi_c/libffi/src/vax/elfbsd.S +195 -0
- data/ext/ffi_c/libffi/src/vax/ffi.c +276 -0
- data/ext/ffi_c/libffi/src/vax/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/x86/asmnames.h +30 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +624 -498
- data/ext/ffi_c/libffi/src/x86/ffi64.c +379 -119
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +74 -35
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +318 -0
- data/ext/ffi_c/libffi/src/x86/internal.h +29 -0
- data/ext/ffi_c/libffi/src/x86/internal64.h +22 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +1070 -400
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +995 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +494 -299
- data/ext/ffi_c/libffi/src/x86/win64.S +231 -458
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +238 -0
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +298 -0
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +258 -0
- data/ext/ffi_c/libffi/stamp-h.in +1 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.am +115 -73
- data/ext/ffi_c/libffi/testsuite/Makefile.in +262 -114
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +334 -24
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +21 -1
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +50 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1745 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2885 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +743 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +28 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +25 -40
- data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +3 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +15 -12
- data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +4 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +107 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +6 -16
- data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +0 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +127 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +55 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +9 -7
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +7 -7
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +7 -6
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +9 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +9 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +196 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +121 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +123 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +125 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call/closure_stdcall.c → libffi.closures/closure_simple.c} +7 -16
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +95 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +4 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +4 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +4 -4
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +10 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +3 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +10 -9
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_args.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_many_mixed_float_double.c +55 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +11 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +114 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c +44 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c +44 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +138 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +20 -19
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +8 -8
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +7 -6
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +121 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +6 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +7 -7
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +7 -7
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +5 -5
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +2 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest.cc +3 -10
- data/ext/ffi_c/libffi/testsuite/{libffi.special → libffi.closures}/unwindtest_ffi_call.cc +3 -2
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +71 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +80 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +16 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.special/special.exp → libffi.complex/complex.exp} +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +51 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +37 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +34 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +19 -0
- data/ext/ffi_c/libffi.bsd.mk +12 -6
- data/ext/ffi_c/libffi.darwin.mk +21 -9
- data/ext/ffi_c/libffi.gnu.mk +3 -2
- data/ext/ffi_c/libffi.mk +11 -6
- data/ext/ffi_c/libffi.vc.mk +1 -1
- data/ext/ffi_c/libffi.vc64.mk +1 -1
- data/ext/ffi_c/rbffi.h +22 -14
- data/ext/ffi_c/rbffi_endian.h +11 -2
- data/ffi.gemspec +42 -0
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/autopointer.rb +70 -50
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/enum.rb +159 -24
- data/lib/ffi/errno.rb +21 -11
- data/lib/ffi/ffi.rb +25 -11
- data/lib/ffi/io.rb +24 -14
- data/lib/ffi/library.rb +174 -67
- data/lib/ffi/managedstruct.rb +63 -34
- data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
- data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
- data/lib/ffi/platform/aarch64-linux/types.conf +104 -0
- data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
- data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/arm-linux/types.conf +110 -82
- data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
- data/lib/ffi/platform/i386-darwin/types.conf +63 -63
- data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
- data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/{i486-gnu → i386-gnu}/types.conf +84 -84
- data/lib/ffi/platform/i386-linux/types.conf +77 -77
- data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
- data/lib/ffi/platform/i386-openbsd/types.conf +89 -87
- data/lib/ffi/platform/i386-solaris/types.conf +96 -96
- data/lib/ffi/platform/i386-windows/types.conf +43 -96
- data/lib/ffi/platform/ia64-linux/types.conf +79 -79
- data/lib/ffi/platform/mips-linux/types.conf +79 -79
- data/lib/ffi/platform/mips64-linux/types.conf +104 -0
- data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
- data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
- data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
- data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
- data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
- data/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
- data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
- data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
- data/lib/ffi/platform/s390-linux/types.conf +79 -79
- data/lib/ffi/platform/s390x-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
- data/lib/ffi/platform/sparc64-linux/types.conf +102 -0
- data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
- data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/lib/ffi/platform/x86_64-darwin/types.conf +93 -63
- data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -88
- data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
- data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
- data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
- data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
- data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -87
- data/lib/ffi/platform/x86_64-openbsd/types.conf +100 -92
- data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
- data/lib/ffi/platform/x86_64-windows/types.conf +52 -0
- data/lib/ffi/platform.rb +81 -26
- data/lib/ffi/pointer.rb +72 -27
- data/lib/ffi/struct.rb +99 -66
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/struct_layout_builder.rb +82 -17
- data/lib/ffi/tools/const_generator.rb +11 -8
- data/lib/ffi/tools/generator.rb +48 -1
- data/lib/ffi/tools/generator_task.rb +13 -16
- data/lib/ffi/tools/struct_generator.rb +6 -5
- data/lib/ffi/tools/types_generator.rb +14 -10
- data/lib/ffi/types.rb +31 -14
- data/lib/ffi/union.rb +23 -12
- data/lib/ffi/variadic.rb +25 -21
- data/lib/ffi/version.rb +3 -0
- data/lib/ffi.rb +20 -8
- data/rakelib/ffi_gem_helper.rb +65 -0
- data/samples/getlogin.rb +8 -0
- data/samples/getpid.rb +8 -0
- data/samples/gettimeofday.rb +18 -0
- data/samples/hello.rb +8 -0
- data/samples/inotify.rb +60 -0
- data/samples/pty.rb +75 -0
- data/samples/qsort.rb +20 -0
- metadata +413 -263
- data/History.txt +0 -1
- data/README.rdoc +0 -102
- data/ext/ffi_c/DataConverter.c +0 -91
- data/ext/ffi_c/Ffi_c.iml +0 -12
- data/ext/ffi_c/StructByReference.c +0 -158
- data/ext/ffi_c/StructByReference.h +0 -50
- data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
- data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
- data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
- data/ext/ffi_c/libffi/Makefile.vc +0 -141
- data/ext/ffi_c/libffi/Makefile.vc64 +0 -141
- data/ext/ffi_c/libffi/README +0 -342
- data/ext/ffi_c/libffi/aclocal.m4 +0 -1873
- data/ext/ffi_c/libffi/build-ios.sh +0 -67
- data/ext/ffi_c/libffi/compile +0 -143
- data/ext/ffi_c/libffi/depcomp +0 -630
- data/ext/ffi_c/libffi/doc/libffi.info +0 -593
- data/ext/ffi_c/libffi/doc/stamp-vti +0 -4
- data/ext/ffi_c/libffi/include/ffi.h.vc +0 -427
- data/ext/ffi_c/libffi/m4/ax_check_compiler_flags.m4 +0 -76
- data/ext/ffi_c/libffi/m4/libtool.m4 +0 -7831
- data/ext/ffi_c/libffi/m4/ltoptions.m4 +0 -369
- data/ext/ffi_c/libffi/m4/ltsugar.m4 +0 -123
- data/ext/ffi_c/libffi/m4/ltversion.m4 +0 -23
- data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +0 -98
- data/ext/ffi_c/libffi/mdate-sh +0 -201
- data/ext/ffi_c/libffi/src/arm/gentramp.sh +0 -118
- data/ext/ffi_c/libffi/src/arm/trampoline.S +0 -4450
- data/ext/ffi_c/libffi/src/x86/darwin.S +0 -444
- data/ext/ffi_c/libffi/src/x86/darwin64.S +0 -416
- data/ext/ffi_c/libffi/src/x86/freebsd.S +0 -458
- data/ext/ffi_c/libffi/src/x86/win32.S +0 -1065
- data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +0 -300
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +0 -63
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +0 -96
- data/ext/ffi_c/libffi/texinfo.tex +0 -7210
- data/ext/ffi_c/win32/stdint.h +0 -199
- data/gen/Rakefile +0 -30
- data/gen/log +0 -1
- data/lib/Lib.iml +0 -13
- data/spec/ffi/Ffi.iml +0 -12
- data/spec/ffi/async_callback_spec.rb +0 -46
- data/spec/ffi/bool_spec.rb +0 -40
- data/spec/ffi/buffer_spec.rb +0 -215
- data/spec/ffi/callback_spec.rb +0 -668
- data/spec/ffi/custom_param_type.rb +0 -47
- data/spec/ffi/custom_type_spec.rb +0 -85
- data/spec/ffi/dup_spec.rb +0 -65
- data/spec/ffi/enum_spec.rb +0 -227
- data/spec/ffi/errno_spec.rb +0 -29
- data/spec/ffi/ffi_spec.rb +0 -40
- data/spec/ffi/function_spec.rb +0 -87
- data/spec/ffi/library_spec.rb +0 -208
- data/spec/ffi/long_double.rb +0 -41
- data/spec/ffi/managed_struct_spec.rb +0 -72
- data/spec/ffi/number_spec.rb +0 -247
- data/spec/ffi/pointer_spec.rb +0 -214
- data/spec/ffi/rbx/attach_function_spec.rb +0 -28
- data/spec/ffi/rbx/memory_pointer_spec.rb +0 -115
- data/spec/ffi/rbx/spec_helper.rb +0 -1
- data/spec/ffi/rbx/struct_spec.rb +0 -13
- data/spec/ffi/spec_helper.rb +0 -35
- data/spec/ffi/string_spec.rb +0 -119
- data/spec/ffi/strptr_spec.rb +0 -61
- data/spec/ffi/struct_callback_spec.rb +0 -80
- data/spec/ffi/struct_initialize_spec.rb +0 -46
- data/spec/ffi/struct_packed_spec.rb +0 -62
- data/spec/ffi/struct_spec.rb +0 -719
- data/spec/ffi/typedef_spec.rb +0 -89
- data/spec/ffi/union_spec.rb +0 -76
- data/spec/ffi/variadic_spec.rb +0 -103
- data/spec/spec.opts +0 -4
- data/tasks/ann.rake +0 -80
- data/tasks/extension.rake +0 -32
- data/tasks/gem.rake +0 -199
- data/tasks/git.rake +0 -41
- data/tasks/notes.rake +0 -27
- data/tasks/post_load.rake +0 -34
- data/tasks/rdoc.rake +0 -50
- data/tasks/rubyforge.rake +0 -55
- data/tasks/setup.rb +0 -301
- data/tasks/spec.rake +0 -54
- data/tasks/svn.rake +0 -47
- data/tasks/test.rake +0 -40
- data/tasks/yard.rake +0 -11
@@ -1,6 +1,7 @@
|
|
1
1
|
/* -----------------------------------------------------------------------
|
2
|
-
unix64.S - Copyright (c)
|
3
|
-
|
2
|
+
unix64.S - Copyright (c) 2013 The Written Word, Inc.
|
3
|
+
- Copyright (c) 2008 Red Hat, Inc
|
4
|
+
- Copyright (c) 2002 Bo Thorsen <bo@suse.de>
|
4
5
|
|
5
6
|
x86-64 Foreign Function Interface
|
6
7
|
|
@@ -29,8 +30,24 @@
|
|
29
30
|
#define LIBFFI_ASM
|
30
31
|
#include <fficonfig.h>
|
31
32
|
#include <ffi.h>
|
33
|
+
#include "internal64.h"
|
34
|
+
#include "asmnames.h"
|
32
35
|
|
33
|
-
.text
|
36
|
+
.text
|
37
|
+
|
38
|
+
/* This macro allows the safe creation of jump tables without an
|
39
|
+
actual table. The entry points into the table are all 8 bytes.
|
40
|
+
The use of ORG asserts that we're at the correct location. */
|
41
|
+
/* ??? The clang assembler doesn't handle .org with symbolic expressions. */
|
42
|
+
#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__))
|
43
|
+
# define E(BASE, X) .balign 8
|
44
|
+
#else
|
45
|
+
# ifdef __CET__
|
46
|
+
# define E(BASE, X) .balign 8; .org BASE + X * 16
|
47
|
+
# else
|
48
|
+
# define E(BASE, X) .balign 8; .org BASE + X * 8
|
49
|
+
# endif
|
50
|
+
#endif
|
34
51
|
|
35
52
|
/* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
|
36
53
|
void *raddr, void (*fnaddr)(void));
|
@@ -39,12 +56,13 @@
|
|
39
56
|
for this function. This has been allocated by ffi_call. We also
|
40
57
|
deallocate some of the stack that has been alloca'd. */
|
41
58
|
|
42
|
-
.
|
43
|
-
.globl ffi_call_unix64
|
44
|
-
|
59
|
+
.balign 8
|
60
|
+
.globl C(ffi_call_unix64)
|
61
|
+
FFI_HIDDEN(C(ffi_call_unix64))
|
45
62
|
|
46
|
-
ffi_call_unix64:
|
47
|
-
|
63
|
+
C(ffi_call_unix64):
|
64
|
+
L(UW0):
|
65
|
+
_CET_ENDBR
|
48
66
|
movq (%rsp), %r10 /* Load return address. */
|
49
67
|
leaq (%rdi, %rsi), %rax /* Find local stack base. */
|
50
68
|
movq %rdx, (%rax) /* Save flags. */
|
@@ -52,24 +70,36 @@ ffi_call_unix64:
|
|
52
70
|
movq %rbp, 16(%rax) /* Save old frame pointer. */
|
53
71
|
movq %r10, 24(%rax) /* Relocate return address. */
|
54
72
|
movq %rax, %rbp /* Finalize local stack frame. */
|
55
|
-
|
73
|
+
|
74
|
+
/* New stack frame based off rbp. This is a itty bit of unwind
|
75
|
+
trickery in that the CFA *has* changed. There is no easy way
|
76
|
+
to describe it correctly on entry to the function. Fortunately,
|
77
|
+
it doesn't matter too much since at all points we can correctly
|
78
|
+
unwind back to ffi_call. Note that the location to which we
|
79
|
+
moved the return address is (the new) CFA-8, so from the
|
80
|
+
perspective of the unwind info, it hasn't moved. */
|
81
|
+
L(UW1):
|
82
|
+
/* cfi_def_cfa(%rbp, 32) */
|
83
|
+
/* cfi_rel_offset(%rbp, 16) */
|
84
|
+
|
56
85
|
movq %rdi, %r10 /* Save a copy of the register area. */
|
57
86
|
movq %r8, %r11 /* Save a copy of the target fn. */
|
58
|
-
movl %r9d, %eax /* Set number of SSE registers. */
|
59
87
|
|
60
88
|
/* Load up all argument registers. */
|
61
89
|
movq (%r10), %rdi
|
62
|
-
movq
|
63
|
-
movq
|
64
|
-
movq
|
65
|
-
movq
|
66
|
-
movq
|
90
|
+
movq 0x08(%r10), %rsi
|
91
|
+
movq 0x10(%r10), %rdx
|
92
|
+
movq 0x18(%r10), %rcx
|
93
|
+
movq 0x20(%r10), %r8
|
94
|
+
movq 0x28(%r10), %r9
|
95
|
+
movl 0xb0(%r10), %eax /* Set number of SSE registers. */
|
67
96
|
testl %eax, %eax
|
68
|
-
jnz
|
69
|
-
|
97
|
+
jnz L(load_sse)
|
98
|
+
L(ret_from_load_sse):
|
70
99
|
|
71
|
-
/* Deallocate the reg arg area. */
|
72
|
-
leaq
|
100
|
+
/* Deallocate the reg arg area, except for r10, then load via pop. */
|
101
|
+
leaq 0xb8(%r10), %rsp
|
102
|
+
popq %r10
|
73
103
|
|
74
104
|
/* Call the user function. */
|
75
105
|
call *%r11
|
@@ -80,347 +110,512 @@ ffi_call_unix64:
|
|
80
110
|
movq 0(%rbp), %rcx /* Reload flags. */
|
81
111
|
movq 8(%rbp), %rdi /* Reload raddr. */
|
82
112
|
movq 16(%rbp), %rbp /* Reload old frame pointer. */
|
83
|
-
|
113
|
+
L(UW2):
|
114
|
+
/* cfi_remember_state */
|
115
|
+
/* cfi_def_cfa(%rsp, 8) */
|
116
|
+
/* cfi_restore(%rbp) */
|
84
117
|
|
85
118
|
/* The first byte of the flags contains the FFI_TYPE. */
|
119
|
+
cmpb $UNIX64_RET_LAST, %cl
|
86
120
|
movzbl %cl, %r10d
|
87
|
-
leaq
|
88
|
-
|
89
|
-
|
121
|
+
leaq L(store_table)(%rip), %r11
|
122
|
+
ja L(sa)
|
123
|
+
#ifdef __CET__
|
124
|
+
/* NB: Originally, each slot is 8 byte. 4 bytes of ENDBR64 +
|
125
|
+
4 bytes NOP padding double slot size to 16 bytes. */
|
126
|
+
addl %r10d, %r10d
|
127
|
+
#endif
|
128
|
+
leaq (%r11, %r10, 8), %r10
|
129
|
+
|
130
|
+
/* Prep for the structure cases: scratch area in redzone. */
|
131
|
+
leaq -20(%rsp), %rsi
|
90
132
|
jmp *%r10
|
91
133
|
|
92
|
-
.
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
.long .Lst_double-.Lstore_table /* FFI_TYPE_DOUBLE */
|
97
|
-
.long .Lst_ldouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
|
98
|
-
.long .Lst_uint8-.Lstore_table /* FFI_TYPE_UINT8 */
|
99
|
-
.long .Lst_sint8-.Lstore_table /* FFI_TYPE_SINT8 */
|
100
|
-
.long .Lst_uint16-.Lstore_table /* FFI_TYPE_UINT16 */
|
101
|
-
.long .Lst_sint16-.Lstore_table /* FFI_TYPE_SINT16 */
|
102
|
-
.long .Lst_uint32-.Lstore_table /* FFI_TYPE_UINT32 */
|
103
|
-
.long .Lst_sint32-.Lstore_table /* FFI_TYPE_SINT32 */
|
104
|
-
.long .Lst_int64-.Lstore_table /* FFI_TYPE_UINT64 */
|
105
|
-
.long .Lst_int64-.Lstore_table /* FFI_TYPE_SINT64 */
|
106
|
-
.long .Lst_struct-.Lstore_table /* FFI_TYPE_STRUCT */
|
107
|
-
.long .Lst_int64-.Lstore_table /* FFI_TYPE_POINTER */
|
108
|
-
|
109
|
-
.align 2
|
110
|
-
.Lst_void:
|
134
|
+
.balign 8
|
135
|
+
L(store_table):
|
136
|
+
E(L(store_table), UNIX64_RET_VOID)
|
137
|
+
_CET_ENDBR
|
111
138
|
ret
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
movzbq %al, %rax
|
139
|
+
E(L(store_table), UNIX64_RET_UINT8)
|
140
|
+
_CET_ENDBR
|
141
|
+
movzbl %al, %eax
|
116
142
|
movq %rax, (%rdi)
|
117
143
|
ret
|
118
|
-
|
119
|
-
|
120
|
-
|
144
|
+
E(L(store_table), UNIX64_RET_UINT16)
|
145
|
+
_CET_ENDBR
|
146
|
+
movzwl %ax, %eax
|
121
147
|
movq %rax, (%rdi)
|
122
148
|
ret
|
123
|
-
|
124
|
-
|
125
|
-
|
149
|
+
E(L(store_table), UNIX64_RET_UINT32)
|
150
|
+
_CET_ENDBR
|
151
|
+
movl %eax, %eax
|
126
152
|
movq %rax, (%rdi)
|
127
|
-
|
128
|
-
|
129
|
-
|
153
|
+
ret
|
154
|
+
E(L(store_table), UNIX64_RET_SINT8)
|
155
|
+
_CET_ENDBR
|
156
|
+
movsbq %al, %rax
|
130
157
|
movq %rax, (%rdi)
|
131
158
|
ret
|
132
|
-
|
133
|
-
|
134
|
-
|
159
|
+
E(L(store_table), UNIX64_RET_SINT16)
|
160
|
+
_CET_ENDBR
|
161
|
+
movswq %ax, %rax
|
135
162
|
movq %rax, (%rdi)
|
136
|
-
|
137
|
-
|
163
|
+
ret
|
164
|
+
E(L(store_table), UNIX64_RET_SINT32)
|
165
|
+
_CET_ENDBR
|
138
166
|
cltq
|
139
167
|
movq %rax, (%rdi)
|
140
168
|
ret
|
141
|
-
|
142
|
-
|
169
|
+
E(L(store_table), UNIX64_RET_INT64)
|
170
|
+
_CET_ENDBR
|
143
171
|
movq %rax, (%rdi)
|
144
172
|
ret
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
movss %xmm0, (%rdi)
|
173
|
+
E(L(store_table), UNIX64_RET_XMM32)
|
174
|
+
_CET_ENDBR
|
175
|
+
movd %xmm0, (%rdi)
|
149
176
|
ret
|
150
|
-
|
151
|
-
|
152
|
-
|
177
|
+
E(L(store_table), UNIX64_RET_XMM64)
|
178
|
+
_CET_ENDBR
|
179
|
+
movq %xmm0, (%rdi)
|
153
180
|
ret
|
154
|
-
|
181
|
+
E(L(store_table), UNIX64_RET_X87)
|
182
|
+
_CET_ENDBR
|
155
183
|
fstpt (%rdi)
|
156
184
|
ret
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
cmovnz %r11, %rdx
|
177
|
-
movq %rax, (%rsi)
|
185
|
+
E(L(store_table), UNIX64_RET_X87_2)
|
186
|
+
_CET_ENDBR
|
187
|
+
fstpt (%rdi)
|
188
|
+
fstpt 16(%rdi)
|
189
|
+
ret
|
190
|
+
E(L(store_table), UNIX64_RET_ST_XMM0_RAX)
|
191
|
+
_CET_ENDBR
|
192
|
+
movq %rax, 8(%rsi)
|
193
|
+
jmp L(s3)
|
194
|
+
E(L(store_table), UNIX64_RET_ST_RAX_XMM0)
|
195
|
+
_CET_ENDBR
|
196
|
+
movq %xmm0, 8(%rsi)
|
197
|
+
jmp L(s2)
|
198
|
+
E(L(store_table), UNIX64_RET_ST_XMM0_XMM1)
|
199
|
+
_CET_ENDBR
|
200
|
+
movq %xmm1, 8(%rsi)
|
201
|
+
jmp L(s3)
|
202
|
+
E(L(store_table), UNIX64_RET_ST_RAX_RDX)
|
203
|
+
_CET_ENDBR
|
178
204
|
movq %rdx, 8(%rsi)
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
shrl $12, %ecx
|
205
|
+
L(s2):
|
206
|
+
movq %rax, (%rsi)
|
207
|
+
shrl $UNIX64_SIZE_SHIFT, %ecx
|
183
208
|
rep movsb
|
184
209
|
ret
|
210
|
+
.balign 8
|
211
|
+
L(s3):
|
212
|
+
movq %xmm0, (%rsi)
|
213
|
+
shrl $UNIX64_SIZE_SHIFT, %ecx
|
214
|
+
rep movsb
|
215
|
+
ret
|
216
|
+
|
217
|
+
L(sa): call PLT(C(abort))
|
185
218
|
|
186
219
|
/* Many times we can avoid loading any SSE registers at all.
|
187
220
|
It's not worth an indirect jump to load the exact set of
|
188
221
|
SSE registers needed; zero or all is a good compromise. */
|
189
|
-
.
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
movdqa
|
194
|
-
movdqa
|
195
|
-
movdqa
|
196
|
-
movdqa
|
197
|
-
movdqa
|
198
|
-
movdqa
|
199
|
-
movdqa
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
222
|
+
.balign 2
|
223
|
+
L(UW3):
|
224
|
+
/* cfi_restore_state */
|
225
|
+
L(load_sse):
|
226
|
+
movdqa 0x30(%r10), %xmm0
|
227
|
+
movdqa 0x40(%r10), %xmm1
|
228
|
+
movdqa 0x50(%r10), %xmm2
|
229
|
+
movdqa 0x60(%r10), %xmm3
|
230
|
+
movdqa 0x70(%r10), %xmm4
|
231
|
+
movdqa 0x80(%r10), %xmm5
|
232
|
+
movdqa 0x90(%r10), %xmm6
|
233
|
+
movdqa 0xa0(%r10), %xmm7
|
234
|
+
jmp L(ret_from_load_sse)
|
235
|
+
|
236
|
+
L(UW4):
|
237
|
+
ENDF(C(ffi_call_unix64))
|
238
|
+
|
239
|
+
/* 6 general registers, 8 vector registers,
|
240
|
+
32 bytes of rvalue, 8 bytes of alignment. */
|
241
|
+
#define ffi_closure_OFS_G 0
|
242
|
+
#define ffi_closure_OFS_V (6*8)
|
243
|
+
#define ffi_closure_OFS_RVALUE (ffi_closure_OFS_V + 8*16)
|
244
|
+
#define ffi_closure_FS (ffi_closure_OFS_RVALUE + 32 + 8)
|
245
|
+
|
246
|
+
/* The location of rvalue within the red zone after deallocating the frame. */
|
247
|
+
#define ffi_closure_RED_RVALUE (ffi_closure_OFS_RVALUE - ffi_closure_FS)
|
248
|
+
|
249
|
+
.balign 2
|
250
|
+
.globl C(ffi_closure_unix64_sse)
|
251
|
+
FFI_HIDDEN(C(ffi_closure_unix64_sse))
|
252
|
+
|
253
|
+
C(ffi_closure_unix64_sse):
|
254
|
+
L(UW5):
|
255
|
+
_CET_ENDBR
|
256
|
+
subq $ffi_closure_FS, %rsp
|
257
|
+
L(UW6):
|
258
|
+
/* cfi_adjust_cfa_offset(ffi_closure_FS) */
|
259
|
+
|
260
|
+
movdqa %xmm0, ffi_closure_OFS_V+0x00(%rsp)
|
261
|
+
movdqa %xmm1, ffi_closure_OFS_V+0x10(%rsp)
|
262
|
+
movdqa %xmm2, ffi_closure_OFS_V+0x20(%rsp)
|
263
|
+
movdqa %xmm3, ffi_closure_OFS_V+0x30(%rsp)
|
264
|
+
movdqa %xmm4, ffi_closure_OFS_V+0x40(%rsp)
|
265
|
+
movdqa %xmm5, ffi_closure_OFS_V+0x50(%rsp)
|
266
|
+
movdqa %xmm6, ffi_closure_OFS_V+0x60(%rsp)
|
267
|
+
movdqa %xmm7, ffi_closure_OFS_V+0x70(%rsp)
|
268
|
+
jmp L(sse_entry1)
|
269
|
+
|
270
|
+
L(UW7):
|
271
|
+
ENDF(C(ffi_closure_unix64_sse))
|
272
|
+
|
273
|
+
.balign 2
|
274
|
+
.globl C(ffi_closure_unix64)
|
275
|
+
FFI_HIDDEN(C(ffi_closure_unix64))
|
276
|
+
|
277
|
+
C(ffi_closure_unix64):
|
278
|
+
L(UW8):
|
279
|
+
_CET_ENDBR
|
280
|
+
subq $ffi_closure_FS, %rsp
|
281
|
+
L(UW9):
|
282
|
+
/* cfi_adjust_cfa_offset(ffi_closure_FS) */
|
283
|
+
L(sse_entry1):
|
284
|
+
movq %rdi, ffi_closure_OFS_G+0x00(%rsp)
|
285
|
+
movq %rsi, ffi_closure_OFS_G+0x08(%rsp)
|
286
|
+
movq %rdx, ffi_closure_OFS_G+0x10(%rsp)
|
287
|
+
movq %rcx, ffi_closure_OFS_G+0x18(%rsp)
|
288
|
+
movq %r8, ffi_closure_OFS_G+0x20(%rsp)
|
289
|
+
movq %r9, ffi_closure_OFS_G+0x28(%rsp)
|
290
|
+
|
291
|
+
#ifdef __ILP32__
|
292
|
+
movl FFI_TRAMPOLINE_SIZE(%r10), %edi /* Load cif */
|
293
|
+
movl FFI_TRAMPOLINE_SIZE+4(%r10), %esi /* Load fun */
|
294
|
+
movl FFI_TRAMPOLINE_SIZE+8(%r10), %edx /* Load user_data */
|
295
|
+
#else
|
296
|
+
movq FFI_TRAMPOLINE_SIZE(%r10), %rdi /* Load cif */
|
297
|
+
movq FFI_TRAMPOLINE_SIZE+8(%r10), %rsi /* Load fun */
|
298
|
+
movq FFI_TRAMPOLINE_SIZE+16(%r10), %rdx /* Load user_data */
|
299
|
+
#endif
|
300
|
+
L(do_closure):
|
301
|
+
leaq ffi_closure_OFS_RVALUE(%rsp), %rcx /* Load rvalue */
|
302
|
+
movq %rsp, %r8 /* Load reg_args */
|
303
|
+
leaq ffi_closure_FS+8(%rsp), %r9 /* Load argp */
|
304
|
+
call PLT(C(ffi_closure_unix64_inner))
|
229
305
|
|
230
306
|
/* Deallocate stack frame early; return value is now in redzone. */
|
231
|
-
addq $
|
232
|
-
|
307
|
+
addq $ffi_closure_FS, %rsp
|
308
|
+
L(UW10):
|
309
|
+
/* cfi_adjust_cfa_offset(-ffi_closure_FS) */
|
233
310
|
|
234
311
|
/* The first byte of the return value contains the FFI_TYPE. */
|
312
|
+
cmpb $UNIX64_RET_LAST, %al
|
235
313
|
movzbl %al, %r10d
|
236
|
-
leaq
|
237
|
-
|
238
|
-
|
314
|
+
leaq L(load_table)(%rip), %r11
|
315
|
+
ja L(la)
|
316
|
+
#ifdef __CET__
|
317
|
+
/* NB: Originally, each slot is 8 byte. 4 bytes of ENDBR64 +
|
318
|
+
4 bytes NOP padding double slot size to 16 bytes. */
|
319
|
+
addl %r10d, %r10d
|
320
|
+
#endif
|
321
|
+
leaq (%r11, %r10, 8), %r10
|
322
|
+
leaq ffi_closure_RED_RVALUE(%rsp), %rsi
|
239
323
|
jmp *%r10
|
240
324
|
|
241
|
-
.
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
.long .Lld_double-.Lload_table /* FFI_TYPE_DOUBLE */
|
246
|
-
.long .Lld_ldouble-.Lload_table /* FFI_TYPE_LONGDOUBLE */
|
247
|
-
.long .Lld_int8-.Lload_table /* FFI_TYPE_UINT8 */
|
248
|
-
.long .Lld_int8-.Lload_table /* FFI_TYPE_SINT8 */
|
249
|
-
.long .Lld_int16-.Lload_table /* FFI_TYPE_UINT16 */
|
250
|
-
.long .Lld_int16-.Lload_table /* FFI_TYPE_SINT16 */
|
251
|
-
.long .Lld_int32-.Lload_table /* FFI_TYPE_UINT32 */
|
252
|
-
.long .Lld_int32-.Lload_table /* FFI_TYPE_SINT32 */
|
253
|
-
.long .Lld_int64-.Lload_table /* FFI_TYPE_UINT64 */
|
254
|
-
.long .Lld_int64-.Lload_table /* FFI_TYPE_SINT64 */
|
255
|
-
.long .Lld_struct-.Lload_table /* FFI_TYPE_STRUCT */
|
256
|
-
.long .Lld_int64-.Lload_table /* FFI_TYPE_POINTER */
|
257
|
-
|
258
|
-
.align 2
|
259
|
-
.Lld_void:
|
325
|
+
.balign 8
|
326
|
+
L(load_table):
|
327
|
+
E(L(load_table), UNIX64_RET_VOID)
|
328
|
+
_CET_ENDBR
|
260
329
|
ret
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
movzbl -24(%rsp), %eax
|
330
|
+
E(L(load_table), UNIX64_RET_UINT8)
|
331
|
+
_CET_ENDBR
|
332
|
+
movzbl (%rsi), %eax
|
265
333
|
ret
|
266
|
-
|
267
|
-
|
268
|
-
movzwl
|
334
|
+
E(L(load_table), UNIX64_RET_UINT16)
|
335
|
+
_CET_ENDBR
|
336
|
+
movzwl (%rsi), %eax
|
269
337
|
ret
|
270
|
-
|
271
|
-
|
272
|
-
movl
|
338
|
+
E(L(load_table), UNIX64_RET_UINT32)
|
339
|
+
_CET_ENDBR
|
340
|
+
movl (%rsi), %eax
|
273
341
|
ret
|
274
|
-
|
275
|
-
|
276
|
-
|
342
|
+
E(L(load_table), UNIX64_RET_SINT8)
|
343
|
+
_CET_ENDBR
|
344
|
+
movsbl (%rsi), %eax
|
277
345
|
ret
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
movss -24(%rsp), %xmm0
|
346
|
+
E(L(load_table), UNIX64_RET_SINT16)
|
347
|
+
_CET_ENDBR
|
348
|
+
movswl (%rsi), %eax
|
282
349
|
ret
|
283
|
-
|
284
|
-
|
285
|
-
|
350
|
+
E(L(load_table), UNIX64_RET_SINT32)
|
351
|
+
_CET_ENDBR
|
352
|
+
movl (%rsi), %eax
|
286
353
|
ret
|
287
|
-
|
288
|
-
|
289
|
-
|
354
|
+
E(L(load_table), UNIX64_RET_INT64)
|
355
|
+
_CET_ENDBR
|
356
|
+
movq (%rsi), %rax
|
290
357
|
ret
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
358
|
+
E(L(load_table), UNIX64_RET_XMM32)
|
359
|
+
_CET_ENDBR
|
360
|
+
movd (%rsi), %xmm0
|
361
|
+
ret
|
362
|
+
E(L(load_table), UNIX64_RET_XMM64)
|
363
|
+
_CET_ENDBR
|
364
|
+
movq (%rsi), %xmm0
|
365
|
+
ret
|
366
|
+
E(L(load_table), UNIX64_RET_X87)
|
367
|
+
_CET_ENDBR
|
368
|
+
fldt (%rsi)
|
369
|
+
ret
|
370
|
+
E(L(load_table), UNIX64_RET_X87_2)
|
371
|
+
_CET_ENDBR
|
372
|
+
fldt 16(%rsi)
|
373
|
+
fldt (%rsi)
|
374
|
+
ret
|
375
|
+
E(L(load_table), UNIX64_RET_ST_XMM0_RAX)
|
376
|
+
_CET_ENDBR
|
377
|
+
movq 8(%rsi), %rax
|
378
|
+
jmp L(l3)
|
379
|
+
E(L(load_table), UNIX64_RET_ST_RAX_XMM0)
|
380
|
+
_CET_ENDBR
|
381
|
+
movq 8(%rsi), %xmm0
|
382
|
+
jmp L(l2)
|
383
|
+
E(L(load_table), UNIX64_RET_ST_XMM0_XMM1)
|
384
|
+
_CET_ENDBR
|
385
|
+
movq 8(%rsi), %xmm1
|
386
|
+
jmp L(l3)
|
387
|
+
E(L(load_table), UNIX64_RET_ST_RAX_RDX)
|
388
|
+
_CET_ENDBR
|
389
|
+
movq 8(%rsi), %rdx
|
390
|
+
L(l2):
|
391
|
+
movq (%rsi), %rax
|
392
|
+
ret
|
393
|
+
.balign 8
|
394
|
+
L(l3):
|
395
|
+
movq (%rsi), %xmm0
|
308
396
|
ret
|
309
397
|
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
.
|
340
|
-
.
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
398
|
+
L(la): call PLT(C(abort))
|
399
|
+
|
400
|
+
L(UW11):
|
401
|
+
ENDF(C(ffi_closure_unix64))
|
402
|
+
|
403
|
+
.balign 2
|
404
|
+
.globl C(ffi_go_closure_unix64_sse)
|
405
|
+
FFI_HIDDEN(C(ffi_go_closure_unix64_sse))
|
406
|
+
|
407
|
+
C(ffi_go_closure_unix64_sse):
|
408
|
+
L(UW12):
|
409
|
+
_CET_ENDBR
|
410
|
+
subq $ffi_closure_FS, %rsp
|
411
|
+
L(UW13):
|
412
|
+
/* cfi_adjust_cfa_offset(ffi_closure_FS) */
|
413
|
+
|
414
|
+
movdqa %xmm0, ffi_closure_OFS_V+0x00(%rsp)
|
415
|
+
movdqa %xmm1, ffi_closure_OFS_V+0x10(%rsp)
|
416
|
+
movdqa %xmm2, ffi_closure_OFS_V+0x20(%rsp)
|
417
|
+
movdqa %xmm3, ffi_closure_OFS_V+0x30(%rsp)
|
418
|
+
movdqa %xmm4, ffi_closure_OFS_V+0x40(%rsp)
|
419
|
+
movdqa %xmm5, ffi_closure_OFS_V+0x50(%rsp)
|
420
|
+
movdqa %xmm6, ffi_closure_OFS_V+0x60(%rsp)
|
421
|
+
movdqa %xmm7, ffi_closure_OFS_V+0x70(%rsp)
|
422
|
+
jmp L(sse_entry2)
|
423
|
+
|
424
|
+
L(UW14):
|
425
|
+
ENDF(C(ffi_go_closure_unix64_sse))
|
426
|
+
|
427
|
+
.balign 2
|
428
|
+
.globl C(ffi_go_closure_unix64)
|
429
|
+
FFI_HIDDEN(C(ffi_go_closure_unix64))
|
430
|
+
|
431
|
+
C(ffi_go_closure_unix64):
|
432
|
+
L(UW15):
|
433
|
+
_CET_ENDBR
|
434
|
+
subq $ffi_closure_FS, %rsp
|
435
|
+
L(UW16):
|
436
|
+
/* cfi_adjust_cfa_offset(ffi_closure_FS) */
|
437
|
+
L(sse_entry2):
|
438
|
+
movq %rdi, ffi_closure_OFS_G+0x00(%rsp)
|
439
|
+
movq %rsi, ffi_closure_OFS_G+0x08(%rsp)
|
440
|
+
movq %rdx, ffi_closure_OFS_G+0x10(%rsp)
|
441
|
+
movq %rcx, ffi_closure_OFS_G+0x18(%rsp)
|
442
|
+
movq %r8, ffi_closure_OFS_G+0x20(%rsp)
|
443
|
+
movq %r9, ffi_closure_OFS_G+0x28(%rsp)
|
444
|
+
|
445
|
+
#ifdef __ILP32__
|
446
|
+
movl 4(%r10), %edi /* Load cif */
|
447
|
+
movl 8(%r10), %esi /* Load fun */
|
448
|
+
movl %r10d, %edx /* Load closure (user_data) */
|
356
449
|
#else
|
357
|
-
|
450
|
+
movq 8(%r10), %rdi /* Load cif */
|
451
|
+
movq 16(%r10), %rsi /* Load fun */
|
452
|
+
movq %r10, %rdx /* Load closure (user_data) */
|
358
453
|
#endif
|
359
|
-
|
360
|
-
.uleb128 0x0 /* Augmentation size */
|
454
|
+
jmp L(do_closure)
|
361
455
|
|
362
|
-
|
363
|
-
|
456
|
+
L(UW17):
|
457
|
+
ENDF(C(ffi_go_closure_unix64))
|
364
458
|
|
365
|
-
|
366
|
-
trickery in that the CFA *has* changed. There is no easy way
|
367
|
-
to describe it correctly on entry to the function. Fortunately,
|
368
|
-
it doesn't matter too much since at all points we can correctly
|
369
|
-
unwind back to ffi_call. Note that the location to which we
|
370
|
-
moved the return address is (the new) CFA-8, so from the
|
371
|
-
perspective of the unwind info, it hasn't moved. */
|
372
|
-
.byte 0xc /* DW_CFA_def_cfa, %rbp offset 32 */
|
373
|
-
.uleb128 6
|
374
|
-
.uleb128 32
|
375
|
-
.byte 0x80+6 /* DW_CFA_offset, %rbp offset 2*-8 */
|
376
|
-
.uleb128 2
|
377
|
-
.byte 0xa /* DW_CFA_remember_state */
|
459
|
+
/* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */
|
378
460
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
461
|
+
#ifdef __APPLE__
|
462
|
+
.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
|
463
|
+
EHFrame0:
|
464
|
+
#elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE)
|
465
|
+
.section .eh_frame,"a",@unwind
|
466
|
+
#else
|
467
|
+
.section .eh_frame,"a",@progbits
|
468
|
+
#endif
|
385
469
|
|
386
|
-
|
387
|
-
.
|
388
|
-
|
470
|
+
#ifdef HAVE_AS_X86_PCREL
|
471
|
+
# define PCREL(X) X - .
|
472
|
+
#else
|
473
|
+
# define PCREL(X) X@rel
|
474
|
+
#endif
|
389
475
|
|
390
|
-
|
391
|
-
|
392
|
-
.
|
393
|
-
.
|
394
|
-
.LASFDE3:
|
395
|
-
.long .LASFDE3-.Lframe1 /* FDE CIE offset */
|
396
|
-
#if HAVE_AS_X86_PCREL
|
397
|
-
.long .LUW5-. /* FDE initial location */
|
476
|
+
/* Simplify advancing between labels. Assume DW_CFA_advance_loc1 fits. */
|
477
|
+
#ifdef __CET__
|
478
|
+
/* Use DW_CFA_advance_loc2 when IBT is enabled. */
|
479
|
+
# define ADV(N, P) .byte 3; .2byte L(N)-L(P)
|
398
480
|
#else
|
399
|
-
.
|
481
|
+
# define ADV(N, P) .byte 2, L(N)-L(P)
|
400
482
|
#endif
|
401
|
-
.long .LUW9-.LUW5 /* FDE address range */
|
402
|
-
.uleb128 0x0 /* Augmentation size */
|
403
483
|
|
404
|
-
.
|
405
|
-
|
406
|
-
.
|
407
|
-
.
|
484
|
+
.balign 8
|
485
|
+
L(CIE):
|
486
|
+
.set L(set0),L(ECIE)-L(SCIE)
|
487
|
+
.long L(set0) /* CIE Length */
|
488
|
+
L(SCIE):
|
489
|
+
.long 0 /* CIE Identifier Tag */
|
490
|
+
.byte 1 /* CIE Version */
|
491
|
+
.ascii "zR\0" /* CIE Augmentation */
|
492
|
+
.byte 1 /* CIE Code Alignment Factor */
|
493
|
+
.byte 0x78 /* CIE Data Alignment Factor */
|
494
|
+
.byte 0x10 /* CIE RA Column */
|
495
|
+
.byte 1 /* Augmentation size */
|
496
|
+
.byte 0x1b /* FDE Encoding (pcrel sdata4) */
|
497
|
+
.byte 0xc, 7, 8 /* DW_CFA_def_cfa, %rsp offset 8 */
|
498
|
+
.byte 0x80+16, 1 /* DW_CFA_offset, %rip offset 1*-8 */
|
499
|
+
.balign 8
|
500
|
+
L(ECIE):
|
501
|
+
|
502
|
+
.set L(set1),L(EFDE1)-L(SFDE1)
|
503
|
+
.long L(set1) /* FDE Length */
|
504
|
+
L(SFDE1):
|
505
|
+
.long L(SFDE1)-L(CIE) /* FDE CIE offset */
|
506
|
+
.long PCREL(L(UW0)) /* Initial location */
|
507
|
+
.long L(UW4)-L(UW0) /* Address range */
|
508
|
+
.byte 0 /* Augmentation size */
|
509
|
+
ADV(UW1, UW0)
|
510
|
+
.byte 0xc, 6, 32 /* DW_CFA_def_cfa, %rbp 32 */
|
511
|
+
.byte 0x80+6, 2 /* DW_CFA_offset, %rbp 2*-8 */
|
512
|
+
ADV(UW2, UW1)
|
408
513
|
.byte 0xa /* DW_CFA_remember_state */
|
409
|
-
|
410
|
-
.byte
|
411
|
-
|
412
|
-
.byte 0xe /* DW_CFA_def_cfa_offset */
|
413
|
-
.uleb128 8
|
414
|
-
|
415
|
-
.byte 0x4 /* DW_CFA_advance_loc4 */
|
416
|
-
.long .LUW8-.LUW7
|
514
|
+
.byte 0xc, 7, 8 /* DW_CFA_def_cfa, %rsp 8 */
|
515
|
+
.byte 0xc0+6 /* DW_CFA_restore, %rbp */
|
516
|
+
ADV(UW3, UW2)
|
417
517
|
.byte 0xb /* DW_CFA_restore_state */
|
418
|
-
|
419
|
-
|
420
|
-
|
518
|
+
.balign 8
|
519
|
+
L(EFDE1):
|
520
|
+
|
521
|
+
.set L(set2),L(EFDE2)-L(SFDE2)
|
522
|
+
.long L(set2) /* FDE Length */
|
523
|
+
L(SFDE2):
|
524
|
+
.long L(SFDE2)-L(CIE) /* FDE CIE offset */
|
525
|
+
.long PCREL(L(UW5)) /* Initial location */
|
526
|
+
.long L(UW7)-L(UW5) /* Address range */
|
527
|
+
.byte 0 /* Augmentation size */
|
528
|
+
ADV(UW6, UW5)
|
529
|
+
.byte 0xe /* DW_CFA_def_cfa_offset */
|
530
|
+
.byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */
|
531
|
+
.balign 8
|
532
|
+
L(EFDE2):
|
533
|
+
|
534
|
+
.set L(set3),L(EFDE3)-L(SFDE3)
|
535
|
+
.long L(set3) /* FDE Length */
|
536
|
+
L(SFDE3):
|
537
|
+
.long L(SFDE3)-L(CIE) /* FDE CIE offset */
|
538
|
+
.long PCREL(L(UW8)) /* Initial location */
|
539
|
+
.long L(UW11)-L(UW8) /* Address range */
|
540
|
+
.byte 0 /* Augmentation size */
|
541
|
+
ADV(UW9, UW8)
|
542
|
+
.byte 0xe /* DW_CFA_def_cfa_offset */
|
543
|
+
.byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */
|
544
|
+
ADV(UW10, UW9)
|
545
|
+
.byte 0xe, 8 /* DW_CFA_def_cfa_offset 8 */
|
546
|
+
L(EFDE3):
|
547
|
+
|
548
|
+
.set L(set4),L(EFDE4)-L(SFDE4)
|
549
|
+
.long L(set4) /* FDE Length */
|
550
|
+
L(SFDE4):
|
551
|
+
.long L(SFDE4)-L(CIE) /* FDE CIE offset */
|
552
|
+
.long PCREL(L(UW12)) /* Initial location */
|
553
|
+
.long L(UW14)-L(UW12) /* Address range */
|
554
|
+
.byte 0 /* Augmentation size */
|
555
|
+
ADV(UW13, UW12)
|
556
|
+
.byte 0xe /* DW_CFA_def_cfa_offset */
|
557
|
+
.byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */
|
558
|
+
.balign 8
|
559
|
+
L(EFDE4):
|
560
|
+
|
561
|
+
.set L(set5),L(EFDE5)-L(SFDE5)
|
562
|
+
.long L(set5) /* FDE Length */
|
563
|
+
L(SFDE5):
|
564
|
+
.long L(SFDE5)-L(CIE) /* FDE CIE offset */
|
565
|
+
.long PCREL(L(UW15)) /* Initial location */
|
566
|
+
.long L(UW17)-L(UW15) /* Address range */
|
567
|
+
.byte 0 /* Augmentation size */
|
568
|
+
ADV(UW16, UW15)
|
569
|
+
.byte 0xe /* DW_CFA_def_cfa_offset */
|
570
|
+
.byte ffi_closure_FS + 8, 1 /* uleb128, assuming 128 <= FS < 255 */
|
571
|
+
.balign 8
|
572
|
+
L(EFDE5):
|
573
|
+
#ifdef __APPLE__
|
574
|
+
.subsections_via_symbols
|
575
|
+
.section __LD,__compact_unwind,regular,debug
|
576
|
+
|
577
|
+
/* compact unwind for ffi_call_unix64 */
|
578
|
+
.quad C(ffi_call_unix64)
|
579
|
+
.set L1,L(UW4)-L(UW0)
|
580
|
+
.long L1
|
581
|
+
.long 0x04000000 /* use dwarf unwind info */
|
582
|
+
.quad 0
|
583
|
+
.quad 0
|
584
|
+
|
585
|
+
/* compact unwind for ffi_closure_unix64_sse */
|
586
|
+
.quad C(ffi_closure_unix64_sse)
|
587
|
+
.set L2,L(UW7)-L(UW5)
|
588
|
+
.long L2
|
589
|
+
.long 0x04000000 /* use dwarf unwind info */
|
590
|
+
.quad 0
|
591
|
+
.quad 0
|
592
|
+
|
593
|
+
/* compact unwind for ffi_closure_unix64 */
|
594
|
+
.quad C(ffi_closure_unix64)
|
595
|
+
.set L3,L(UW11)-L(UW8)
|
596
|
+
.long L3
|
597
|
+
.long 0x04000000 /* use dwarf unwind info */
|
598
|
+
.quad 0
|
599
|
+
.quad 0
|
600
|
+
|
601
|
+
/* compact unwind for ffi_go_closure_unix64_sse */
|
602
|
+
.quad C(ffi_go_closure_unix64_sse)
|
603
|
+
.set L4,L(UW14)-L(UW12)
|
604
|
+
.long L4
|
605
|
+
.long 0x04000000 /* use dwarf unwind info */
|
606
|
+
.quad 0
|
607
|
+
.quad 0
|
608
|
+
|
609
|
+
/* compact unwind for ffi_go_closure_unix64 */
|
610
|
+
.quad C(ffi_go_closure_unix64)
|
611
|
+
.set L5,L(UW17)-L(UW15)
|
612
|
+
.long L5
|
613
|
+
.long 0x04000000 /* use dwarf unwind info */
|
614
|
+
.quad 0
|
615
|
+
.quad 0
|
616
|
+
#endif
|
421
617
|
|
422
618
|
#endif /* __x86_64__ */
|
423
|
-
|
424
619
|
#if defined __ELF__ && defined __linux__
|
425
620
|
.section .note.GNU-stack,"",@progbits
|
426
621
|
#endif
|