From 624308eba4996b2c48fb37862cd56e126425e693 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Thu, 12 Jun 2025 21:36:50 +0100 Subject: [PATCH] Only list EXT_DEF symbols --- ranlib.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ranlib.c b/ranlib.c index e04d312..c833d1f 100644 --- a/ranlib.c +++ b/ranlib.c @@ -367,7 +367,21 @@ static void hunk_get_symbols (void *object, unsigned long bytes, long offset) { pos += name_size; if (symbol_type == 1 || symbol_type == 2) { + + if (symbol_type == 1) { + + strtab = xmalloc (sizeof (*strtab)); + strtab->length = strlen (symname); + + strtab->name = xstrdup (symname); + strtab->offset = offset; + + add_strtab (&gstrtab, strtab); + + } + pos += 4; + } else if (symbol_type == 129 || symbol_type == 130 || symbol_type == 136) { if (symbol_type == 130) { @@ -380,14 +394,6 @@ static void hunk_get_symbols (void *object, unsigned long bytes, long offset) { pos = pos + 4 + num_ref; } - - strtab = xmalloc (sizeof (*strtab)); - strtab->length = strlen (symname); - - strtab->name = symname; - strtab->offset = offset; - - add_strtab (&gstrtab, strtab); } -- 2.34.1