From 50ea0877550b5fc2c31a44576cdba1b51897eb2c Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 13 Nov 2020 16:02:39 +0000 Subject: Fix readelf's and objdump's dislplay of DWO links when multiple links are present. PR 26829 * dwarf.c (struct dwo_info): Add cu_offset field. (add_dwo_info): Add cu_offset parameter. Record in new dwo_info struct. (add_dwo_name): Add cu_offset field. (add_dwo_dir): Add cu_offset field. (add_dwo_id): Add cu_offset field. (read_and_display_attr_value): Pass cu_offset to dwo recording functions. (load_separate_debug_files): Accumulate name, dir and id values and display once for each CU. * testsuite/binutils-all/dwo.sL Use a separate CU for the second dwo link. * testsuite/binutils-all/readelf.k2: Update expected output. --- binutils/testsuite/binutils-all/dwo.s | 13 ++++++++++--- binutils/testsuite/binutils-all/readelf.k2 | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'binutils/testsuite') diff --git a/binutils/testsuite/binutils-all/dwo.s b/binutils/testsuite/binutils-all/dwo.s index 5c37c42..96db129 100644 --- a/binutils/testsuite/binutils-all/dwo.s +++ b/binutils/testsuite/binutils-all/dwo.s @@ -34,8 +34,8 @@ string_end: /* Create a .debug_info section that contains the dwo links. */ .section .debug_info,"",%progbits - .4byte debugE - debugS ;# Length of Compilation Unit Info -debugS: + .4byte debugE1 - debugS1 ;# Length of Compilation Unit Info +debugS1: .short 0x4 ;# DWARF version number. .4byte 0x0 ;# Offset into .debug_abbrev section. .byte 0x4 ;# Pointer Size (in bytes). @@ -43,6 +43,13 @@ debugS: .uleb128 0x1 ;# Use abbrev #1. This needs strings from the .debug_str section. .4byte string1 .4byte string2 +debugE1: + + .4byte debugE2 - debugS2 ;# Length of Compilation Unit Info +debugS2: + .short 0x4 ;# DWARF version number. + .4byte 0x0 ;# Offset into .debug_abbrev section. + .byte 0x4 ;# Pointer Size (in bytes). .uleb128 0x2 ;# Use abbrev #2. .asciz "file.dwo" @@ -52,7 +59,7 @@ debugS: ;# Minimal section alignment on alpha-* is 2, so ensure no new invalid CU ;# will be started. .balign 2, 0 -debugE: +debugE2: .section .debug_abbrev,"",%progbits diff --git a/binutils/testsuite/binutils-all/readelf.k2 b/binutils/testsuite/binutils-all/readelf.k2 index e2ea0ad..1ca9ef4 100644 --- a/binutils/testsuite/binutils-all/readelf.k2 +++ b/binutils/testsuite/binutils-all/readelf.k2 @@ -6,4 +6,4 @@ The \.debug_info section contains link\(s\) to dwo file\(s\): Name: debugfile\.dwo Directory: /path/to/dwo/files - ID: (12|dd) (34|cc) (56|bb) (78|aa) (78|aa) (56|bb) (34|cc) (12|dd) + ID: -- cgit v1.1