Skip to content
Snippets Groups Projects
Commit 8625845c authored by Vivek Das Mohapatra's avatar Vivek Das Mohapatra
Browse files

per-library dlopen wrapper implementations now possible

parent 15f9355a
Branches
Tags
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -30,6 +30,7 @@ proxy_extra=$1; shift; ...@@ -30,6 +30,7 @@ proxy_extra=$1; shift;
proxy_src=$1; shift; proxy_src=$1; shift;
symbol_file=${proxy_src%.c}.symbols; symbol_file=${proxy_src%.c}.symbols;
map_file=${proxy_src%.c}.map; map_file=${proxy_src%.c}.map;
dlopen_file=${proxy_src}.dlopen;
echo -n > $symbol_file; echo -n > $symbol_file;
echo -n > $map_file; echo -n > $map_file;
...@@ -76,7 +77,19 @@ do ...@@ -76,7 +77,19 @@ do
done < $proxy_excluded; done < $proxy_excluded;
cat - <<EOF cat - <<EOF
NULL }; 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) static void *_dlopen (const char *filename, int flag)
{ {
if( flag & RTLD_GLOBAL ) if( flag & RTLD_GLOBAL )
...@@ -88,6 +101,12 @@ static void *_dlopen (const char *filename, int flag) ...@@ -88,6 +101,12 @@ static void *_dlopen (const char *filename, int flag)
} }
return capsule_shim_dlopen( symbol_ns, prefix, exclude, filename, 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) static void __attribute__ ((constructor)) _capsule_init (void)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment