aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binutils/dwarf.c1
-rw-r--r--binutils/testsuite/binutils-all/readelf-debug-str-offsets-dw4.d14
-rw-r--r--binutils/testsuite/binutils-all/readelf-debug-str-offsets-dw4.s6
-rw-r--r--binutils/testsuite/binutils-all/readelf.exp1
4 files changed, 22 insertions, 0 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index c5ccc50..8125c64 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -7969,6 +7969,7 @@ display_debug_str_offsets (struct dwarf_section *section,
length = section->size;
curr = section->start;
entries_end = end;
+ debug_str_offsets_hdr_len = 0;
printf (_(" Length: %#" PRIx64 "\n"), length);
printf (_(" Index Offset [String]\n"));
diff --git a/binutils/testsuite/binutils-all/readelf-debug-str-offsets-dw4.d b/binutils/testsuite/binutils-all/readelf-debug-str-offsets-dw4.d
new file mode 100644
index 0000000..23581e7
--- /dev/null
+++ b/binutils/testsuite/binutils-all/readelf-debug-str-offsets-dw4.d
@@ -0,0 +1,14 @@
+#name: readelf -ws readelf-debug-str-offsets-dw4
+#source: readelf-debug-str-offsets-dw4.s
+#readelf: -ws
+
+Contents of the .debug_str.dwo section:
+
+ 0x00000000 46495253 54005345 434f4e44 00 FIRST.SECOND.
+
+Contents of the .debug_str_offsets.dwo section:
+
+ Length: 0x8
+ Index Offset \[String\]
+ 0 00000000 FIRST
+ 1 00000006 SECOND
diff --git a/binutils/testsuite/binutils-all/readelf-debug-str-offsets-dw4.s b/binutils/testsuite/binutils-all/readelf-debug-str-offsets-dw4.s
new file mode 100644
index 0000000..108f260
--- /dev/null
+++ b/binutils/testsuite/binutils-all/readelf-debug-str-offsets-dw4.s
@@ -0,0 +1,6 @@
+ .section .debug_str.dwo,"MS",%progbits,1
+ .asciz "FIRST"
+ .asciz "SECOND"
+ .section .debug_str_offsets.dwo,"MS",%progbits,1
+ .4byte 0
+ .4byte 6
diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 09ed75f..9f20cb4 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -402,6 +402,7 @@ if {[which $AS] != 0} then {
run_dump_test "retain1b"
run_dump_test "readelf-maskos-1a"
run_dump_test "readelf-maskos-1b"
+ run_dump_test "readelf-debug-str-offsets-dw4"
if {![istarget *-*-hpux*]} then {
run_dump_test pr26548
if {![binutils_assemble_flags $srcdir/$subdir/pr26548.s tmpdir/pr26548e.o {--defsym ERROR=1}]} then {