binutils: Run PR binutils/26160 test

Message ID CAMe9rOohVjin92PTeeiu_dvAtzYJn4dGtu5E=OxYfbyteraZWw@mail.gmail.com
State Accepted
Headers
Series binutils: Run PR binutils/26160 test |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

H.J. Lu Nov. 1, 2022, 12:08 a.m. UTC
  On Mon, Oct 31, 2022 at 4:04 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Mon, Oct 31, 2022 at 09:24:07AM -0700, H.J. Lu wrote:
> > Here is the patch to run the test.  But it failed with
> >
> > readelf: Warning: Cannot fetch indexed address: the .debug_addr
> > section is missing
> >
> > Is this warning valid?
>
> Well, yes, because according to https://gcc.gnu.org/wiki/DebugFission
> .debug_addr is found in the "linked binary".  I think the testcase is
> incomplete without that object file.

readelf output has been changed.   Here is the patch
to run PR binutils/26160 test.
  

Comments

Alan Modra Nov. 1, 2022, 12:25 a.m. UTC | #1
On Mon, Oct 31, 2022 at 05:08:04PM -0700, H.J. Lu wrote:
> On Mon, Oct 31, 2022 at 4:04 PM Alan Modra <amodra@gmail.com> wrote:
> >
> > On Mon, Oct 31, 2022 at 09:24:07AM -0700, H.J. Lu wrote:
> > > Here is the patch to run the test.  But it failed with
> > >
> > > readelf: Warning: Cannot fetch indexed address: the .debug_addr
> > > section is missing
> > >
> > > Is this warning valid?
> >
> > Well, yes, because according to https://gcc.gnu.org/wiki/DebugFission
> > .debug_addr is found in the "linked binary".  I think the testcase is
> > incomplete without that object file.
> 
> readelf output has been changed.   Here is the patch
> to run PR binutils/26160 test.

Can we please have the .o file too rather than accepting a warning?
That would better test readelf's handling of .dwp files.

Also, I think it would be nicer if the .dwp file was not compressed,
so that the test would run without bzip2 being installed.  It isn't
very large.
  
H.J. Lu Nov. 1, 2022, 1:02 a.m. UTC | #2
On Mon, Oct 31, 2022 at 5:25 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Mon, Oct 31, 2022 at 05:08:04PM -0700, H.J. Lu wrote:
> > On Mon, Oct 31, 2022 at 4:04 PM Alan Modra <amodra@gmail.com> wrote:
> > >
> > > On Mon, Oct 31, 2022 at 09:24:07AM -0700, H.J. Lu wrote:
> > > > Here is the patch to run the test.  But it failed with
> > > >
> > > > readelf: Warning: Cannot fetch indexed address: the .debug_addr
> > > > section is missing
> > > >
> > > > Is this warning valid?
> > >
> > > Well, yes, because according to https://gcc.gnu.org/wiki/DebugFission
> > > .debug_addr is found in the "linked binary".  I think the testcase is
> > > incomplete without that object file.
> >
> > readelf output has been changed.   Here is the patch
> > to run PR binutils/26160 test.
>
> Can we please have the .o file too rather than accepting a warning?
> That would better test readelf's handling of .dwp files.

The readelf input was generated by dwp which was the part of gold.
There is no .o file.

> Also, I think it would be nicer if the .dwp file was not compressed,
> so that the test would run without bzip2 being installed.  It isn't
> very large.
>

Since there are other binaries compressed with bzip2, the .dwp
file doesn't resolve this issue.
  
H.J. Lu Nov. 4, 2022, 11:47 p.m. UTC | #3
On Mon, Oct 31, 2022 at 6:02 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Mon, Oct 31, 2022 at 5:25 PM Alan Modra <amodra@gmail.com> wrote:
> >
> > On Mon, Oct 31, 2022 at 05:08:04PM -0700, H.J. Lu wrote:
> > > On Mon, Oct 31, 2022 at 4:04 PM Alan Modra <amodra@gmail.com> wrote:
> > > >
> > > > On Mon, Oct 31, 2022 at 09:24:07AM -0700, H.J. Lu wrote:
> > > > > Here is the patch to run the test.  But it failed with
> > > > >
> > > > > readelf: Warning: Cannot fetch indexed address: the .debug_addr
> > > > > section is missing
> > > > >
> > > > > Is this warning valid?
> > > >
> > > > Well, yes, because according to https://gcc.gnu.org/wiki/DebugFission
> > > > .debug_addr is found in the "linked binary".  I think the testcase is
> > > > incomplete without that object file.
> > >
> > > readelf output has been changed.   Here is the patch
> > > to run PR binutils/26160 test.
> >
> > Can we please have the .o file too rather than accepting a warning?
> > That would better test readelf's handling of .dwp files.
>
> The readelf input was generated by dwp which was the part of gold.
> There is no .o file.
>
> > Also, I think it would be nicer if the .dwp file was not compressed,
> > so that the test would run without bzip2 being installed.  It isn't
> > very large.
> >
>
> Since there are other binaries compressed with bzip2, the .dwp
> file doesn't resolve this issue.
>
> --
> H.J.

I am checking it in.
  

Patch

From 418f96c69a65a0f7929d830e566a1c5cbbfd23fe Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Mon, 31 Oct 2022 17:02:17 -0700
Subject: [PATCH] binutils: Run PR binutils/26160 test

Update expected PR binutils/26160 test output for readelf out change
and run PR binutils/26160 test.

	PR binutils/26160
	* testsuite/binutils-all/pr26160.r: Updated.
	* testsuite/binutils-all/readelf.exp: Run PR binutils/26160 test.
---
 binutils/testsuite/binutils-all/pr26160.r   | 123 +++++++++++++-------
 binutils/testsuite/binutils-all/readelf.exp |  12 ++
 2 files changed, 94 insertions(+), 41 deletions(-)

diff --git a/binutils/testsuite/binutils-all/pr26160.r b/binutils/testsuite/binutils-all/pr26160.r
index e8ec2adb119..ece5d44652a 100644
--- a/binutils/testsuite/binutils-all/pr26160.r
+++ b/binutils/testsuite/binutils-all/pr26160.r
@@ -30,13 +30,15 @@  Contents of the .debug_info.dwo section:
     <a5>   DW_AT_decl_file   : 1
     <a6>   DW_AT_decl_line   : 30
     <a7>   DW_AT_type        : <0x90>
-    <ab>   DW_AT_low_pc      : \(addr_index: (0x)?0\): <no .debug_addr section>
+    <ab>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: (0x)?0\): 0
     <ac>   DW_AT_high_pc     : 0x304
     <b4>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <b6>   DW_AT_GNU_all_tail_call_sites: 1
     <b6>   DW_AT_sibling     : <0x11b>
  <2><ba>: Abbrev Number: 14 \(DW_TAG_lexical_block\)
-    <bb>   DW_AT_low_pc      : \(addr_index: 0x1\): <no .debug_addr section>
+    <bb>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x1\): 0
     <bc>   DW_AT_high_pc     : 0x2fa
  <3><c4>: Abbrev Number: 15 \(DW_TAG_variable\)
     <c5>   DW_AT_name        : c1
@@ -56,7 +58,8 @@  Contents of the .debug_info.dwo section:
     <ff>   DW_AT_artificial  : 1
     <ff>   DW_AT_location    : 2 byte block: fb 2 	\(DW_OP_GNU_addr_index <0x2>\)
  <3><102>: Abbrev Number: 14 \(DW_TAG_lexical_block\)
-    <103>   DW_AT_low_pc      : \(addr_index: 0x3\): <no .debug_addr section>
+    <103>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x3\): 0
     <104>   DW_AT_high_pc     : 0x2f
  <4><10c>: Abbrev Number: 17 \(DW_TAG_variable\)
     <10d>   DW_AT_name        : i
@@ -274,7 +277,8 @@  Contents of the .debug_info.dwo section:
     <2dd>   DW_AT_decl_file   : 1
     <2de>   DW_AT_decl_line   : 70
     <2df>   DW_AT_linkage_name: _Z4f13iv
-    <2e8>   DW_AT_low_pc      : \(addr_index: (0x)?0\): <no .debug_addr section>
+    <2e8>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: (0x)?0\): 0
     <2e9>   DW_AT_high_pc     : 0x6
     <2f1>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <2f3>   DW_AT_GNU_all_call_sites: 1
