From 1ad95a1b67988eaf1733eb3d1bc6123db6183880 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 28 Jan 2024 06:11:55 +0000 Subject: slbt_ar_parse_primary_armap_sysv_64(): symrefs vector: record member offsets. --- src/arbits/slbt_archive_meta.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/arbits/slbt_archive_meta.c') diff --git a/src/arbits/slbt_archive_meta.c b/src/arbits/slbt_archive_meta.c index 8482858..d2e8b07 100644 --- a/src/arbits/slbt_archive_meta.c +++ b/src/arbits/slbt_archive_meta.c @@ -588,6 +588,10 @@ static int slbt_ar_parse_primary_armap_sysv_64( struct ar_raw_armap_sysv_64 * armap; struct ar_meta_member_info * memberp; struct ar_meta_armap_common_64 *armapref; + struct ar_meta_armap_ref_64 * symrefs; + uint64_t idx; + uint64_t uref_hi; + uint64_t uref_lo; uint64_t nsyms_hi; uint64_t nsyms_lo; uint64_t nsyms; @@ -656,10 +660,24 @@ static int slbt_ar_parse_primary_armap_sysv_64( if (!(m->symstrv = calloc(nsyms + 1,sizeof(const char *)))) return SLBT_SYSTEM_ERROR(dctx,0); + if (!(m->armaps.armap_symrefs_64 = calloc(nsyms + 1,sizeof(*symrefs)))) + return SLBT_SYSTEM_ERROR(dctx,0); + + mark = armap->ar_first_ref_offset; + symrefs = m->armaps.armap_symrefs_64; + + for (idx=0,uch=*mark; idxar_string_table = m->symstrv; armapref = &m->armaps.armap_common_64; armapref->ar_member = memberp; + armapref->ar_symrefs = symrefs; armapref->ar_armap_sysv = armap; armapref->ar_armap_attr = AR_ARMAP_ATTR_SYSV | AR_ARMAP_ATTR_BE_64; armapref->ar_num_of_symbols = nsyms; -- cgit v1.2.3