From patchwork Tue Mar 7 00:32:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Arsen_Arsenovi=C4=87?= X-Patchwork-Id: 66060 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 27690385B530 for ; Tue, 7 Mar 2023 00:34:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 27690385B530 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678149258; bh=WNKpon5EE5Y2azHfQOTvsTzxT6mdpntxBy4uHm7ST7s=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=FDacAkzQBknUi2GxK4MrcXOlZiCuG/0bIs54R3RFtk61Ug5YbtC8ASdNZ5yVj202X lhCVJ9MJQrSIWf7XL7CsRb084lzLYG6cF57Jmdpt+c7rMuwwfcG+eE+lL99ylFwJDU tlZ5SIXdBHMQ/+s+mmcfqnSr/4PG3clv0YVn7V7Y= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by sourceware.org (Postfix) with ESMTPS id A63B73858D39 for ; Tue, 7 Mar 2023 00:33:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A63B73858D39 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4PVxJX4gKXz9slb; Tue, 7 Mar 2023 01:33:48 +0100 (CET) To: libc-alpha@sourceware.org Cc: fweimer@redhat.com, arsen@gentoo.org, carlos@redhat.com, toolchain@gentoo.org Subject: [PATCH v2] elf: Add -z lazy to some more tests Date: Tue, 7 Mar 2023 01:32:22 +0100 Message-Id: <20230307003222.2810662-1-arsen@aarsen.me> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4PVxJX4gKXz9slb X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_INFOUSMEBIZ, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Arsen_Arsenovi=C4=87_via_Libc-alpha?= From: =?utf-8?q?Arsen_Arsenovi=C4=87?= Reply-To: =?utf-8?q?Arsen_Arsenovi=C4=87?= Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" From: Arsen Arsenović Some toolchains, such as that used on Gentoo Hardened, set '-z now' out of the box. This trips up a couple of tests. --- Evening, This is a re-roll of the following patch series: https://inbox.sourceware.org/libc-alpha/20230302112519.914641-1-arsen@gentoo.org/ Changes from v1: - Dropped -z norelro. This turned out to be unnecessary after Adhemervals removal of --with-default-link and linker script machinery: https://patchwork.sourceware.org/project/glibc/list/?series=17843 See: https://inbox.sourceware.org/libc-alpha/86fsakz5mr.fsf@gentoo.org for an explanation of what caused the need for norelro. That fix was misguided, due to a previous error on my part, too. I applied this patch on top of that patchset and it would appear to resolve all related failures. The above is not applied to Git yet, but should be before this patch is. elf/Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/elf/Makefile b/elf/Makefile index 0d19964d42..4d0e04b2a2 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -1190,6 +1190,11 @@ postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \ ifeq (yes,$(have-tunables)) $(eval $(call include_dsosort_tests,dso-sort-tests-1.def)) $(eval $(call include_dsosort_tests,dso-sort-tests-2.def)) + +# BZ15311 is intentionally underlinked. +LDFLAGS-tst-bz15311-b.so += -Wl,-z,lazy +LDFLAGS-tst-bz15311-c.so += -Wl,-z,lazy +LDFLAGS-tst-bz15311-d.so += -Wl,-z,lazy endif check-abi: $(objpfx)check-abi-ld.out \ @@ -1514,6 +1519,20 @@ LDFLAGS-tst-initorderb2.so = -Wl,--no-as-needed LDFLAGS-tst-tlsmod5.so = -nostdlib -Wl,--no-as-needed LDFLAGS-tst-tlsmod6.so = -nostdlib -Wl,--no-as-needed +# The following tests are underlinked, and rely on late loading. On toolchains +# that set -z now by default, this leads to failures to load or fix up the +# executables being tested. +LDFLAGS-circlemod2.so = -Wl,-z,lazy +LDFLAGS-tst-tls20mod-bad.so = -Wl,-z,lazy +LDFLAGS-reldep6mod1.so += -Wl,-z,lazy +LDFLAGS-constload2.so = -Wl,-z,lazy +LDFLAGS-constload3.so = -Wl,-z,lazy +LDFLAGS-dblloadmod3.so = -Wl,-z,lazy +LDFLAGS-ifuncmod6.so = -Wl,-z,lazy +LDFLAGS-ltglobmod2.so = -Wl,-z,lazy +LDFLAGS-testobj1.so = -Wl,-z,lazy +LDFLAGS-testobj6.so = -Wl,-z,lazy + testobj1.so-no-z-defs = yes testobj3.so-no-z-defs = yes testobj4.so-no-z-defs = yes @@ -1612,6 +1631,7 @@ $(objpfx)multiload.out: $(objpfx)testobj1.so LDFLAGS-origtest = -rdynamic $(objpfx)origtest.out: $(objpfx)testobj1.so +$(objpfx)resolvfail.out: $(objpfx)testobj1.so ifeq ($(have-thread-library),yes) $(objpfx)resolvfail: $(shared-thread-library) endif