@@ -282,7 +286,8 @@  Contents of the .debug_info.dwo section:
     <2f4>   DW_AT_specification: <0x219>
     <2f8>   DW_AT_decl_file   : 2
     <2f9>   DW_AT_decl_line   : 30
-    <2fa>   DW_AT_low_pc      : \(addr_index: 0x1\): <no .debug_addr section>
+    <2fa>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x1\): 0
     <2fb>   DW_AT_high_pc     : 0x20
     <303>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <305>   DW_AT_object_pointer: <0x30d>
@@ -300,7 +305,8 @@  Contents of the .debug_info.dwo section:
     <31d>   DW_AT_specification: <0x223>
     <321>   DW_AT_decl_file   : 2
     <322>   DW_AT_decl_line   : 38
-    <323>   DW_AT_low_pc      : \(addr_index: 0x2\): <no .debug_addr section>
+    <323>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x2\): 0
     <324>   DW_AT_high_pc     : 0x18
     <32c>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <32e>   DW_AT_object_pointer: <0x336>
@@ -316,7 +322,8 @@  Contents of the .debug_info.dwo section:
     <341>   DW_AT_specification: <0x22d>
     <345>   DW_AT_decl_file   : 2
     <346>   DW_AT_decl_line   : 46
-    <347>   DW_AT_low_pc      : \(addr_index: 0x3\): <no .debug_addr section>
+    <347>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x3\): 0
     <348>   DW_AT_high_pc     : 0x18
     <350>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <352>   DW_AT_object_pointer: <0x35a>
@@ -332,7 +339,8 @@  Contents of the .debug_info.dwo section:
     <365>   DW_AT_specification: <0x237>
     <369>   DW_AT_decl_file   : 2
     <36a>   DW_AT_decl_line   : 54
-    <36b>   DW_AT_low_pc      : \(addr_index: 0x4\): <no .debug_addr section>
+    <36b>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x4\): 0
     <36c>   DW_AT_high_pc     : 0x16
     <374>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <376>   DW_AT_object_pointer: <0x37e>
@@ -348,7 +356,8 @@  Contents of the .debug_info.dwo section:
     <389>   DW_AT_specification: <0x26b>
     <38d>   DW_AT_decl_file   : 2
     <38e>   DW_AT_decl_line   : 62
-    <38f>   DW_AT_low_pc      : \(addr_index: 0x5\): <no .debug_addr section>
+    <38f>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x5\): 0
     <390>   DW_AT_high_pc     : 0x16
     <398>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <39a>   DW_AT_object_pointer: <0x3a2>
@@ -366,7 +375,8 @@  Contents of the .debug_info.dwo section:
     <3b2>   DW_AT_specification: <0x275>
     <3b6>   DW_AT_decl_file   : 2
     <3b7>   DW_AT_decl_line   : 72
-    <3b8>   DW_AT_low_pc      : \(addr_index: 0x6\): <no .debug_addr section>
+    <3b8>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x6\): 0
     <3b9>   DW_AT_high_pc     : 0x1b
     <3c1>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <3c3>   DW_AT_object_pointer: <0x3cb>
@@ -382,7 +392,8 @@  Contents of the .debug_info.dwo section:
     <3d6>   DW_AT_specification: <0x27f>
     <3da>   DW_AT_decl_file   : 2
     <3db>   DW_AT_decl_line   : 82
-    <3dc>   DW_AT_low_pc      : \(addr_index: 0x7\): <no .debug_addr section>
+    <3dc>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x7\): 0
     <3dd>   DW_AT_high_pc     : 0x1b
     <3e5>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <3e7>   DW_AT_object_pointer: <0x3ef>
@@ -398,7 +409,8 @@  Contents of the .debug_info.dwo section:
     <3fa>   DW_AT_specification: <0x289>
     <3fe>   DW_AT_decl_file   : 2
     <3ff>   DW_AT_decl_line   : 92
-    <400>   DW_AT_low_pc      : \(addr_index: 0x8\): <no .debug_addr section>
+    <400>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x8\): 0
     <401>   DW_AT_high_pc     : 0x19
     <409>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <40b>   DW_AT_object_pointer: <0x413>
