summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-18 17:06:27 +0000
committermidipix <writeonce@midipix.org>2024-02-18 17:06:27 +0000
commit0006f718b62316336a9f27a008ea8525173a5b56 (patch)
tree309686013965c87e3f3569bbe808746ff0604c7d
parentbc3103627a97e7ee437c7bf7a0fae5eefc309a62 (diff)
downloadslibtool-0006f718b62316336a9f27a008ea8525173a5b56.tar.bz2
slibtool-0006f718b62316336a9f27a008ea8525173a5b56.tar.xz
slbt_get_archive_meta(): check whether all object members share binary format.
-rw-r--r--src/arbits/slbt_archive_meta.c12
-rw-r--r--src/internal/slibtool_ar_impl.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/arbits/slbt_archive_meta.c b/src/arbits/slbt_archive_meta.c
index f3dd39e..7279602 100644
--- a/src/arbits/slbt_archive_meta.c
+++ b/src/arbits/slbt_archive_meta.c
@@ -842,6 +842,18 @@ int slbt_get_archive_meta(
if (m->memberv[idx]->ar_member_data == arlongnames)
m->armeta.a_arref_longnames = m->memberv[idx];
+ /* common binary format (information only) */
+ for (idx=0,nmembers=0; idx<nentries; idx++) {
+ if (m->memberv[idx]->ar_member_attr == AR_MEMBER_ATTR_OBJECT) {
+ if (m->ofmtattr && (m->ofmtattr != m->memberv[idx]->ar_object_attr)) {
+ m->ofmtattr = 0;
+ idx = nentries;
+ } else if (!m->ofmtattr) {
+ m->ofmtattr = m->memberv[idx]->ar_object_attr;
+ }
+ }
+ }
+
/* member vector */
m->armeta.a_memberv = m->memberv;
diff --git a/src/internal/slibtool_ar_impl.h b/src/internal/slibtool_ar_impl.h
index b034c2b..e5bfca8 100644
--- a/src/internal/slibtool_ar_impl.h
+++ b/src/internal/slibtool_ar_impl.h
@@ -36,6 +36,7 @@ struct ar_armaps_impl {
struct slbt_archive_meta_impl {
const struct slbt_driver_ctx * dctx;
+ size_t ofmtattr;
size_t nentries;
void * hdrinfov;
char * namestrs;