summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-28 07:25:27 +0000
committermidipix <writeonce@midipix.org>2024-02-28 08:14:29 +0000
commit6f477a3ea989f0562514cbcdc282982018c55879 (patch)
tree3763a612b6e643a20ca9b2f1ac69994195abef37
parent36c2032af89b26e9c407cd11052a611db65a2ff6 (diff)
downloadslibtool-6f477a3ea989f0562514cbcdc282982018c55879.tar.bz2
slibtool-6f477a3ea989f0562514cbcdc282982018c55879.tar.xz
slbt_ar_create_dlsyms(): obtain symbol information (via nm) as needed.
-rw-r--r--src/arbits/slbt_archive_dlsyms.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/arbits/slbt_archive_dlsyms.c b/src/arbits/slbt_archive_dlsyms.c
index 453d4b6..5fd007c 100644
--- a/src/arbits/slbt_archive_dlsyms.c
+++ b/src/arbits/slbt_archive_dlsyms.c
@@ -328,6 +328,8 @@ static int slbt_ar_create_dlsyms_impl(
mode_t mode)
{
int ret;
+ struct slbt_archive_ctx ** actx;
+ struct slbt_exec_ctx * ectx;
struct slbt_archive_meta_impl * mctx;
const struct slbt_driver_ctx * dctx;
struct slbt_fd_ctx fdctx;
@@ -335,6 +337,7 @@ static int slbt_ar_create_dlsyms_impl(
mctx = slbt_archive_meta_ictx(arctxv[0]->meta);
dctx = mctx->dctx;
+ ectx = 0;
if (slbt_lib_get_driver_fdctx(dctx,&fdctx) < 0)
return SLBT_NESTED_ERROR(dctx);
@@ -349,6 +352,21 @@ static int slbt_ar_create_dlsyms_impl(
fdout = fdctx.fdout;
}
+ for (actx=arctxv; *actx; actx++) {
+ mctx = slbt_archive_meta_ictx((*actx)->meta);
+
+ if (!mctx->syminfo && !ectx)
+ if (slbt_ectx_get_exec_ctx(dctx,&ectx) < 0)
+ return SLBT_NESTED_ERROR(dctx);
+
+ if (!mctx->syminfo)
+ if (slbt_ar_update_syminfo(*actx,ectx) < 0)
+ return SLBT_NESTED_ERROR(dctx);
+ }
+
+ if (ectx)
+ slbt_ectx_free_exec_ctx(ectx);
+
ret = slbt_ar_output_dlsyms_impl(
fdout,dctx,arctxv,dlunit);