shithub: scc

Download patch

ref: 64688dc02ba9cc803d2b2a8b6030d73602ed18cc
parent: 955a99b7c855cfc2378a9857bfbb8cb853047d6c
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Nov 28 17:28:49 EST 2017

[objdump] Use 1 space as data header

This space helps to differentiate between informative headers
and actual data.

--- a/objdump/main.c
+++ b/objdump/main.c
@@ -35,13 +35,13 @@
 printhdr(struct myrohdr *hdr)
 {
 	printf("header:\n"
-	       "\tmagic: %02x %02x %02x %02x \"%4.4s\"\n"
-	       "\tformat: %lu (\"%s\")\n"
-	       "\tentry: %llu\n"
-	       "\tstring table size: %llu\n"
-	       "\tsection table size: %llu\n"
-	       "\tsymbol table size: %llu\n"
-	       "\trelocation table size: %llu\n",
+	       " magic: %02x %02x %02x %02x \"%4.4s\"\n"
+	       " format: %lu (\"%s\")\n"
+	       " entry: %llu\n"
+	       " string table size: %llu\n"
+	       " section table size: %llu\n"
+	       " symbol table size: %llu\n"
+	       " relocation table size: %llu\n",
 	       hdr->magic[0], hdr->magic[1],
 	       hdr->magic[2], hdr->magic[3],
 	       hdr->magic,
@@ -66,7 +66,7 @@
 			begin = off;
 		}
 		if (strings[off] == '\0') {
-			printf("\t[%zd] \"%s\"\n", begin, s);
+			printf(" [%zd] \"%s\"\n", begin, s);
 			s = NULL;
 		}
 	}
@@ -100,7 +100,7 @@
 	struct myrosect sect;
 
 	printf("sections:\n"
-	       "[Nr]\t%s\t%-16s\t%-16s\t%s\t%s\t%s\n",
+	       " [Nr]\t%s\t%-16s\t%-16s\t%s\t%s\t%s\n",
 	       "Name",
 	       "Offset",
 	       "Size",
@@ -112,7 +112,7 @@
 	for (i = 0; i < n; ++i) {
 		if (rdmyrosec(fp, &sect) < 0)
 			return -1;
-		printf("[%2d]\t%s\t%016X\t%016X\t%02X\t%u\t%s\n",
+		printf(" [%2d]\t%s\t%016X\t%016X\t%02X\t%u\t%s\n",
 		       i,
 		       getstring(sect.name),
 		       sect.offset,
@@ -148,7 +148,7 @@
 	struct myrosym sym;
 
 	printf("symbols:\n"
-	       "[Nr]\t%s\t%-16s\t%s\t%s\t%s\n",
+	       " [Nr]\t%s\t%-16s\t%s\t%s\t%s\n",
 	       "Name",
 	       "Value",
 	       "Section",
@@ -158,7 +158,7 @@
 	for (i = 0; i < n; ++i) {
 		if (rdmyrosym(fp, &sym) < 0)
 			return -1;
-		printf("[%2u]\t%s\t%016X\t%u\t%s\t%s\n",
+		printf(" [%2u]\t%s\t%016X\t%u\t%s\t%s\n",
 		       i,
 		       getstring(sym.name),
 		       sym.offset,