summaryrefslogtreecommitdiff
path: root/src/arbits
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-03-04 23:51:23 +0000
committermidipix <writeonce@midipix.org>2024-03-05 00:15:44 +0000
commit91c8dd7dd5cb8d4bdc1dcfd1ecca3304c187b0de (patch)
tree580b6995df3418e7263354eebb44eb35e7fe72c0 /src/arbits
parente06cc0e4519405cb1d1475045f3acfaeb91226ba (diff)
downloadslibtool-91c8dd7dd5cb8d4bdc1dcfd1ecca3304c187b0de.tar.bz2
slibtool-91c8dd7dd5cb8d4bdc1dcfd1ecca3304c187b0de.tar.xz
slbt_ar_update_syminfo(): added support for (virtual) empty archives.
Diffstat (limited to 'src/arbits')
-rw-r--r--src/arbits/slbt_archive_syminfo.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/arbits/slbt_archive_syminfo.c b/src/arbits/slbt_archive_syminfo.c
index 879278f..f3857eb 100644
--- a/src/arbits/slbt_archive_syminfo.c
+++ b/src/arbits/slbt_archive_syminfo.c
@@ -249,8 +249,15 @@ slbt_hidden int slbt_ar_update_syminfo(
dctx = ictx->dctx;
/* nm -P -A -g */
- if (slbt_obtain_nminfo(ictx,ectx,dctx,mctx) < 0)
- return SLBT_NESTED_ERROR(dctx);
+ if (mctx->armaps.armap_nsyms) {
+ if (slbt_obtain_nminfo(ictx,ectx,dctx,mctx) < 0)
+ return SLBT_NESTED_ERROR(dctx);
+ } else {
+ if (slbt_lib_get_txtfile_ctx(
+ dctx,"/dev/null",
+ &mctx->nminfo) < 0)
+ return SLBT_NESTED_ERROR(dctx);
+ }
/* free old syminfo vector */
if (mctx->syminfv)