@@ -414,7 +426,8 @@  Contents of the .debug_info.dwo section:
     <41e>   DW_AT_specification: <0x2ae>
     <422>   DW_AT_decl_file   : 2
     <423>   DW_AT_decl_line   : 102
-    <424>   DW_AT_low_pc      : \(addr_index: 0x9\): <no .debug_addr section>
+    <424>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x9\): 0
     <425>   DW_AT_high_pc     : 0x19
     <42d>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <42f>   DW_AT_object_pointer: <0x437>
@@ -432,7 +445,8 @@  Contents of the .debug_info.dwo section:
     <447>   DW_AT_specification: <0x2b8>
     <44b>   DW_AT_decl_file   : 2
     <44c>   DW_AT_decl_line   : 112
-    <44d>   DW_AT_low_pc      : \(addr_index: 0xa\): <no .debug_addr section>
+    <44d>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0xa\): 0
     <44e>   DW_AT_high_pc     : 0x1f
     <456>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <458>   DW_AT_object_pointer: <0x460>
@@ -451,7 +465,8 @@  Contents of the .debug_info.dwo section:
     <471>   DW_AT_decl_line   : 120
     <472>   DW_AT_linkage_name: _Z4f11av
     <47b>   DW_AT_type        : <0x242>
-    <47f>   DW_AT_low_pc      : \(addr_index: 0xb\): <no .debug_addr section>
+    <47f>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0xb\): 0
     <480>   DW_AT_high_pc     : 0xb
     <488>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <48a>   DW_AT_GNU_all_call_sites: 1
@@ -459,7 +474,8 @@  Contents of the .debug_info.dwo section:
     <48b>   DW_AT_specification: <0x2c2>
     <48f>   DW_AT_decl_file   : 2
     <490>   DW_AT_decl_line   : 126
-    <491>   DW_AT_low_pc      : \(addr_index: 0xc\): <no .debug_addr section>
+    <491>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0xc\): 0
     <492>   DW_AT_high_pc     : 0x20
     <49a>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <49c>   DW_AT_object_pointer: <0x4a4>
@@ -478,7 +494,8 @@  Contents of the .debug_info.dwo section:
     <4b4>   DW_AT_decl_line   : 134
     <4b5>   DW_AT_linkage_name: _Z3t12v
     <4bd>   DW_AT_type        : <0x249>
-    <4c1>   DW_AT_low_pc      : \(addr_index: 0xd\): <no .debug_addr section>
+    <4c1>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0xd\): 0
     <4c2>   DW_AT_high_pc     : 0x19
     <4ca>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <4cc>   DW_AT_GNU_all_tail_call_sites: 1
@@ -489,7 +506,8 @@  Contents of the .debug_info.dwo section:
     <4d2>   DW_AT_decl_line   : 142
     <4d3>   DW_AT_linkage_name: _Z3t13v
     <4db>   DW_AT_type        : <0x249>
-    <4df>   DW_AT_low_pc      : \(addr_index: 0xe\): <no .debug_addr section>
+    <4df>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0xe\): 0
     <4e0>   DW_AT_high_pc     : 0x14
     <4e8>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <4ea>   DW_AT_GNU_all_tail_call_sites: 1
@@ -500,13 +518,15 @@  Contents of the .debug_info.dwo section:
     <4f0>   DW_AT_decl_line   : 150
     <4f1>   DW_AT_linkage_name: _Z3t14v
     <4f9>   DW_AT_type        : <0x249>
-    <4fd>   DW_AT_low_pc      : \(addr_index: 0xf\): <no .debug_addr section>
+    <4fd>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0xf\): 0
     <4fe>   DW_AT_high_pc     : 0x61
     <506>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <508>   DW_AT_GNU_all_tail_call_sites: 1
     <508>   DW_AT_sibling     : <0x532>
  <2><50c>: Abbrev Number: 24 \(DW_TAG_lexical_block\)
-    <50d>   DW_AT_low_pc      : \(addr_index: 0x10\): <no .debug_addr section>
+    <50d>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x10\): 0
     <50e>   DW_AT_high_pc     : 0x57
  <3><516>: Abbrev Number: 25 \(DW_TAG_variable\)
     <517>   DW_AT_name        : s1
