summaryrefslogtreecommitdiffhomepage
path: root/src/logic/linkcmd/slbt_linkcmd_argv.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-03-10 15:27:44 +0000
committermidipix <writeonce@midipix.org>2024-03-10 20:35:00 +0000
commita07095d89f48e4612aea2b6edd0c3a62ab209892 (patch)
treee6ce840a6cbaded73a6c456315b91c41a78343ef /src/logic/linkcmd/slbt_linkcmd_argv.c
parent9a3246173ce1d855beebe83f44849e2aa0cf2e4a (diff)
downloadslibtool-a07095d89f48e4612aea2b6edd0c3a62ab209892.tar.bz2
slibtool-a07095d89f48e4612aea2b6edd0c3a62ab209892.tar.xz
link mode: treat dlopen of static-only dependency libs as (also fixed) dlpreopen
Diffstat (limited to 'src/logic/linkcmd/slbt_linkcmd_argv.c')
-rw-r--r--src/logic/linkcmd/slbt_linkcmd_argv.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/logic/linkcmd/slbt_linkcmd_argv.c b/src/logic/linkcmd/slbt_linkcmd_argv.c
index 5cfbddb..a7c0777 100644
--- a/src/logic/linkcmd/slbt_linkcmd_argv.c
+++ b/src/logic/linkcmd/slbt_linkcmd_argv.c
@@ -23,6 +23,7 @@
#include "slibtool_symlink_impl.h"
#include "slibtool_readlink_impl.h"
#include "slibtool_visibility_impl.h"
+#include "slibtool_ar_impl.h"
static const char * slbt_ar_self_dlunit = "@PROGRAM@";
@@ -940,7 +941,7 @@ slbt_hidden int slbt_exec_link_finalize_argument_vector(
/* add or repalce the archive context */
for (; !arctx && *arctxv; )
- if (!strcmp(*arctxv[0]->path,ectx->mapfilename))
+ if (!strcmp(*arctxv[0]->path,slbt_ar_self_dlunit))
arctx = *arctxv;
else
arctxv++;
@@ -955,7 +956,11 @@ slbt_hidden int slbt_exec_link_finalize_argument_vector(
if (slbt_ar_get_archive_ctx(dctx,arname,arctxv) < 0)
return SLBT_NESTED_ERROR(dctx);
- arctxv[0]->path = &slbt_ar_self_dlunit;
+ arctx = *arctxv;
+ arctx->path = &slbt_ar_self_dlunit;
+
+ if (slbt_ar_update_syminfo(arctx,ectx) < 0)
+ return SLBT_NESTED_ERROR(dctx);
/* regenerate the dlsyms vtable source */
if (slbt_ar_create_dlsyms(
@@ -981,6 +986,10 @@ slbt_hidden int slbt_exec_link_finalize_argument_vector(
for (; src<cap; )
*dst++ = *src++;
+ /* dlpreopen */
+ if (ectx->dlpreopen)
+ *dst++ = ectx->dlpreopen;
+
/* join all other args, eliminate no-op linker path args */
src = aargv;
cap = aarg;