summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-03-05 01:11:15 +0000
committermidipix <writeonce@midipix.org>2024-03-05 02:10:46 +0000
commite47cd7d15cee80e0a78fb7a4ec0d53e117d37379 (patch)
tree9f5d8a988db33f1941f9e61f3a6771ec32eeed86
parent8ef9e14afc6d97e6cf2da17995c3278f7309cf25 (diff)
downloadslibtool-e47cd7d15cee80e0a78fb7a4ec0d53e117d37379.tar.bz2
slibtool-e47cd7d15cee80e0a78fb7a4ec0d53e117d37379.tar.xz
driver: finalized -dlopen, including the 'self' and 'force' special arguments.
-rw-r--r--src/driver/slbt_driver_ctx.c6
-rw-r--r--src/driver/slbt_split_argv.c11
-rw-r--r--src/skin/slbt_skin_default.c6
3 files changed, 15 insertions, 8 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 0e4ebda..8f4f2dc 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -722,8 +722,6 @@ int slbt_lib_get_driver_ctx(
break;
case TAG_DLOPEN:
- break;
-
case TAG_DLPREOPEN:
ndlopen++;
break;
@@ -1011,6 +1009,10 @@ int slbt_lib_get_driver_ctx(
for (entry=meta->entries; entry->fopt || entry->arg; entry++) {
if (entry->fopt) {
switch (entry->tag) {
+ case TAG_DLOPEN:
+ ctx->cctx.drvflags |= SLBT_DRIVER_DLOPEN_FORCE;
+ break;
+
case TAG_DLPREOPEN:
if (!strcmp(entry->arg,"self")) {
ctx->cctx.drvflags |= SLBT_DRIVER_DLPREOPEN_SELF;
diff --git a/src/driver/slbt_split_argv.c b/src/driver/slbt_split_argv.c
index df0db37..894ed9d 100644
--- a/src/driver/slbt_split_argv.c
+++ b/src/driver/slbt_split_argv.c
@@ -472,10 +472,6 @@ slbt_hidden int slbt_split_argv(
*targv++ = argv[i++];
*targv++ = argv[i];
- } else if (!(strcmp("dlopen",&argv[i][1]))) {
- *targv++ = argv[i++];
- *targv++ = argv[i];
-
} else if (!(strcmp("weak",&argv[i][1]))) {
*targv++ = argv[i++];
*targv++ = argv[i];
@@ -502,6 +498,13 @@ slbt_hidden int slbt_split_argv(
*targv++ = argv[i++];
*targv++ = argv[i];
+ } else if (!(strcmp("dlopen",&argv[i][1]))) {
+ if (!argv[i+1])
+ return -1;
+
+ *targv++ = argv[i++];
+ *targv++ = argv[i];
+
} else if (!(strcmp("dlpreopen",&argv[i][1]))) {
if (!argv[i+1])
return -1;
diff --git a/src/skin/slbt_skin_default.c b/src/skin/slbt_skin_default.c
index d258def..c982908 100644
--- a/src/skin/slbt_skin_default.c
+++ b/src/skin/slbt_skin_default.c
@@ -202,8 +202,10 @@ const slbt_hidden struct argv_option slbt_default_options[] = {
{"dlopen", 0,TAG_DLOPEN,ARGV_OPTARG_REQUIRED,
ARGV_OPTION_HYBRID_ONLY|ARGV_OPTION_HYBRID_SPACE,
0,"<module>",
- "add the directory containing %s to the library path "
- "[currently a no-op]"},
+ "create and link into the dynamic library, dynamic module, "
+ "or executable program a minimal, backward-compatible dlsyms "
+ "vtable. On modern systems, this has the same effect as "
+ "``-dlpreopen force``."},
{"dlpreopen", 0,TAG_DLPREOPEN,ARGV_OPTARG_REQUIRED,
ARGV_OPTION_HYBRID_ONLY|ARGV_OPTION_HYBRID_SPACE,