shithub: scc

Download patch

ref: 9c7973946f1d199343adaf0f516799bb6fd9ae0d
parent: 72e4cc1c65247b66d5e6caf26096ebc1c730d533
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Mar 12 15:26:04 EDT 2018

[nm] Considerer U symbols always smallers

This is only intended to provided a beatifull list when -v is used.

--- a/nm/main.c
+++ b/nm/main.c
@@ -169,10 +169,21 @@
 {
 	const struct symbol *s1 = p1, *s2 = p2;
 
-	if (vflag)
-		return s1->value - s2->value;
-	else
+	if (vflag) {
+		if (s1->value > s2->value)
+			return 1;
+		if (s1->value < s2->value)
+			return -1;
+		if (s1->type == 'U' && s2->type == 'U')
+			return 0;
+		if (s1->type == 'U')
+			return -1;
+		if (s2->type == 'U')
+			return 1;
+		return 0;
+	} else {
 		return strcmp(s1->name, s2->name);
+	}
 }
 
 void