From a07095d89f48e4612aea2b6edd0c3a62ab209892 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 10 Mar 2024 15:27:44 +0000 Subject: link mode: treat dlopen of static-only dependency libs as (also fixed) dlpreopen --- src/logic/linkcmd/slbt_linkcmd_argv.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/logic/linkcmd') 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 (; srcdlpreopen) + *dst++ = ectx->dlpreopen; + /* join all other args, eliminate no-op linker path args */ src = aargv; cap = aarg; -- cgit v1.2.3