rbdc 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bindings/ruby/rbdc/extconf.rb +57 -0
- data/bindings/ruby/rbdc/rbdc.c +304 -0
- data/dyncall/AUTHORS +4 -0
- data/dyncall/BUGS +3 -0
- data/dyncall/CMakeLists.txt +79 -0
- data/dyncall/ChangeLog +165 -0
- data/dyncall/LICENSE +15 -0
- data/dyncall/Makefile.M +15 -0
- data/dyncall/Makefile.embedded +71 -0
- data/dyncall/Makefile.generic +36 -0
- data/dyncall/Nmakefile +45 -0
- data/dyncall/README +92 -0
- data/dyncall/ToDo +114 -0
- data/dyncall/autovar/LICENSE.txt +15 -0
- data/dyncall/autovar/README.txt +69 -0
- data/dyncall/autovar/autovar_ABI.h +44 -0
- data/dyncall/autovar/autovar_ARCH.h +56 -0
- data/dyncall/autovar/autovar_CC.h +46 -0
- data/dyncall/autovar/autovar_OS.h +78 -0
- data/dyncall/autovar/autovar_OSFAMILY.h +39 -0
- data/dyncall/buildsys/cmake/Modules/FindDynCall.cmake +43 -0
- data/dyncall/buildsys/cmake/Modules/FindDynCallback.cmake +43 -0
- data/dyncall/buildsys/cmake/Modules/FindDynLoad.cmake +45 -0
- data/dyncall/buildsys/cmake/Modules/UseLATEX.cmake +811 -0
- data/dyncall/buildsys/dynmake/Makefile.base.M +82 -0
- data/dyncall/buildsys/dynmake/dynmake.bat +2 -0
- data/dyncall/buildsys/dynmake/dynmake.sh +4 -0
- data/dyncall/buildsys/lua/Makefile +10 -0
- data/dyncall/buildsys/lua/README.txt +4 -0
- data/dyncall/buildsys/lua/bootstrap.sh +34 -0
- data/dyncall/buildsys/lua/cleanup.sh +6 -0
- data/dyncall/buildsys/lua/mkfile +34 -0
- data/dyncall/buildsys/lua/setenv.sh +4 -0
- data/dyncall/buildsys/mk/app.mk +30 -0
- data/dyncall/buildsys/mk/dirs.mk +27 -0
- data/dyncall/buildsys/mk/epilog.mk +30 -0
- data/dyncall/buildsys/mk/lib.mk +23 -0
- data/dyncall/buildsys/mk/pcc.mk +60 -0
- data/dyncall/buildsys/mk/prolog.mk +35 -0
- data/dyncall/buildsys/nmake/common.nmake +61 -0
- data/dyncall/buildsys/nmake/epilog.nmake +28 -0
- data/dyncall/buildsys/nmake/prolog.nmake +76 -0
- data/dyncall/buildsys/nmake/tool_gcc.nmake +82 -0
- data/dyncall/buildsys/nmake/tool_msvc.nmake +67 -0
- data/dyncall/buildsys/scripts/batch-build-linux.sh +11 -0
- data/dyncall/buildsys/scripts/batch-build-minix.sh +11 -0
- data/dyncall/buildsys/scripts/batch-build-psp.sh +11 -0
- data/dyncall/buildsys/scripts/conf-nds.bat +41 -0
- data/dyncall/buildsys/scripts/setenv-cross-ios.sh +8 -0
- data/dyncall/buildsys/scripts/setenv-sdk-ios.sh +22 -0
- data/dyncall/buildsys/vs2005/dyncall/dyncall.vcproj +245 -0
- data/dyncall/buildsys/vs2005/test_plain/test_plain.vcproj +202 -0
- data/dyncall/buildsys/vs2005/vs2005.sln +29 -0
- data/dyncall/configure +152 -0
- data/dyncall/configure.bat +157 -0
- data/dyncall/configure.rc +234 -0
- data/dyncall/dynMakefile +4 -0
- data/dyncall/dyncall/CMakeLists.txt +53 -0
- data/dyncall/dyncall/DynCallConfig.cmake +3 -0
- data/dyncall/dyncall/Makefile.M +10 -0
- data/dyncall/dyncall/Makefile.embedded +20 -0
- data/dyncall/dyncall/Makefile.generic +16 -0
- data/dyncall/dyncall/Nmakefile +62 -0
- data/dyncall/dyncall/README-Developer.txt +45 -0
- data/dyncall/dyncall/README.txt +65 -0
- data/dyncall/dyncall/TODO +9 -0
- data/dyncall/dyncall/dynMakefile +4 -0
- data/dyncall/dyncall/dyncall.3 +189 -0
- data/dyncall/dyncall/dyncall.h +135 -0
- data/dyncall/dyncall/dyncall_alloc.h +40 -0
- data/dyncall/dyncall/dyncall_api.c +167 -0
- data/dyncall/dyncall/dyncall_call.S +72 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm.S +80 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm.h +61 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +96 -0
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +44 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb.h +65 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb_apple.s +80 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +121 -0
- data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +101 -0
- data/dyncall/dyncall/dyncall_call_mips.h +50 -0
- data/dyncall/dyncall/dyncall_call_mips_eabi.h +61 -0
- data/dyncall/dyncall/dyncall_call_mips_eabi_gas.s +115 -0
- data/dyncall/dyncall/dyncall_call_mips_gas.S +36 -0
- data/dyncall/dyncall/dyncall_call_mips_n32.h +67 -0
- data/dyncall/dyncall/dyncall_call_mips_n32_gas.s +192 -0
- data/dyncall/dyncall/dyncall_call_mips_n64.h +67 -0
- data/dyncall/dyncall/dyncall_call_mips_n64_gas.s +192 -0
- data/dyncall/dyncall/dyncall_call_mips_o32.h +70 -0
- data/dyncall/dyncall/dyncall_call_mips_o32_gas.s +109 -0
- data/dyncall/dyncall/dyncall_call_ppc32.S +266 -0
- data/dyncall/dyncall/dyncall_call_ppc32.h +62 -0
- data/dyncall/dyncall/dyncall_call_sparc.S +192 -0
- data/dyncall/dyncall/dyncall_call_sparc.h +42 -0
- data/dyncall/dyncall/dyncall_call_sparc64.S +361 -0
- data/dyncall/dyncall/dyncall_call_sparc64.h +42 -0
- data/dyncall/dyncall/dyncall_call_sparc_v9.S +220 -0
- data/dyncall/dyncall/dyncall_call_sparc_v9.h +42 -0
- data/dyncall/dyncall/dyncall_call_x64-att.S +146 -0
- data/dyncall/dyncall/dyncall_call_x64.S +149 -0
- data/dyncall/dyncall/dyncall_call_x64.h +63 -0
- data/dyncall/dyncall/dyncall_call_x64_generic_masm.asm +70 -0
- data/dyncall/dyncall/dyncall_call_x86.S +238 -0
- data/dyncall/dyncall/dyncall_call_x86.h +70 -0
- data/dyncall/dyncall/dyncall_call_x86_8a.s +127 -0
- data/dyncall/dyncall/dyncall_call_x86_generic_masm.asm +136 -0
- data/dyncall/dyncall/dyncall_call_x86_nasm.asm +234 -0
- data/dyncall/dyncall/dyncall_callf.c +112 -0
- data/dyncall/dyncall/dyncall_callf.h +52 -0
- data/dyncall/dyncall/dyncall_callvm.c +68 -0
- data/dyncall/dyncall/dyncall_callvm.h +88 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +250 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +59 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +204 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +63 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +271 -0
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +59 -0
- data/dyncall/dyncall/dyncall_callvm_base.c +33 -0
- data/dyncall/dyncall/dyncall_callvm_mips.c +40 -0
- data/dyncall/dyncall/dyncall_callvm_mips.h +37 -0
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +181 -0
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +61 -0
- data/dyncall/dyncall/dyncall_callvm_mips_n32.c +268 -0
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +268 -0
- data/dyncall/dyncall/dyncall_callvm_mips_n64.h +53 -0
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +235 -0
- data/dyncall/dyncall/dyncall_callvm_mips_o32.h +45 -0
- data/dyncall/dyncall/dyncall_callvm_ppc32.c +372 -0
- data/dyncall/dyncall/dyncall_callvm_ppc32.h +61 -0
- data/dyncall/dyncall/dyncall_callvm_sparc.c +155 -0
- data/dyncall/dyncall/dyncall_callvm_sparc.h +44 -0
- data/dyncall/dyncall/dyncall_callvm_sparc64.c +239 -0
- data/dyncall/dyncall/dyncall_callvm_sparc64.h +47 -0
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +182 -0
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +45 -0
- data/dyncall/dyncall/dyncall_callvm_x64.c +228 -0
- data/dyncall/dyncall/dyncall_callvm_x64.h +111 -0
- data/dyncall/dyncall/dyncall_callvm_x86.c +667 -0
- data/dyncall/dyncall/dyncall_callvm_x86.h +75 -0
- data/dyncall/dyncall/dyncall_config.h +46 -0
- data/dyncall/dyncall/dyncall_macros.h +248 -0
- data/dyncall/dyncall/dyncall_signature.h +71 -0
- data/dyncall/dyncall/dyncall_struct.c +255 -0
- data/dyncall/dyncall/dyncall_struct.h +69 -0
- data/dyncall/dyncall/dyncall_types.h +74 -0
- data/dyncall/dyncall/dyncall_utils.h +38 -0
- data/dyncall/dyncall/dyncall_value.h +73 -0
- data/dyncall/dyncall/dyncall_vector.c +52 -0
- data/dyncall/dyncall/dyncall_vector.h +56 -0
- data/dyncall/dyncall/gen-masm.sh +7 -0
- data/dyncall/dyncall/mkfile +29 -0
- data/dyncall/dyncallback/CMakeLists.txt +55 -0
- data/dyncall/dyncallback/DynCallbackConfig.cmake +2 -0
- data/dyncall/dyncallback/Makefile.M +10 -0
- data/dyncall/dyncallback/Makefile.embedded +15 -0
- data/dyncall/dyncallback/Makefile.generic +20 -0
- data/dyncall/dyncallback/Nmakefile +71 -0
- data/dyncall/dyncallback/README.txt +9 -0
- data/dyncall/dyncallback/TODO +4 -0
- data/dyncall/dyncallback/dynMakefile +4 -0
- data/dyncall/dyncallback/dyncall_alloc_wx.c +35 -0
- data/dyncall/dyncallback/dyncall_alloc_wx.h +46 -0
- data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +40 -0
- data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +42 -0
- data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +42 -0
- data/dyncall/dyncallback/dyncall_args.c +45 -0
- data/dyncall/dyncallback/dyncall_args.h +65 -0
- data/dyncall/dyncallback/dyncall_args_arm32_arm.c +112 -0
- data/dyncall/dyncallback/dyncall_args_arm32_arm.h +40 -0
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +29 -0
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.h +32 -0
- data/dyncall/dyncallback/dyncall_args_mips.c +81 -0
- data/dyncall/dyncallback/dyncall_args_mips.h +41 -0
- data/dyncall/dyncallback/dyncall_args_ppc32.c +88 -0
- data/dyncall/dyncallback/dyncall_args_ppc32.h +41 -0
- data/dyncall/dyncallback/dyncall_args_sparc32.c +41 -0
- data/dyncall/dyncallback/dyncall_args_sparc32.h +37 -0
- data/dyncall/dyncallback/dyncall_args_sparc64.c +41 -0
- data/dyncall/dyncallback/dyncall_args_sparc64.h +37 -0
- data/dyncall/dyncallback/dyncall_args_x64.c +73 -0
- data/dyncall/dyncallback/dyncall_args_x64.h +44 -0
- data/dyncall/dyncallback/dyncall_args_x86.c +121 -0
- data/dyncall/dyncallback/dyncall_args_x86.h +58 -0
- data/dyncall/dyncallback/dyncall_callback.c +45 -0
- data/dyncall/dyncallback/dyncall_callback.h +51 -0
- data/dyncall/dyncallback/dyncall_callback_arch.S +71 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.c +63 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +45 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +73 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_gas.s +73 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.c +29 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.h +33 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_apple.s +32 -0
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_gas.s +32 -0
- data/dyncall/dyncallback/dyncall_callback_mips.c +61 -0
- data/dyncall/dyncallback/dyncall_callback_mips.h +42 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.S +33 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.c +60 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.h +43 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +180 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.c +57 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.h +43 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.s +30 -0
- data/dyncall/dyncallback/dyncall_callback_sparc64.c +57 -0
- data/dyncall/dyncallback/dyncall_callback_sparc64.s +30 -0
- data/dyncall/dyncallback/dyncall_callback_x64.S +187 -0
- data/dyncall/dyncallback/dyncall_callback_x64.c +69 -0
- data/dyncall/dyncallback/dyncall_callback_x64.h +44 -0
- data/dyncall/dyncallback/dyncall_callback_x64_apple.s +122 -0
- data/dyncall/dyncallback/dyncall_callback_x64_gas.s +119 -0
- data/dyncall/dyncallback/dyncall_callback_x64_gas_w64.s +102 -0
- data/dyncall/dyncallback/dyncall_callback_x64_masm.asm +89 -0
- data/dyncall/dyncallback/dyncall_callback_x86.S +115 -0
- data/dyncall/dyncallback/dyncall_callback_x86.c +281 -0
- data/dyncall/dyncallback/dyncall_callback_x86.h +49 -0
- data/dyncall/dyncallback/dyncall_callback_x86_8a.s +100 -0
- data/dyncall/dyncallback/dyncall_callback_x86_masm.asm +74 -0
- data/dyncall/dyncallback/dyncall_thunk.c +47 -0
- data/dyncall/dyncallback/dyncall_thunk.h +84 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.c +45 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.h +40 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +29 -0
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +35 -0
- data/dyncall/dyncallback/dyncall_thunk_mips.c +52 -0
- data/dyncall/dyncallback/dyncall_thunk_mips.h +37 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc32.c +51 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc32.h +40 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc32.c +32 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc32.h +36 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc64.c +32 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc64.h +36 -0
- data/dyncall/dyncallback/dyncall_thunk_x64.c +48 -0
- data/dyncall/dyncallback/dyncall_thunk_x64.h +39 -0
- data/dyncall/dyncallback/dyncall_thunk_x86.c +44 -0
- data/dyncall/dyncallback/dyncall_thunk_x86.h +39 -0
- data/dyncall/dyncallback/dyncallback.3 +134 -0
- data/dyncall/dyncallback/gen-masm.sh +8 -0
- data/dyncall/dyncallback/mkfile +29 -0
- data/dyncall/dynload/CMakeLists.txt +25 -0
- data/dyncall/dynload/DynLoadConfig.cmake +3 -0
- data/dyncall/dynload/Makefile.M +10 -0
- data/dyncall/dynload/Makefile.embedded +22 -0
- data/dyncall/dynload/Makefile.generic +18 -0
- data/dyncall/dynload/Nmakefile +57 -0
- data/dyncall/dynload/README.txt +113 -0
- data/dyncall/dynload/TODO +20 -0
- data/dyncall/dynload/dynMakefile +4 -0
- data/dyncall/dynload/dynload.3 +64 -0
- data/dyncall/dynload/dynload.c +38 -0
- data/dyncall/dynload/dynload.h +65 -0
- data/dyncall/dynload/dynload_alloc.h +40 -0
- data/dyncall/dynload/dynload_darwin.c +89 -0
- data/dyncall/dynload/dynload_syms.c +38 -0
- data/dyncall/dynload/dynload_syms_elf.c +214 -0
- data/dyncall/dynload/dynload_syms_mach-o.c +167 -0
- data/dyncall/dynload/dynload_syms_pe.c +109 -0
- data/dyncall/dynload/dynload_unix.c +57 -0
- data/dyncall/dynload/dynload_windows.c +59 -0
- data/dyncall/mkfile +36 -0
- data/dyncall/portasm/README.txt +42 -0
- data/dyncall/portasm/gen-masm.sh +3 -0
- data/dyncall/portasm/portasm-arm.S +36 -0
- data/dyncall/portasm/portasm-ppc.S +98 -0
- data/dyncall/portasm/portasm-x64-att.S +155 -0
- data/dyncall/portasm/portasm-x86.S +127 -0
- metadata +311 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
# Uses portasm to generates MASM sources for intel platforms.
|
4
|
+
printf "; auto-generated by `basename $0`\r\n" >dyncall_callback_x86_masm.asm
|
5
|
+
printf "; auto-generated by `basename $0`\r\n" >dyncall_callback_x64_masm.asm
|
6
|
+
gcc -E -P -DGEN_MASM dyncall_callback_x86.S | awk '{printf "%s\r\n", $0}' >> dyncall_callback_x86_masm.asm
|
7
|
+
gcc -E -P -DGEN_MASM dyncall_callback_x64.S | awk '{printf "%s\r\n", $0}' >> dyncall_callback_x64_masm.asm
|
8
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#//////////////////////////////////////////////////////////////////////////////
|
2
|
+
#
|
3
|
+
# Copyright (c) 2013 Daniel Adler <dadler@uni-goettingen.de>,
|
4
|
+
# Tassilo Philipp <tphilipp@potion-studios.com>
|
5
|
+
#
|
6
|
+
# Permission to use, copy, modify, and distribute this software for any
|
7
|
+
# purpose with or without fee is hereby granted, provided that the above
|
8
|
+
# copyright notice and this permission notice appear in all copies.
|
9
|
+
#
|
10
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
11
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
12
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
13
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
14
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
15
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
16
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
17
|
+
#
|
18
|
+
#//////////////////////////////////////////////////////////////////////////////
|
19
|
+
|
20
|
+
|
21
|
+
TOP = ..
|
22
|
+
<$TOP/buildsys/mk/prolog.mk
|
23
|
+
|
24
|
+
|
25
|
+
LIBRARY = dyncallback
|
26
|
+
UNITS = $UNITS dyncall_alloc_wx dyncall_args dyncall_callback dyncall_callback_arch dyncall_thunk
|
27
|
+
|
28
|
+
|
29
|
+
<$TOP/buildsys/mk/epilog.mk
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Package: dyncall
|
2
|
+
# File: dynload/CMakeLists.txt
|
3
|
+
# Description: DynLoad library cmake files
|
4
|
+
# License:
|
5
|
+
#
|
6
|
+
# Copyright (c) 2010 Daniel Adler <dadler@uni-goettingen.de>
|
7
|
+
#
|
8
|
+
# Permission to use, copy, modify, and distribute this software for any
|
9
|
+
# purpose with or without fee is hereby granted, provided that the above
|
10
|
+
# copyright notice and this permission notice appear in all copies.
|
11
|
+
#
|
12
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
13
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
14
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
15
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
16
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
17
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
18
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
19
|
+
#
|
20
|
+
|
21
|
+
add_library(dynload_s STATIC dynload.c dynload_syms.c)
|
22
|
+
install(TARGETS dynload_s ARCHIVE DESTINATION lib)
|
23
|
+
install(FILES dynload.h DESTINATION include)
|
24
|
+
|
25
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
MAKEFILE = Makefile.embedded
|
2
|
+
MAKE_CMD = ${MAKE} -f Makefile.embedded
|
3
|
+
TARGET = libdynload_s.a
|
4
|
+
OBJS = dynload.o dynload_syms.o
|
5
|
+
HEADERS = dynload.h
|
6
|
+
all: ${TARGET}
|
7
|
+
libdynload_s.a: ${OBJS}
|
8
|
+
${AR} ${ARFLAGS} $@ ${OBJS}
|
9
|
+
clean:
|
10
|
+
rm -f ${OBJS} ${TARGET}
|
11
|
+
install: all
|
12
|
+
mkdir -p ${DESTDIR}${PREFIX}/include
|
13
|
+
cp ${HEADERS} ${DESTDIR}${PREFIX}/include
|
14
|
+
mkdir -p ${DESTDIR}${PREFIX}/lib
|
15
|
+
cp ${TARGET} ${DESTDIR}${PREFIX}/lib
|
16
|
+
.PHONY: all clean install
|
17
|
+
osx-universal:
|
18
|
+
CFLAGS="${CFLAGS} -arch i386 -arch x86_64 -arch ppc" ASFLAGS="${ASFLAGS} -arch i386 -arch x86_64 -arch ppc" AR="libtool" ARFLAGS="-static -o" ${MAKE_CMD} all
|
19
|
+
sun-64bit:
|
20
|
+
CFLAGS="${CFLAGS} -m64" ASFLAGS="${ASFLAGS} -m64" ${MAKE_CMD} all
|
21
|
+
sun-gcc:
|
22
|
+
CC=gcc CFLAGS="${CFLAGS} -fPIC" ${MAKE_CMD} all
|
@@ -0,0 +1,18 @@
|
|
1
|
+
LIBNAME = dynload
|
2
|
+
OBJS = dynload.o dynload_syms.o
|
3
|
+
HEADERS = ${VPATH}/dynload.h
|
4
|
+
|
5
|
+
LIB = lib${LIBNAME}_s.a
|
6
|
+
|
7
|
+
.PHONY: all clean install
|
8
|
+
|
9
|
+
all: ${LIB}
|
10
|
+
${LIB}: ${OBJS}
|
11
|
+
${AR} ${ARFLAGS} ${LIB} ${OBJS}
|
12
|
+
clean:
|
13
|
+
rm -f ${OBJS} ${LIB}
|
14
|
+
install: all
|
15
|
+
mkdir -p ${PREFIX}/lib
|
16
|
+
mkdir -p ${PREFIX}/include
|
17
|
+
cp ${LIB} ${PREFIX}/lib
|
18
|
+
cp ${HEADERS} ${PREFIX}/include
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#//////////////////////////////////////////////////////////////////////////////
|
2
|
+
#
|
3
|
+
# Copyright (c) 2007,2009 Daniel Adler <dadler@uni-goettingen.de>,
|
4
|
+
# Tassilo Philipp <tphilipp@potion-studios.com>
|
5
|
+
#
|
6
|
+
# Permission to use, copy, modify, and distribute this software for any
|
7
|
+
# purpose with or without fee is hereby granted, provided that the above
|
8
|
+
# copyright notice and this permission notice appear in all copies.
|
9
|
+
#
|
10
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
11
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
12
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
13
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
14
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
15
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
16
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
17
|
+
#
|
18
|
+
#//////////////////////////////////////////////////////////////////////////////
|
19
|
+
|
20
|
+
#///////////////////////////////////////////////////
|
21
|
+
#
|
22
|
+
# nmake makefile
|
23
|
+
# Nmakefile
|
24
|
+
#
|
25
|
+
#///////////////////////////////////////////////////
|
26
|
+
|
27
|
+
|
28
|
+
TOP=..
|
29
|
+
|
30
|
+
!INCLUDE $(TOP)\buildsys\nmake\prolog.nmake
|
31
|
+
|
32
|
+
|
33
|
+
!IF "$(BUILD_OS)" == "windows"
|
34
|
+
|
35
|
+
TARGETS = libdynload_s.lib
|
36
|
+
OBJS = dynload.obj dynload_syms.obj
|
37
|
+
|
38
|
+
$(TARGETS): $(OBJS)
|
39
|
+
echo Creating library $@ ...
|
40
|
+
lib $(ARFLAGS) /OUT:"$@" $(OBJS) > nul
|
41
|
+
|
42
|
+
|
43
|
+
!ELSE IF "$(BUILD_OS)" == "nds"
|
44
|
+
|
45
|
+
TARGETS = libdynload_s.a
|
46
|
+
OBJS = dynload_unix.o
|
47
|
+
|
48
|
+
$(TARGETS):# $(OBJS)
|
49
|
+
echo Not building dynload: There is no dynload support on this platform.
|
50
|
+
# echo Creating library $@ ...
|
51
|
+
# $(AR) -rc $(ARFLAGS) "$@" $(OBJS)
|
52
|
+
|
53
|
+
!ENDIF
|
54
|
+
|
55
|
+
|
56
|
+
!INCLUDE $(TOP)\buildsys\nmake\epilog.nmake
|
57
|
+
|
@@ -0,0 +1,113 @@
|
|
1
|
+
dynload / abstraction to run-time shared library services:
|
2
|
+
|
3
|
+
- loading/unloading into the current process
|
4
|
+
- symbol lookup
|
5
|
+
- enumerating symbol tables
|
6
|
+
- elf: support for DT_GNU_HASH
|
7
|
+
|
8
|
+
|
9
|
+
Todo:
|
10
|
+
- a.out format
|
11
|
+
- support for different kind of symbols
|
12
|
+
(exports,imports,sections,constants...)
|
13
|
+
|
14
|
+
Notes on windows pe format:
|
15
|
+
|
16
|
+
File Extension: dll
|
17
|
+
|
18
|
+
Implementation:
|
19
|
+
|
20
|
+
1. Access to internals
|
21
|
+
The handle returned by LoadLibrary() is a pointer to the PE header
|
22
|
+
(which is a DOS header).
|
23
|
+
|
24
|
+
|
25
|
+
Notes on elf:
|
26
|
+
|
27
|
+
File Extension: so
|
28
|
+
Variants: Two core classes are defined Elf 32- and 64-bit.
|
29
|
+
Only one model is compiled in the library (the current run-time format).
|
30
|
+
|
31
|
+
Dynamic symbol table:
|
32
|
+
|
33
|
+
Symbol table layout:
|
34
|
+
1. Index 0 in any symbol table is used to represent undefined symbols.
|
35
|
+
As such, the first entry in a symbol table (index 0) is always completely
|
36
|
+
zeroed (type STT_NOTYPE), and is not used.
|
37
|
+
|
38
|
+
2. If the file contains any local symbols, the second entry (index 1)
|
39
|
+
the symbol table will be a STT_FILE symbol giving the name of the file.
|
40
|
+
|
41
|
+
3. Section symbols.
|
42
|
+
|
43
|
+
4. Register symbols.
|
44
|
+
|
45
|
+
5. Global symbols that have been reduced to local scope via a mapfile.
|
46
|
+
|
47
|
+
6. For each input file that supplied local symbols, a STT_FILE symbol
|
48
|
+
giving the name of the input file is put in the symbol table,
|
49
|
+
followed by the symbols in question.
|
50
|
+
|
51
|
+
7. The global symbols immediately follow the local symbols in the
|
52
|
+
symbol table. Local and global symbols are always kept separate
|
53
|
+
in this manner, and cannot be mixed together.
|
54
|
+
|
55
|
+
|
56
|
+
Dynamic symbol table handling seem to be different among platforms.
|
57
|
+
Due to System V ABI, one get access to the dynamic symbol table through
|
58
|
+
the DT_HASH entry in "DYNAMIC" Program Header.
|
59
|
+
|
60
|
+
It does not work on x86 on a x86_64 linux 2.6 machine.
|
61
|
+
|
62
|
+
A closer look to the binaries in /usr/lib32 revealed, there are differences:
|
63
|
+
|
64
|
+
differences
|
65
|
+
- elf32 has 21 sections
|
66
|
+
- elf64 has (21 + 2) sections
|
67
|
+
".hash"
|
68
|
+
".eh_frame_hdr"
|
69
|
+
- elf64 has ".rela.*"
|
70
|
+
while elf32 has ".rel.*"
|
71
|
+
|
72
|
+
in common:
|
73
|
+
- both have a ".gnu.hash" section
|
74
|
+
|
75
|
+
|
76
|
+
the ".gnu.hash"
|
77
|
+
|
78
|
+
|
79
|
+
Idea: "GNU hash" method ([3])
|
80
|
+
|
81
|
+
|
82
|
+
Symbol Versioning:
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
OS supported prelinking:
|
87
|
+
|
88
|
+
linux has prelink
|
89
|
+
irix has quickstart
|
90
|
+
solaris has crle
|
91
|
+
|
92
|
+
sparc uses STT_REGISTER:
|
93
|
+
STT_REGISTER is
|
94
|
+
The Sparc architecture has a concept known as a "register symbol". These
|
95
|
+
symbols are used to validate symbol/register usage, and can also be
|
96
|
+
used to initialize global registers. Other architectures don't use these.
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
References:
|
105
|
+
[1] Levin, R. John: Linkers & Loader
|
106
|
+
[2] System V ABI
|
107
|
+
[3] The cost of elf symbol hashing: http://blogs.sun.com/ali/entry/the_cost_of_elf_symbol
|
108
|
+
[4] GNU Hash ELF Section: http://blogs.sun.com/ali/entry/gnu_hash_elf_sections
|
109
|
+
[5] http://refspecs.freestandards.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/symversion.html
|
110
|
+
[6] elf: http://greek0.net/elf.html
|
111
|
+
[7] System V ABI Application Binary Interface - Draft 17 - December 2003 (SCO) :
|
112
|
+
http://sco.com/developers/gabi/latest/contents.html
|
113
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
- RTLD_LAZY in darwin, why not in unix?
|
2
|
+
- Failed On Open Solaris 11:
|
3
|
+
|
4
|
+
In file included from dynload_syms.c:28:
|
5
|
+
dynload_syms_elf.c:56: error: syntax error before "Elf_Dyn"
|
6
|
+
dynload_syms_elf.c:56: warning: data definition has no type or storage class
|
7
|
+
dynload_syms_elf.c: In function `dlSymsInit':
|
8
|
+
dynload_syms_elf.c:155: error: `pDyn' undeclared (first use in this function)
|
9
|
+
dynload_syms_elf.c:155: error: (Each undeclared identifier is reported only once
|
10
|
+
dynload_syms_elf.c:155: error: for each function it appears in.)
|
11
|
+
dynload_syms_elf.c:155: error: syntax error before ')' token
|
12
|
+
dynload_syms_elf.c:160: error: `DT_NULL' undeclared (first use in this function)
|
13
|
+
dynload_syms_elf.c:163: error: `DT_STRTAB' undeclared (first use in this function)
|
14
|
+
dynload_syms_elf.c:164: error: `DT_SYMTAB' undeclared (first use in this function)
|
15
|
+
dynload_syms_elf.c:165: error: `DT_HASH' undeclared (first use in this function)
|
16
|
+
make: *** [dynload_syms.o] Error 1
|
17
|
+
|
18
|
+
DONE:
|
19
|
+
- remove dependencies dyncall_{alloc,macros}.h
|
20
|
+
|
@@ -0,0 +1,64 @@
|
|
1
|
+
.\" Copyright (c) 2007-2014 Daniel Adler <dadler AT uni-goettingen DOT de>,
|
2
|
+
.\" Tassilo Philipp <tphilipp AT potion-studios DOT com>
|
3
|
+
.\"
|
4
|
+
.\" Permission to use, copy, modify, and distribute this software for any
|
5
|
+
.\" purpose with or without fee is hereby granted, provided that the above
|
6
|
+
.\" copyright notice and this permission notice appear in all copies.
|
7
|
+
.\"
|
8
|
+
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
9
|
+
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
10
|
+
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
11
|
+
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
12
|
+
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
13
|
+
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
14
|
+
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
15
|
+
.\"
|
16
|
+
.Dd $Mdocdate$
|
17
|
+
.Dt dynload 3
|
18
|
+
.Os
|
19
|
+
|
20
|
+
.Sh NAME
|
21
|
+
.Nm dynload
|
22
|
+
.Nd encapsulates dynamic loading mechanisms and
|
23
|
+
gives access to functions in foreign dynamic libraries and code modules.
|
24
|
+
.Sh SYNOPSIS
|
25
|
+
.In dynload.h
|
26
|
+
.Ft DLLib *
|
27
|
+
.Fn dlLoadLibrary "const char * libpath"
|
28
|
+
.Ft void
|
29
|
+
.Fn dlFreeLibrary "DLLib * pLib"
|
30
|
+
.Ft void *
|
31
|
+
.Fn dlFindSymbol "DLLib pLibode" "const char * pSymbolName"
|
32
|
+
.Sh DESCRIPTION
|
33
|
+
The
|
34
|
+
.Nm
|
35
|
+
library provides an interface to load foreign dynamic libraries and access
|
36
|
+
to their symbols.
|
37
|
+
.Pp
|
38
|
+
.Fn dlLoadLibrary
|
39
|
+
loads a dynamic library at
|
40
|
+
.Ar libpath
|
41
|
+
and returns a handle to it for use in
|
42
|
+
.Fn dlFreeLibrary
|
43
|
+
and
|
44
|
+
.Fn dlFindSymbol
|
45
|
+
calls.
|
46
|
+
.Pp
|
47
|
+
.Fn dlFreeLibrary
|
48
|
+
frees the loaded library with handle
|
49
|
+
.Ar pLib .
|
50
|
+
.Pp
|
51
|
+
.Fn dlFindSymbol
|
52
|
+
returns a pointer to a symbol with name
|
53
|
+
.Ar pSymbolName
|
54
|
+
in the library with handle
|
55
|
+
.Ar pLib ,
|
56
|
+
or returns a null pointer if the symbol cannot be found.
|
57
|
+
.Sh SEE ALSO
|
58
|
+
.Xr dyncall 3 ,
|
59
|
+
.Xr dyncallback 3
|
60
|
+
and the dyncall manual (available in PDF format) for a way more detailed documentation of this
|
61
|
+
library.
|
62
|
+
.Sh AUTHORS
|
63
|
+
.An "Daniel Adler" Aq dadler@uni-goettingen.de
|
64
|
+
.An "Tassilo Philipp" Aq tphilipp@potion-studios.com
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dynload
|
5
|
+
File: dynload/dynload.c
|
6
|
+
Description: Auto-include delegate to windows/posix-based dynamic linker.
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
|
+
|
12
|
+
Permission to use, copy, modify, and distribute this software for any
|
13
|
+
purpose with or without fee is hereby granted, provided that the above
|
14
|
+
copyright notice and this permission notice appear in all copies.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
17
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
18
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
19
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
20
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
21
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
22
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
|
27
|
+
#include "../autovar/autovar_OSFAMILY.h"
|
28
|
+
#if defined(OSFAMILY_Windows)
|
29
|
+
# include "dynload_windows.c"
|
30
|
+
#elif defined(OSFAMILY_Unix)
|
31
|
+
# include "../autovar/autovar_OS.h"
|
32
|
+
# if defined(OS_Darwin)
|
33
|
+
# include "dynload_darwin.c"
|
34
|
+
# else
|
35
|
+
# include "dynload_unix.c"
|
36
|
+
# endif
|
37
|
+
#endif
|
38
|
+
|
@@ -0,0 +1,65 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dynload
|
5
|
+
File: dynload/dynload.h
|
6
|
+
Description: public header for library dynload
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
|
+
|
12
|
+
Permission to use, copy, modify, and distribute this software for any
|
13
|
+
purpose with or without fee is hereby granted, provided that the above
|
14
|
+
copyright notice and this permission notice appear in all copies.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
17
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
18
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
19
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
20
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
21
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
22
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
|
27
|
+
#ifndef DYNLOAD_H
|
28
|
+
#define DYNLOAD_H
|
29
|
+
|
30
|
+
#ifdef __cplusplus
|
31
|
+
extern "C" {
|
32
|
+
#endif
|
33
|
+
|
34
|
+
#ifndef DL_API
|
35
|
+
#define DL_API
|
36
|
+
#endif
|
37
|
+
|
38
|
+
/* --- public api ---------------------------------------------------------- */
|
39
|
+
|
40
|
+
/* shared library loading and explicit symbol resolving */
|
41
|
+
|
42
|
+
typedef struct DLLib_ DLLib;
|
43
|
+
|
44
|
+
DL_API DLLib* dlLoadLibrary(const char* libpath);
|
45
|
+
DL_API void dlFreeLibrary(DLLib* pLib);
|
46
|
+
DL_API void* dlFindSymbol(DLLib* pLib, const char* pSymbolName);
|
47
|
+
|
48
|
+
/* symbol table enumeration - only for symbol lookup, not resolve */
|
49
|
+
|
50
|
+
typedef struct DLSyms_ DLSyms;
|
51
|
+
|
52
|
+
DL_API DLSyms* dlSymsInit (const char* libPath);
|
53
|
+
DL_API void dlSymsCleanup(DLSyms* pSyms);
|
54
|
+
|
55
|
+
DL_API int dlSymsCount (DLSyms* pSyms);
|
56
|
+
DL_API const char* dlSymsName (DLSyms* pSyms, int index);
|
57
|
+
DL_API const char* dlSymsNameFromValue(DLSyms* pSyms, void* value); /* symbol must be loaded */
|
58
|
+
|
59
|
+
|
60
|
+
#ifdef __cplusplus
|
61
|
+
}
|
62
|
+
#endif
|
63
|
+
|
64
|
+
#endif /* DYNLOAD_H */
|
65
|
+
|