From 11957ad98b5af041ff0ba04deb1cc4c9e2154ca2 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 9 Sep 2015 07:08:43 -0400 Subject: fix 32/64-bit support. --- Makefile | 4 ++-- stub.S | 32 ++++++++++++++++++++++++++++++++ stub.s | 24 ------------------------ 3 files changed, 34 insertions(+), 26 deletions(-) create mode 100644 stub.S delete mode 100644 stub.s diff --git a/Makefile b/Makefile index 6c0f91a..14a1a7b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ all: - $(TARGET)-gcc -shared -nostdlib -mout-implib -olibpsxscl.so stub.s - $(TARGET)-as -o stub.o stub.s + $(TARGET)-gcc -shared -nostdlib -mout-implib -olibpsxscl.so stub.S + $(TARGET)-gcc -c -o stub.o stub.S $(TARGET)-ar rc libpsxscl.a stub.o $(TARGET)-ranlib libpsxscl.a diff --git a/stub.S b/stub.S new file mode 100644 index 0000000..1d6e11a --- /dev/null +++ b/stub.S @@ -0,0 +1,32 @@ +.text +.globl __psx_init +.globl ___psx_init +.globl _so_entry_point +.globl __so_entry_point + +.def __psx_init; .scl 2; .type 32; .endef +.def ___psx_init; .scl 2; .type 32; .endef + +__psx_init: +___psx_init: +_so_entry_point: +__so_entry_point: + mov $1, %eax + ret + + .section .got$stub + .global __imp___psx_init + .global __imp____psx_init + +#ifdef __NT64 +__imp___psx_init: +__imp____psx_init: + .quad __psx_init +#endif + +#ifdef __NT32 +__imp___psx_init: +__imp____psx_init: + .long ___psx_init + +#endif diff --git a/stub.s b/stub.s deleted file mode 100644 index 7c50c8e..0000000 --- a/stub.s +++ /dev/null @@ -1,24 +0,0 @@ -.text -.globl __psx_init -.globl ___psx_init -.globl _so_entry_point -.globl __so_entry_point - -.def __psx_init; .scl 2; .type 32; .endef -.def ___psx_init; .scl 2; .type 32; .endef - -__psx_init: -___psx_init: -_so_entry_point: -__so_entry_point: - mov $1, %eax - ret - - .section .got$stub - .global __imp___psx_init - .global __imp____psx_init -__imp___psx_init: - .quad __psx_init -__imp____psx_init: - .long ___psx_init - -- cgit v1.2.3