summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-01-26 20:09:12 +0000
committermidipix <writeonce@midipix.org>2024-01-26 20:09:12 +0000
commit8fc5e1774a0ce2e46a05e5332bc5d3aff9685259 (patch)
tree940de3732ad0b7faa7c84595e083bdc665a4ac2e
parent405946b848705258f7f744fa0e61ff7f64ea73f4 (diff)
downloadslibtool-8fc5e1774a0ce2e46a05e5332bc5d3aff9685259.tar.bz2
slibtool-8fc5e1774a0ce2e46a05e5332bc5d3aff9685259.tar.xz
slbt_get_archive_meta(): record number of public archive members.
-rw-r--r--src/arbits/slbt_archive_meta.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/arbits/slbt_archive_meta.c b/src/arbits/slbt_archive_meta.c
index e83ee9f..24009a4 100644
--- a/src/arbits/slbt_archive_meta.c
+++ b/src/arbits/slbt_archive_meta.c
@@ -711,6 +711,7 @@ int slbt_get_archive_meta(
const char * fldcap;
size_t nelements;
uint64_t nentries;
+ uint64_t nmembers;
uint64_t stblsize;
uint64_t filesize;
uint64_t namelen;
@@ -1145,6 +1146,25 @@ int slbt_get_archive_meta(
ch++;
}
+ /* number of public archive members */
+ for (idx=0,nmembers=0; idx<nentries; idx++) {
+ switch (m->memberv[idx]->ar_member_attr) {
+ case AR_MEMBER_ATTR_ARMAP:
+ case AR_MEMBER_ATTR_LINKINFO:
+ case AR_MEMBER_ATTR_NAMESTRS:
+ break;
+
+ default:
+ nmembers++;
+ }
+ }
+
+ if (m->armaps.armap_common_32.ar_member)
+ m->armaps.armap_common_32.ar_num_of_members = nmembers;
+
+ if (m->armaps.armap_common_64.ar_member)
+ m->armaps.armap_common_64.ar_num_of_members = nmembers;
+
/* pe/coff armap attributes (second linker member) */
(void)m->armeta.a_armap_pecoff;