[binutils-gdb] PR 33701, abort in byte_get_little_endian

Alan Modra amodra@sourceware.org
Mon Dec 8 09:25:15 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=44b79abd0fa12e7947252eb4c6e5d16ed6033e01

commit 44b79abd0fa12e7947252eb4c6e5d16ed6033e01
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Dec 8 16:04:44 2025 +1030

    PR 33701, abort in byte_get_little_endian
    
            PR 33701
            * dwarf.c (process_debug_info): Set debug_info_p NULL when
            DEBUG_INFO_UNAVAILABLE.

Diff:
---
 binutils/dwarf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index e610d4235da..c5ceaa9a4fd 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -4317,9 +4317,11 @@ process_debug_info (struct dwarf_section * section,
 	      break;
 	    }
 
-	  debug_info *debug_info_p = ((debug_information
-				       && unit < alloc_num_debug_info_entries)
-				      ? debug_information + unit : NULL);
+	  debug_info *debug_info_p = NULL;
+	  if (debug_information
+	      && num_debug_info_entries != DEBUG_INFO_UNAVAILABLE
+	      && unit < alloc_num_debug_info_entries)
+	    debug_info_p = debug_information + unit;
 
 	  assert (!debug_info_p
 		  || (debug_info_p->num_loc_offsets


More information about the Binutils-cvs mailing list