This is the mail archive of the
mailing list for the binutils project.
Avoid spurious readelf error status from decode_arm_unwind
- From: Joseph Myers <joseph at codesourcery dot com>
- To: <binutils at sourceware dot org>
- Date: Wed, 4 Oct 2017 22:03:07 +0000
- Subject: Avoid spurious readelf error status from decode_arm_unwind
- Authentication-results: sourceware.org; auth=none
readelf.c:decode_arm_unwind has a variable res that is used as a
return value, with FALSE meaning unsuccessful and TRUE meaning
successful. This is initialized to FALSE (and then various code in
the function sets it to FALSE again on error), meaning that when the
function is successful, if it reaches returning res is still returns
FALSE, resulting eventually in exit status 1 from readelf without any
error message to indicate an error.
This patch fixes the initialization to use TRUE, so avoiding those
spurious errors. I don't have a self-contained test for this issue;
it was observed as many prelink tests failing without the patch and
passing with it.
2017-10-04 Joseph Myers <email@example.com>
* readelf.c (decode_arm_unwind): Initialize res to TRUE.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 260aedf..3991434 100644
@@ -8731,7 +8731,7 @@ decode_arm_unwind (struct arm_unw_aux_info * aux,
unsigned int more_words = 0;
struct absaddr addr;
bfd_vma sym_name = (bfd_vma) -1;
- bfd_boolean res = FALSE;
+ bfd_boolean res = TRUE;
if (remaining == 0)
Joseph S. Myers