This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] readelf section names


Hi!

I find SHT_LOPROC+123456 section names inconsistent with other printed
section names which are typically stringified section type without the SHT_
prefix. Do you agree? It makes the output more readable too because there is
more space after section name.

2001-10-11  Jakub Jelinek  <jakub@redhat.com>

	* readelf.c (get_section_type_name): Don't print SHT_ prefix for
	LOPROC, LOOS and LOUSER.

--- binutils/readelf.c.jj	Fri Oct  5 13:03:01 2001
+++ binutils/readelf.c	Mon Oct  8 18:53:35 2001
@@ -1999,12 +1999,12 @@ get_section_type_name (sh_type)
 	  if (result != NULL)
 	    return result;
 
-	  sprintf (buff, "SHT_LOPROC+%x", sh_type - SHT_LOPROC);
+	  sprintf (buff, "LOPROC+%x", sh_type - SHT_LOPROC);
 	}
       else if ((sh_type >= SHT_LOOS) && (sh_type <= SHT_HIOS))
-	sprintf (buff, "SHT_LOOS+%x", sh_type - SHT_LOOS);
+	sprintf (buff, "LOOS+%x", sh_type - SHT_LOOS);
       else if ((sh_type >= SHT_LOUSER) && (sh_type <= SHT_HIUSER))
-	sprintf (buff, "SHT_LOUSER+%x", sh_type - SHT_LOUSER);
+	sprintf (buff, "LOUSER+%x", sh_type - SHT_LOUSER);
       else
 	sprintf (buff, _("<unknown>: %x"), sh_type);
 

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]