From b6b8ce4e9628a8900002ccbe2a583133b87259b2 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 28 Jan 2024 08:02:24 +0000 Subject: slbt_get_archive_meta(): symrefs vector: record name offsets. --- src/arbits/slbt_archive_meta.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/arbits') diff --git a/src/arbits/slbt_archive_meta.c b/src/arbits/slbt_archive_meta.c index 5bc1c2f..435641e 100644 --- a/src/arbits/slbt_archive_meta.c +++ b/src/arbits/slbt_archive_meta.c @@ -824,6 +824,8 @@ int slbt_get_archive_meta( struct ar_meta_member_info * memberp; char * longnamep; size_t idx; + struct ar_meta_armap_ref_32 * symrefs_32; + struct ar_meta_armap_ref_64 * symrefs_64; struct ar_header_info * hdrinfov; struct ar_header_info * hdrinfov_cap; struct ar_header_info * hdrinfov_next; @@ -1247,6 +1249,20 @@ int slbt_get_archive_meta( ch++; } + if (m->armaps.armap_common_32.ar_member) { + symrefs_32 = m->armaps.armap_symrefs_32; + + for (idx=0; idxarmaps.armap_nsyms; idx++) + symrefs_32[idx].ar_name_offset = m->symstrv[idx] - m->symstrv[0]; + } + + if (m->armaps.armap_common_64.ar_member) { + symrefs_64 = m->armaps.armap_symrefs_64; + + for (idx=0; idxarmaps.armap_nsyms; idx++) + symrefs_64[idx].ar_name_offset = m->symstrv[idx] - m->symstrv[0]; + } + /* number of public archive members */ for (idx=0,nmembers=0; idxmemberv[idx]->ar_member_attr) { -- cgit v1.2.3