From ca0f583ed2fd0fa7de8ac5ff71145ce0dd1a14f7 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 10 Oct 2016 23:51:34 -0400 Subject: psxglue.h: ldso: extend & future-proof the signature of the internal dlopen(). --- arch/nt32/psxglue.h | 2 +- arch/nt64/psxglue.h | 2 +- src/ldso/nt32/dynlink.c | 6 +++++- src/ldso/nt64/dynlink.c | 6 +++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/nt32/psxglue.h b/arch/nt32/psxglue.h index d00410e..1eda04b 100644 --- a/arch/nt32/psxglue.h +++ b/arch/nt32/psxglue.h @@ -9,7 +9,7 @@ typedef int __ldso_dladdr(const void * addr, void * info); typedef int __ldso_dlinfo(void * dso, int req, void * res); typedef void * __ldso_dlsym(void * p, const char * s, void * ra); -typedef void * __ldso_dlopen(const char * file, int mode); +typedef void * __ldso_dlopen(const char * file, int mode, const char * path, void * reserved); typedef int __ldso_dlclose(void *p); typedef char * __ldso_dlerror(void); typedef void __ldso_reset_tls(void); diff --git a/arch/nt64/psxglue.h b/arch/nt64/psxglue.h index d00410e..1eda04b 100644 --- a/arch/nt64/psxglue.h +++ b/arch/nt64/psxglue.h @@ -9,7 +9,7 @@ typedef int __ldso_dladdr(const void * addr, void * info); typedef int __ldso_dlinfo(void * dso, int req, void * res); typedef void * __ldso_dlsym(void * p, const char * s, void * ra); -typedef void * __ldso_dlopen(const char * file, int mode); +typedef void * __ldso_dlopen(const char * file, int mode, const char * path, void * reserved); typedef int __ldso_dlclose(void *p); typedef char * __ldso_dlerror(void); typedef void __ldso_reset_tls(void); diff --git a/src/ldso/nt32/dynlink.c b/src/ldso/nt32/dynlink.c index edfa4a8..c1fab74 100644 --- a/src/ldso/nt32/dynlink.c +++ b/src/ldso/nt32/dynlink.c @@ -1,5 +1,6 @@ #define _BSD_SOURCE +#include #include #include "psxglue.h" #include "pthread_impl.h" @@ -23,7 +24,10 @@ void *__dlsym(void * restrict p, const char * restrict s, void * restrict ra) void * dlopen(const char * file, int mode) { - return __ldso_vtbl->dlopen(file,mode); + return __ldso_vtbl->dlopen( + file,mode, + getenv("LD_LIBRARY_PATH"), + 0); } int dlclose(void *p) diff --git a/src/ldso/nt64/dynlink.c b/src/ldso/nt64/dynlink.c index edfa4a8..c1fab74 100644 --- a/src/ldso/nt64/dynlink.c +++ b/src/ldso/nt64/dynlink.c @@ -1,5 +1,6 @@ #define _BSD_SOURCE +#include #include #include "psxglue.h" #include "pthread_impl.h" @@ -23,7 +24,10 @@ void *__dlsym(void * restrict p, const char * restrict s, void * restrict ra) void * dlopen(const char * file, int mode) { - return __ldso_vtbl->dlopen(file,mode); + return __ldso_vtbl->dlopen( + file,mode, + getenv("LD_LIBRARY_PATH"), + 0); } int dlclose(void *p) -- cgit v1.2.3