summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-13 03:53:17 +0000
committermidipix <writeonce@midipix.org>2024-02-13 03:53:17 +0000
commit6ab3f1cde643d5e9408bac0b1ad10fb901cf2294 (patch)
tree6cd8b97c32ff22d0cfb5d0543065a9ac19dd95f6 /src
parent94aeb31299e62cd9030f3f3df5b99babfc289b7d (diff)
downloadslibtool-6ab3f1cde643d5e9408bac0b1ad10fb901cf2294.tar.bz2
slibtool-6ab3f1cde643d5e9408bac0b1ad10fb901cf2294.tar.xz
slbt_get_lconf_flags(): keep the located libtool script mapped for later use.
Diffstat (limited to 'src')
-rw-r--r--src/driver/slbt_driver_ctx.c6
-rw-r--r--src/internal/slibtool_driver_impl.h2
-rw-r--r--src/internal/slibtool_lconf_impl.c3
3 files changed, 10 insertions, 1 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index d03d1ed..bfb2206 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -11,6 +11,7 @@
#include <stdbool.h>
#include <fcntl.h>
#include <spawn.h>
+#include <sys/mman.h>
#include <sys/wait.h>
#define ARGV_DRIVER
@@ -886,6 +887,11 @@ static void slbt_free_driver_ctx_impl(struct slbt_driver_ctx_alloc * ictx)
if (ictx->ctx.libname)
free(ictx->ctx.libname);
+ if (ictx->ctx.lconf.addr)
+ munmap(
+ ictx->ctx.lconf.addr,
+ ictx->ctx.lconf.size);
+
for (objlistp=ictx->ctx.objlistv; objlistp->name; objlistp++) {
free(objlistp->objv);
free(objlistp->addr);
diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h
index f633adf..f563638 100644
--- a/src/internal/slibtool_driver_impl.h
+++ b/src/internal/slibtool_driver_impl.h
@@ -14,6 +14,7 @@
#include <slibtool/slibtool.h>
#include "slibtool_dprintf_impl.h"
+#include "slibtool_mapfile_impl.h"
#include "argv/argv.h"
#define SLBT_OPTV_ELEMENTS 128
@@ -124,6 +125,7 @@ struct slbt_driver_ctx_impl {
struct slbt_host_strs host;
struct slbt_host_strs ahost;
struct slbt_fd_ctx fdctx;
+ struct slbt_map_info lconf;
struct slbt_obj_list * objlistv;
const struct slbt_archive_ctx * arctx;
diff --git a/src/internal/slibtool_lconf_impl.c b/src/internal/slibtool_lconf_impl.c
index b1bde60..da0ffdd 100644
--- a/src/internal/slibtool_lconf_impl.c
+++ b/src/internal/slibtool_lconf_impl.c
@@ -807,7 +807,8 @@ int slbt_get_lconf_flags(
/* all done */
- munmap(addr,st.st_size);
+ ctx->lconf.addr = addr;
+ ctx->lconf.size = st.st_size;
return 0;
}