Do not dump the contents of SHT_NOBITS sections - they have no file space
authorNick Clifton <nickc@redhat.com>
Thu, 30 Oct 2003 14:24:02 +0000 (14:24 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 30 Oct 2003 14:24:02 +0000 (14:24 +0000)
assigned to their contents.

binutils/ChangeLog
binutils/readelf.c

index 57055852d9d648659904e2976f170f91fd68d51b..4806e9ccf11742462f0ee2ea6bdfd8285e144478 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-30  Marshall T. Vandegrift <llasram at wuli dot nu>
+
+       * readelf.c (dump_section): Do not dump the contents of SHT_NOBITS
+       sections - they have no file space assigned to their contents.
+
 2003-10-28  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * readelf.c (dump_section): Don't display DEL characters.
index 629db76a7b3bd44f112e4f14b704226d7e36b68d..fb8d80f83739589368c3042465e756a8d481971f 100644 (file)
@@ -6055,7 +6055,7 @@ dump_section (Elf_Internal_Shdr *section, FILE *file)
 
   bytes = section->sh_size;
 
-  if (bytes == 0)
+  if (bytes == 0 || section->sh_type == SHT_NOBITS)
     {
       printf (_("\nSection '%s' has no data to dump.\n"),
              SECTION_NAME (section));