Avoid spurious readelf error status from decode_arm_unwind.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 5 Oct 2017 14:19:39 +0000 (14:19 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 5 Oct 2017 14:19:39 +0000 (14:19 +0000)
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.

* readelf.c (decode_arm_unwind): Initialize res to TRUE.

binutils/ChangeLog
binutils/readelf.c

index 4daa60e37e1173d8277a33c5da74d32ab158da36..4fb4eb464a107a3e157e65859d76038765124d42 100644 (file)
@@ -1,3 +1,7 @@
+2017-10-05  Joseph Myers  <joseph@codesourcery.com>
+
+       * readelf.c (decode_arm_unwind): Initialize res to TRUE.
+
 2017-10-05  Nick Clifton  <nickc@redhat.com>
 
        PR 22260
index 3cdde6c3cf81276d1af39e5dc1ee055799666135..22d60e9a7f855a9216aef6908d0dffc54d4cf9e0 100644 (file)
@@ -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)
     {
This page took 0.035223 seconds and 4 git commands to generate.