This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Fix snafu with booleans in readelf patch - lack of a program header is not a reason for a function t
- From: Nick Clifton <nickc at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 24 Feb 2017 18:15:54 -0000
- Subject: [binutils-gdb] Fix snafu with booleans in readelf patch - lack of a program header is not a reason for a function t
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6b4bf3bc355bea57be3c0f6f61008a23b9067a11
commit 6b4bf3bc355bea57be3c0f6f61008a23b9067a11
Author: Nick Clifton <nickc@redhat.com>
Date: Fri Feb 24 18:15:12 2017 +0000
Fix snafu with booleans in readelf patch - lack of a program header is not a reason for a function to return false.
(process_program_headers): Fix snafu - if the program headers are
not available then this is not a cause to fail.
(process_corefile_note_segments): Likewise.
Diff:
---
binutils/ChangeLog | 3 +++
binutils/readelf.c | 7 ++++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 40f58e4..2004902 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -73,6 +73,9 @@
(process_object): Reverse the logic of the return value.
(process_archive): Likewise.
(process_file): Likewise.
+ (process_program_headers): Fix snafu - if the program headers are
+ not available then this is not a cause to fail.
+ (process_corefile_note_segments): Likewise.
2017-02-24 Maciej W. Rozycki <macro@imgtec.com>
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 3b60cf9..60694ff 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -4813,7 +4813,7 @@ process_program_headers (FILE * file)
}
if (! get_program_headers (file))
- return FALSE;
+ return TRUE;
if (do_segments)
{
@@ -16618,7 +16618,8 @@ process_notes_at (FILE * file,
inote.namedata = temp;
}
- res &= process_note (& inote, file, section);
+ if (! process_note (& inote, file, section))
+ res = FALSE;
if (temp != NULL)
{
@@ -16640,7 +16641,7 @@ process_corefile_note_segments (FILE * file)
bfd_boolean res = TRUE;
if (! get_program_headers (file))
- return FALSE;
+ return TRUE;
for (i = 0, segment = program_headers;
i < elf_header.e_phnum;