@@ -538,13 +558,15 @@  Contents of the .debug_info.dwo section:
     <54b>   DW_AT_decl_line   : 163
     <54c>   DW_AT_linkage_name: _Z3t15v
     <554>   DW_AT_type        : <0x249>
-    <558>   DW_AT_low_pc      : \(addr_index: 0x11\): <no .debug_addr section>
+    <558>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x11\): 0
     <559>   DW_AT_high_pc     : 0x5d
     <561>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <563>   DW_AT_GNU_all_tail_call_sites: 1
     <563>   DW_AT_sibling     : <0x58d>
  <2><567>: Abbrev Number: 24 \(DW_TAG_lexical_block\)
-    <568>   DW_AT_low_pc      : \(addr_index: 0x12\): <no .debug_addr section>
+    <568>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x12\): 0
     <569>   DW_AT_high_pc     : 0x53
  <3><571>: Abbrev Number: 25 \(DW_TAG_variable\)
     <572>   DW_AT_name        : s1
@@ -576,7 +598,8 @@  Contents of the .debug_info.dwo section:
     <5a9>   DW_AT_decl_line   : 176
     <5aa>   DW_AT_linkage_name: _Z3t16v
     <5b2>   DW_AT_type        : <0x249>
-    <5b6>   DW_AT_low_pc      : \(addr_index: 0x13\): <no .debug_addr section>
+    <5b6>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x13\): 0
     <5b7>   DW_AT_high_pc     : 0x13
     <5bf>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <5c1>   DW_AT_GNU_all_tail_call_sites: 1
@@ -587,13 +610,15 @@  Contents of the .debug_info.dwo section:
     <5c7>   DW_AT_decl_line   : 184
     <5c8>   DW_AT_linkage_name: _Z3t17v
     <5d0>   DW_AT_type        : <0x249>
-    <5d4>   DW_AT_low_pc      : \(addr_index: 0x14\): <no .debug_addr section>
+    <5d4>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x14\): 0
     <5d5>   DW_AT_high_pc     : 0x5f
     <5dd>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <5df>   DW_AT_GNU_all_call_sites: 1
     <5df>   DW_AT_sibling     : <0x612>
  <2><5e3>: Abbrev Number: 24 \(DW_TAG_lexical_block\)
-    <5e4>   DW_AT_low_pc      : \(addr_index: 0x15\): <no .debug_addr section>
+    <5e4>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x15\): 0
     <5e5>   DW_AT_high_pc     : 0x59
  <3><5ed>: Abbrev Number: 25 \(DW_TAG_variable\)
     <5ee>   DW_AT_name        : c
@@ -602,7 +627,8 @@  Contents of the .debug_info.dwo section:
     <5f2>   DW_AT_type        : <0x53d>
     <5f6>   DW_AT_location    : 2 byte block: 91 6f 	\(DW_OP_fbreg: -17\)
  <3><5f9>: Abbrev Number: 24 \(DW_TAG_lexical_block\)
-    <5fa>   DW_AT_low_pc      : \(addr_index: 0x16\): <no .debug_addr section>
+    <5fa>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x16\): 0
     <5fb>   DW_AT_high_pc     : 0x50
  <4><603>: Abbrev Number: 25 \(DW_TAG_variable\)
     <604>   DW_AT_name        : i
@@ -620,13 +646,15 @@  Contents of the .debug_info.dwo section:
     <618>   DW_AT_decl_line   : 199
     <619>   DW_AT_linkage_name: _Z3t18v
     <621>   DW_AT_type        : <0x249>
-    <625>   DW_AT_low_pc      : \(addr_index: 0x17\): <no .debug_addr section>
+    <625>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x17\): 0
     <626>   DW_AT_high_pc     : 0x5f
     <62e>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <630>   DW_AT_GNU_all_tail_call_sites: 1
     <630>   DW_AT_sibling     : <0x67a>
  <2><634>: Abbrev Number: 24 \(DW_TAG_lexical_block\)
-    <635>   DW_AT_low_pc      : \(addr_index: 0x18\): <no .debug_addr section>
+    <635>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x18\): 0
     <636>   DW_AT_high_pc     : 0x55
  <3><63e>: Abbrev Number: 25 \(DW_TAG_variable\)
     <63f>   DW_AT_name        : c
