summaryrefslogtreecommitdiff
path: root/src/logic/slbt_exec_ctx.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-03-05 00:10:46 +0000
committermidipix <writeonce@midipix.org>2024-03-05 00:15:44 +0000
commit4451024fec461fdcd1ee4f01fa2366685cb4b245 (patch)
tree9dfd65e25124843459390495e75b4f55dbcf0017 /src/logic/slbt_exec_ctx.c
parentec361714cdf8709955962c8696c42d2ccd8ce5e8 (diff)
downloadslibtool-4451024fec461fdcd1ee4f01fa2366685cb4b245.tar.bz2
slibtool-4451024fec461fdcd1ee4f01fa2366685cb4b245.tar.xz
slbt_get_exec_ctx(): added support for `-dlopen/-dlpreopen force`.
Diffstat (limited to 'src/logic/slbt_exec_ctx.c')
-rw-r--r--src/logic/slbt_exec_ctx.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index 69aecc1..e6fd248 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -193,6 +193,7 @@ int slbt_ectx_get_exec_ctx(
{
struct slbt_exec_ctx_impl * ictx;
struct slbt_driver_ctx_impl * idctx;
+ uint64_t fmask;
char ** parg;
char ** src;
char ** dst;
@@ -587,10 +588,34 @@ int slbt_ectx_get_exec_ctx(
"@PROGRAM@");
ch++;
+
+ ictx->ctx.mapfilename = ch;
+ ch += sprintf(ch,"%s%s",
+ ictx->ctx.exefilename,
+ dctx->cctx->settings.mapsuffix);
+ ch++;
+
}
/* dlopen, dlpreopen */
if ((dlopenv = idctx->dlopenv), (dlactxv = ictx->dlactxv)) {
+ fmask = SLBT_DRIVER_DLPREOPEN_FORCE;
+ fmask |= SLBT_DRIVER_DLOPEN_FORCE;
+
+ if (dctx->cctx->drvflags & fmask) {
+ if (slbt_ar_get_varchive_ctx(dctx,dlactxv) < 0)
+ return slbt_ectx_free_exec_ctx_impl(
+ ictx,
+ SLBT_NESTED_ERROR(dctx));
+
+ if (slbt_ar_update_syminfo(*dlactxv,&ictx->ctx) < 0)
+ return slbt_ectx_free_exec_ctx_impl(
+ ictx,
+ SLBT_NESTED_ERROR(dctx));
+
+ dlactxv++;
+ }
+
for (; *dlopenv; ) {
arname = ictx->sbuf;
strcpy(arname,*dlopenv);