From 8625845c9c76a6b7b57647df54376e26ff3d7800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vivek=20Das=C2=A0Mohapatra?= <vivek@collabora.co.uk> Date: Tue, 16 May 2017 17:48:48 +0100 Subject: [PATCH] per-library dlopen wrapper implementations now possible --- generate-stublib.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/generate-stublib.sh b/generate-stublib.sh index e04637ec6..f86da7823 100755 --- a/generate-stublib.sh +++ b/generate-stublib.sh @@ -30,6 +30,7 @@ proxy_extra=$1; shift; proxy_src=$1; shift; symbol_file=${proxy_src%.c}.symbols; map_file=${proxy_src%.c}.map; +dlopen_file=${proxy_src}.dlopen; echo -n > $symbol_file; echo -n > $map_file; @@ -76,7 +77,19 @@ do done < $proxy_excluded; cat - <<EOF NULL }; +EOF +if [ -f ${dlopen_file} ]; +then + echo "// -------------------------------------------------------------"; + echo "// start of ${proxy_src%.c} dlopen wrapper"; + cat $dlopen_file; + echo "// end of ${proxy_src%.c} dlopen wrapper"; + echo "// -------------------------------------------------------------"; +else + cat - <<EOF +// ------------------------------------------------------------------------- +// start of default capsule dlopen wrapper function section static void *_dlopen (const char *filename, int flag) { if( flag & RTLD_GLOBAL ) @@ -88,6 +101,12 @@ static void *_dlopen (const char *filename, int flag) } return capsule_shim_dlopen( symbol_ns, prefix, exclude, filename, flag ); } +// end of default capsule dlopen wrapper function section +// ------------------------------------------------------------------------- +EOF +fi + +cat - <<EOF static void __attribute__ ((constructor)) _capsule_init (void) { -- GitLab