@@ -635,7 +663,8 @@  Contents of the .debug_info.dwo section:
     <643>   DW_AT_type        : <0x53d>
     <647>   DW_AT_location    : 2 byte block: 91 6f 	\(DW_OP_fbreg: -17\)
  <3><64a>: Abbrev Number: 24 \(DW_TAG_lexical_block\)
-    <64b>   DW_AT_low_pc      : \(addr_index: 0x19\): <no .debug_addr section>
+    <64b>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x19\): 0
     <64c>   DW_AT_high_pc     : 0x4c
  <4><654>: Abbrev Number: 25 \(DW_TAG_variable\)
     <655>   DW_AT_name        : i
@@ -644,7 +673,8 @@  Contents of the .debug_info.dwo section:
     <659>   DW_AT_type        : <0x242>
     <65d>   DW_AT_location    : 2 byte block: 91 68 	\(DW_OP_fbreg: -24\)
  <4><660>: Abbrev Number: 24 \(DW_TAG_lexical_block\)
-    <661>   DW_AT_low_pc      : \(addr_index: 0x1a\): <no .debug_addr section>
+    <661>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x1a\): 0
     <662>   DW_AT_high_pc     : 0x34
  <5><66a>: Abbrev Number: 25 \(DW_TAG_variable\)
     <66b>   DW_AT_name        : s
@@ -786,7 +816,8 @@  Contents of the .debug_info.dwo section:
     <7d3>   DW_AT_decl_line   : 32
     <7d4>   DW_AT_linkage_name: _Z4t16av
     <7dd>   DW_AT_type        : <0x7c4>
-    <7e1>   DW_AT_low_pc      : \(addr_index: (0x)?0\): <no .debug_addr section>
+    <7e1>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: (0x)?0\): 0
     <7e2>   DW_AT_high_pc     : 0x13
     <7ea>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <7ec>   DW_AT_GNU_all_tail_call_sites: 1
@@ -878,14 +909,16 @@  Contents of the .debug_info.dwo section:
     <908>   DW_AT_decl_file   : 1
     <909>   DW_AT_decl_line   : 70
     <90a>   DW_AT_linkage_name: _Z4f13iv
-    <913>   DW_AT_low_pc      : \(addr_index: (0x)?0\): <no .debug_addr section>
+    <913>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: (0x)?0\): 0
     <914>   DW_AT_high_pc     : 0x6
     <91c>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <91e>   DW_AT_GNU_all_call_sites: 1
  <1><91e>: Abbrev Number: 17 \(DW_TAG_subprogram\)
     <91f>   DW_AT_specification: <0x8a8>
     <923>   DW_AT_decl_file   : 2
-    <924>   DW_AT_low_pc      : \(addr_index: 0x1\): <no .debug_addr section>
+    <924>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x1\): 0
     <925>   DW_AT_high_pc     : 0xf
     <92d>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <92f>   DW_AT_object_pointer: <0x937>
@@ -903,7 +936,8 @@  Contents of the .debug_info.dwo section:
     <94b>   DW_AT_specification: <0x89b>
     <94f>   DW_AT_decl_file   : 2
     <950>   DW_AT_decl_line   : 36
-    <951>   DW_AT_low_pc      : \(addr_index: 0x2\): <no .debug_addr section>
+    <951>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x2\): 0
     <952>   DW_AT_high_pc     : 0x20
     <95a>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <95c>   DW_AT_object_pointer: <0x964>
@@ -922,7 +956,8 @@  Contents of the .debug_info.dwo section:
     <978>   DW_AT_decl_line   : 72
     <979>   DW_AT_linkage_name: _Z3f10v
     <981>   DW_AT_type        : <0x8b7>
-    <985>   DW_AT_low_pc      : \(addr_index: 0x3\): <no .debug_addr section>
+    <985>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x3\): 0
     <986>   DW_AT_high_pc     : 0xb
     <98e>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <990>   DW_AT_GNU_all_call_sites: 1
@@ -933,7 +968,8 @@  Contents of the .debug_info.dwo section:
     <997>   DW_AT_decl_line   : 80
     <998>   DW_AT_linkage_name: _Z4f11bPFivE
     <9a5>   DW_AT_type        : <0x8b7>
