[binutils-gdb/binutils-2_46-branch] PR 33835 readelf incorrect handling of DWARF5 CU DIE addr_base attribute

Alan Modra amodra@sourceware.org
Tue Jan 27 23:54:38 GMT 2026


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

commit 969d269178c8984da8580bd0bcc331b743d3c2b0
Author: Than McIntosh <thanm@golang.org>
Date:   Sun Jan 25 14:19:10 2026 +0000

    PR 33835 readelf incorrect handling of DWARF5 CU DIE addr_base attribute
    
    Users of "readelf" report problems running the tool's DWARF dump flag
    on binaries built with the most recent version of the Go compiler (1.25),
    Go bug report here https://github.com/golang/go/issues/77246
    
            dwarf.c (skip_attribute <DW_FORM_string>): Skip terminating NUL too.
    
    (cherry picked from commit a72b83ab3792532b66cc5c472a20476a8a2fd969)

Diff:
---
 binutils/dwarf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index b5e9917b5fc..a9cb88d5631 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -3745,7 +3745,7 @@ skip_attribute (unsigned long    form,
 			     dwarf_version);
 
     case DW_FORM_string:
-      inc = strnlen ((char *) data, end - data);
+      inc = strnlen ((char *) data, end - data) + 1;
       break;
     case DW_FORM_block:
     case DW_FORM_exprloc:


More information about the Binutils-cvs mailing list