Only list EXT_DEF symbols
authorRobert Pengelly <robertapengelly@hotmail.com>
Thu, 12 Jun 2025 20:36:50 +0000 (21:36 +0100)
committerRobert Pengelly <robertapengelly@hotmail.com>
Thu, 12 Jun 2025 20:36:50 +0000 (21:36 +0100)
ranlib.c

index e04d312ce9858367be3e5aec9f4bad90497c5506..c833d1ff363ea85a8e32df9aeb592ab5f01d4562 100644 (file)
--- 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);
             
             }