summaryrefslogtreecommitdiffhomepage
path: root/src/driver
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/driver
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/driver')
-rw-r--r--src/driver/slbt_driver_ctx.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 8f4f2dc..fc242c0 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -247,7 +247,7 @@ static struct slbt_driver_ctx_impl * slbt_driver_ctx_alloc(
}
if (ndlopen) {
- if (!(ictx->ctx.dlopenv = calloc(ndlopen+1,sizeof(char *)))) {
+ if (!(ictx->ctx.dlopenv = calloc(ndlopen+1,sizeof(*ictx->ctx.dlopenv)))) {
free(ictx);
slbt_free_argv_buffer(sargv,objlistv);
return 0;
@@ -406,7 +406,7 @@ int slbt_lib_get_driver_ctx(
const char * lconf;
uint64_t lflags;
size_t ndlopen;
- const char ** dlopenv;
+ struct argv_entry ** dlopenv;
const char * cfgmeta_host;
const char * cfgmeta_ar;
const char * cfgmeta_as;
@@ -1010,7 +1010,16 @@ int slbt_lib_get_driver_ctx(
if (entry->fopt) {
switch (entry->tag) {
case TAG_DLOPEN:
- ctx->cctx.drvflags |= SLBT_DRIVER_DLOPEN_FORCE;
+ if (!strcmp(entry->arg,"self")) {
+ ctx->cctx.drvflags |= SLBT_DRIVER_DLOPEN_FORCE;
+
+ } else if (!strcmp(entry->arg,"force")) {
+ ctx->cctx.drvflags |= SLBT_DRIVER_DLOPEN_FORCE;
+
+ } else {
+ *dlopenv++ = entry;
+ }
+
break;
case TAG_DLPREOPEN:
@@ -1021,9 +1030,11 @@ int slbt_lib_get_driver_ctx(
ctx->cctx.drvflags |= SLBT_DRIVER_DLPREOPEN_FORCE;
} else {
- *dlopenv++ = entry->arg;
+ *dlopenv++ = entry;
}
+ break;
+
default:
break;
}