From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id EC0EF385800E for ; Sun, 7 Aug 2022 18:31:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EC0EF385800E Received: by mail-wr1-x431.google.com with SMTP id z12so8591422wrs.9 for ; Sun, 07 Aug 2022 11:31:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=XAn5N1fMLPZeRfwflcaC/OrL3OZ6WEzGv6Eqj/kmxRs=; b=48rm5w7YhA1h6L5bfeDVn83jqU40ipMc3xqqMrSJvOhaSmBsXuiFr5XIk0HkG8csZW dF1FzP7bCqPE/TaLDmOK/52vjE+3m/jNRHCrof2MmBYbJ+s+nay+QWPjb80f8ion00EW 2byrSc6k5Lpg9dzpBECHb+7IAHRSPVAPXUuEn97RFg/nrD2JvbB8YcOu3ixx6qZSiI16 orM7k6HxrS9tEXraP/WqqrWm08tbbVvggdC7rg/sLGgFg4UkcmE5o/yDodtu3dmYLmrg yRXy5sY3L0QD5eqn2ofk/K36YRGSnVQSmA/V5Y7ygz0NO7eyadSIGe7lBAP66gCtt1rS uI9w== X-Gm-Message-State: ACgBeo2iwX10GTXsaTIWDyQ3HOmFVLxXj09LCKqGpQikqA331AOUhjzY CAYpS4tbLBkArKdoVnIvGSs= X-Google-Smtp-Source: AA6agR4UjuknFDeNO3ETsw/kvSBpi4YNhr6Ko+UI0Xsz6aznvB1+e0PMhS7RKQ7+bsnrG3dpLN8hUA== X-Received: by 2002:adf:f7c7:0:b0:21e:fc10:b81b with SMTP id a7-20020adff7c7000000b0021efc10b81bmr9922679wrq.51.1659897101526; Sun, 07 Aug 2022 11:31:41 -0700 (PDT) Received: from nz.home (host81-129-83-151.range81-129.btcentralplus.com. [81.129.83.151]) by smtp.gmail.com with ESMTPSA id q10-20020adff94a000000b0021d80f53324sm9660811wrr.7.2022.08.07.11.31.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Aug 2022 11:31:41 -0700 (PDT) Received: by nz.home (Postfix, from userid 1000) id 5D61D6307BDFB; Sun, 7 Aug 2022 19:31:40 +0100 (BST) From: Sergei Trofimovich To: =?UTF-8?q?Martin=20Li=C5=A1ka?= , elfutils-devel@sourceware.org Cc: Sergei Trofimovich Subject: [PATCH v2] tests: do not fail on zero sized DIEs (binutils-2.39 compatible) Date: Sun, 7 Aug 2022 19:31:38 +0100 Message-Id: <20220807183138.3567436-1-slyich@gmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220806085310.2603348-1-slyich@gmail.com> References: <20220806085310.2603348-1-slyich@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2022 18:31:44 -0000 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 --- 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 + + * low_high_pc.c (handle_die): Allow zero sized DIEs for binutils-2.39. + 2022-08-01 Mark Wielaard * 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