aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-11-13 16:02:39 +0000
committerNick Clifton <nickc@redhat.com>2020-11-13 16:02:39 +0000
commit50ea0877550b5fc2c31a44576cdba1b51897eb2c (patch)
tree7a33ac1022b30062a55fa3116676fbb16eb590c7 /binutils/testsuite
parent5a7cf52794e4284a9ab7ea1a8b6c6ae8de94a276 (diff)
downloadbinutils-50ea0877550b5fc2c31a44576cdba1b51897eb2c.zip
binutils-50ea0877550b5fc2c31a44576cdba1b51897eb2c.tar.gz
binutils-50ea0877550b5fc2c31a44576cdba1b51897eb2c.tar.bz2
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.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/binutils-all/dwo.s13
-rw-r--r--binutils/testsuite/binutils-all/readelf.k22
2 files changed, 11 insertions, 4 deletions
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: <not specified>