* readelf.c (get_section_type_name): When displaying an unknown
authorNick Clifton <nickc@redhat.com>
Wed, 29 Jun 2011 16:51:37 +0000 (16:51 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 29 Jun 2011 16:51:37 +0000 (16:51 +0000)
section type display the hex value first on the assumption that
the full message will probably be truncated into a 15 character
field.

binutils/ChangeLog
binutils/readelf.c

index edb87600c5412857a945bf32b6aeb19d8a23df80..69140c277022cecf0afa3329fa7d984e24fbf399 100644 (file)
@@ -1,3 +1,10 @@
+2011-06-29  Nick Clifton  <nickc@redhat.com>
+
+       * readelf.c (get_section_type_name): When displaying an unknown
+       section type display the hex value first on the assumption that
+       the full message will probably be truncated into a 15 character
+       field.
+
 2011-06-22  Jakub Jelinek  <jakub@redhat.com>
 
        * dwarf.c (decode_location_expression): For DW_OP_GNU_convert and
index 5a6521c54f9bed77e7b81a9d90dde854387b1114..c1bc2c5f8f40727dc2edcf091d04b961b0231d33 100644 (file)
@@ -3084,7 +3084,9 @@ get_section_type_name (unsigned int sh_type)
       else if ((sh_type >= SHT_LOUSER) && (sh_type <= SHT_HIUSER))
        sprintf (buff, "LOUSER+%x", sh_type - SHT_LOUSER);
       else
-       snprintf (buff, sizeof (buff), _("<unknown>: %x"), sh_type);
+       /* This message is probably going to be displayed in a 15
+          character wide field, so put the hex value first.  */
+       snprintf (buff, sizeof (buff), _("%08x: <unknown>"), sh_type);
 
       return buff;
     }