From: Sergei Trofimovich <slyich@gmail.com>
To: "Martin Liška" <mliska@suse.cz>, elfutils-devel@sourceware.org
Cc: Sergei Trofimovich <slyich@gmail.com>
Subject: [PATCH v2] tests: do not fail on zero sized DIEs (binutils-2.39 compatible)
Date: Sun, 7 Aug 2022 19:31:38 +0100 [thread overview]
Message-ID: <20220807183138.3567436-1-slyich@gmail.com> (raw)
In-Reply-To: <20220806085310.2603348-1-slyich@gmail.com>
binutils started producing 0-sized DIEs on functions interspersed
by nested sections (".section ...; .previous). This led to
run-low_high_pc.sh failure in form of:
FAIL: run-low_high_pc.sh
========================
[b] main.c
[2d] main
[b] ../sysdeps/i386/start.S
[26] _start
[40] ../sysdeps/x86/abi-note.c
[b52] init.c
[b8e] static-reloc.c
[2dba] _dl_relocate_static_pie
[2dd8] ../sysdeps/i386/crti.S
[2def] _init
lowpc: 8049000, highpc: 8049000lx
../sysdeps/i386/crti.S: [2def] '_init' highpc <= lowpc
FAIL run-low_high_pc.sh (exit status: 255)
To work it around let's allow lowpc == highpc special case.
https://sourceware.org/bugzilla/show_bug.cgi?id=29450
Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
---
tests/ChangeLog | 4 ++++
tests/low_high_pc.c | 8 +++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 0c6f68ef..59b4252a 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2022-08-07 Sergei Trofimovich <slyich@gmail.com>
+
+ * low_high_pc.c (handle_die): Allow zero sized DIEs for binutils-2.39.
+
2022-08-01 Mark Wielaard <mark@klomp.org>
* run-debuginfod-percent-escape.sh: Add initial scan wait_ready.
diff --git a/tests/low_high_pc.c b/tests/low_high_pc.c
index 78b6ad08..63268f4c 100644
--- a/tests/low_high_pc.c
+++ b/tests/low_high_pc.c
@@ -66,11 +66,13 @@ handle_die (Dwarf_Die *die, void *arg)
fail (off, name, "has DW_AT_high_pc but dwarf_highpc fails");
/* GCC < 4.7 had a bug where no code CUs got a highpc == lowpc.
- Allow that, because it is not the main purpose of this test. */
+ Allow that, because it is not the main purpose of this test.
+ gas-2.39 produces zero sized DIEs for subprograms sometimes:
+ https://sourceware.org/PR29451.
+ */
if (dwarf_hasattr (die, DW_AT_low_pc)
&& dwarf_hasattr (die, DW_AT_high_pc)
- && highpc <= lowpc
- && ! (dwarf_tag (die) == DW_TAG_compile_unit && highpc == lowpc))
+ && highpc < lowpc)
{
printf("lowpc: %" PRIx64 ", highpc: %" PRIx64 "lx\n", lowpc, highpc);
fail (off, name, "highpc <= lowpc");
--
2.37.1
next prev parent reply other threads:[~2022-08-07 18:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-06 8:53 [PATCH] " Sergei Trofimovich
2022-08-07 15:32 ` Martin Liška
2022-08-07 18:31 ` Sergei Trofimovich [this message]
2022-08-07 23:17 ` [PATCH v2] " Mark Wielaard
2022-10-13 14:40 ` Mark Wielaard
2022-10-13 18:13 ` Sergei Trofimovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220807183138.3567436-1-slyich@gmail.com \
--to=slyich@gmail.com \
--cc=elfutils-devel@sourceware.org \
--cc=mliska@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).