]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR 33835 readelf incorrect handling of DWARF5 CU DIE addr_base attribute
authorThan McIntosh <thanm@golang.org>
Sun, 25 Jan 2026 14:19:10 +0000 (14:19 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 26 Jan 2026 01:15:27 +0000 (11:45 +1030)
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.

binutils/dwarf.c

index b5e9917b5fc49c63560632b77773272db4c472e4..a9cb88d563109ffb2eb53a50dfef4cd6c6911b65 100644 (file)
@@ -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: