From a3f779dbea39eb8d831ba6402b840793cfb79c87 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 9 Aug 1999 17:16:23 +0000 Subject: [PATCH] Hans-Peter Nilsson * readelf.c (process_abbrev_section): Handle standard-conforming single zero at the end of the section. --- binutils/ChangeLog | 5 +++++ binutils/readelf.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 4290857e0b6..a7ec1bc2a69 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 15 22:44:21 1999 Hans-Peter Nilsson + + * readelf.c (process_abbrev_section): Handle standard-conforming + single zero at the end of the section. + 1999-08-09 Ian Lance Taylor * objdump.c (exit_status): New static variable. diff --git a/binutils/readelf.c b/binutils/readelf.c index 266db752054..678c8f39a92 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -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; -- 2.30.2