Hans-Peter Nilsson <hp@bitrange.com>
authorNick Clifton <nickc@redhat.com>
Mon, 9 Aug 1999 17:16:23 +0000 (17:16 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 9 Aug 1999 17:16:23 +0000 (17:16 +0000)
* readelf.c (process_abbrev_section): Handle standard-conforming
single zero at the end of the section.

binutils/ChangeLog
binutils/readelf.c

index 4290857e0b6716d31b61bdb06c47a609b089dc3e..a7ec1bc2a692fdfdb3487f135568a05fd48ac28c 100644 (file)
@@ -1,3 +1,8 @@
+Thu Jul 15 22:44:21 1999  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * readelf.c (process_abbrev_section): Handle standard-conforming
+       single zero at the end of the section.
+
 1999-08-09  Ian Lance Taylor  <ian@zembu.com>
 
        * objdump.c (exit_status): New static variable.
index 266db752054513bbac8dbf343a639c8703482100..678c8f39a92593b48083feb8feb4f852d54afee9 100644 (file)
@@ -4790,8 +4790,11 @@ process_abbrev_section (start, end)
       entry = read_leb128 (start, & bytes_read, 0);
       start += bytes_read;
 
+      /* A single zero is supposed to end the section according
+        to the standard.  If there's more, then signal that to
+        the caller.  */
       if (entry == 0)
-       return start;
+       return start == end ? NULL : start;
 
       tag = read_leb128 (start, & bytes_read, 0);
       start += bytes_read;