--- misc/nm.c.orig
+++ misc/nm.c
@@ -519,7 +519,7 @@ void *cookie)
     uint32_t nsymbols;
     struct value_diff *value_diffs;
 
-    char *short_name, *has_suffix;
+    char *short_name, *suffix;
     enum bool is_framework;
 #ifdef LTO_SUPPORT
     char *llvm_bundle_pointer;
@@ -755,9 +755,20 @@ void *cookie)
 		    process_flags.lib_names[j] =
 			(char *)dl + dl->dylib.name.offset;
 		    short_name = guess_short_name(process_flags.lib_names[j],
-						  &is_framework, &has_suffix);
-		    if(short_name != NULL)
-			process_flags.lib_names[j] = short_name;
+						  &is_framework, &suffix);
+		    if(short_name != NULL) {
+			if (suffix) {
+			    char *combined_name;
+			    asprintf(&combined_name, "%s%s", short_name, suffix);
+			    if (combined_name) {
+				process_flags.lib_names[j] = combined_name;
+				free(short_name);
+				free(suffix);
+			    }
+			} else {
+			    process_flags.lib_names[j] = short_name;
+			}
+		    }
 		    j++;
 		}
 		lc = (struct load_command *)