-    <9a9>   DW_AT_low_pc      : \(addr_index: 0x4\): <no .debug_addr section>
+    <9a9>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x4\): 0
     <9aa>   DW_AT_high_pc     : 0x14
     <9b2>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <9b4>   DW_AT_GNU_all_tail_call_sites: 1
@@ -954,7 +990,8 @@  Contents of the .debug_info.dwo section:
     <9d3>   DW_AT_specification: <0x8e0>
     <9d7>   DW_AT_decl_file   : 2
     <9d8>   DW_AT_decl_line   : 88
-    <9d9>   DW_AT_low_pc      : \(addr_index: 0x5\): <no .debug_addr section>
+    <9d9>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x5\): 0
     <9da>   DW_AT_high_pc     : 0xf
     <9e2>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <9e4>   DW_AT_object_pointer: <0x9ec>
@@ -976,7 +1013,8 @@  Contents of the .debug_info.dwo section:
     <a06>   DW_AT_decl_line   : 96
     <a07>   DW_AT_linkage_name: _Z3f13v
     <a0f>   DW_AT_type        : <0xa1e>
-    <a13>   DW_AT_low_pc      : \(addr_index: 0x6\): <no .debug_addr section>
+    <a13>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x6\): 0
     <a14>   DW_AT_high_pc     : 0xb
     <a1c>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <a1e>   DW_AT_GNU_all_call_sites: 1
@@ -990,7 +1028,8 @@  Contents of the .debug_info.dwo section:
     <a2a>   DW_AT_decl_line   : 104
     <a2b>   DW_AT_linkage_name: _Z3f14v
     <a33>   DW_AT_type        : <0xa42>
-    <a37>   DW_AT_low_pc      : \(addr_index: 0x7\): <no .debug_addr section>
+    <a37>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x7\): 0
     <a38>   DW_AT_high_pc     : 0xb
     <a40>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <a42>   DW_AT_GNU_all_call_sites: 1
@@ -1010,7 +1049,8 @@  Contents of the .debug_info.dwo section:
     <a5b>   DW_AT_decl_line   : 112
     <a5c>   DW_AT_linkage_name: _Z3f15v
     <a64>   DW_AT_type        : <0xa73>
-    <a68>   DW_AT_low_pc      : \(addr_index: 0x8\): <no .debug_addr section>
+    <a68>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x8\): 0
     <a69>   DW_AT_high_pc     : 0xb
     <a71>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <a73>   DW_AT_GNU_all_call_sites: 1
@@ -1030,7 +1070,8 @@  Contents of the .debug_info.dwo section:
     <a8f>   DW_AT_decl_line   : 127
     <a90>   DW_AT_linkage_name: _Z3f18i
     <a98>   DW_AT_type        : <0xa42>
-    <a9c>   DW_AT_low_pc      : \(addr_index: 0x9\): <no .debug_addr section>
+    <a9c>   DW_AT_low_pc      :readelf: Warning: Cannot fetch indexed address: the .debug_addr section is missing
+ \(index: 0x9\): 0
     <a9d>   DW_AT_high_pc     : 0x44
     <aa5>   DW_AT_frame_base  : 1 byte block: 9c 	\(DW_OP_call_frame_cfa\)
     <aa7>   DW_AT_GNU_all_call_sites: 1
diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 210ed83f1b4..d7f1524fc5c 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -597,6 +597,18 @@  if ![is_remote host] {
     } else {
 	readelf_test {--debug-dump=macro -wN} $tempfile pr26112.r
     }
+
+    set test $srcdir/$subdir/pr26160.dwp.bz2
+    # We need to strip the ".bz2", but can leave the dirname.
+    set t $subdir/[file tail $test]
+    set testname [file rootname $t]
+    verbose $testname
+    set tempfile tmpdir/pr26160.dwp
+    if {[catch "system \"bzip2 -dc $test > $tempfile\""] != 0} {
+	untested "bzip2 -dc ($testname)"
+    } else {
+	readelf_test {-wi} $tempfile pr26160.r
+    }
 }
 
 # Check dwarf-5 support for DW_OP_addrx.
-- 
2.37.3