From patchwork Thu May 5 13:58:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 53520 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 822CB384B0CB for ; Thu, 5 May 2022 14:01:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 822CB384B0CB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651759271; bh=3INzy7QVFBfC1wsKMLU1y5QP14MASxoyC4Dh9DShUCw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=jodx38la+sQr3qPS8ubd2GN0bD7+FlU+KblTEKObA9IoJ6RP8J4N7z7gY2hYvZvNu sKlYXmrxVbCP28I2iox4C80dARk6gwY4OI8TAS+s6vprA4h0XLJcH+umNzK9SxYTof SO6C2Y02mUZA4UxTVtS9oWok7cIDG0gqzQrAbhWA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70082.outbound.protection.outlook.com [40.107.7.82]) by sourceware.org (Postfix) with ESMTPS id 6E534384F01E for ; Thu, 5 May 2022 13:59:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6E534384F01E ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=mHK3bXQnJdcgWP4usxTd9ZkSiPhHNol1LNmgsL8sbM17yrHEa36zZ/2m6qFtpZgLA9OvYdYv3zSR9pGV0LFIBZ+Z6JgH6i3YJLaPY5dXBuvzf5QouQbZYVz8ytH//DW9DWyIPZnbOSHKxW2X3RodTi6dO4uQV+tBQgIPOAmGfVQ4TQ2pxADPpqOhYy2huMyBe6UnfKhfeQRKoRjKcpvMuV4x7jiupROL5yOe98/EspMO2b8DoCi3fv1UEfazJAnkNNhVhH+VJ1KywbvCl30cbnnZIppdO+M5n7U55tBQM7NsvRyDhZ4XRU4tL6YB95eOpROEa4BPHkibGnvohRvwyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3INzy7QVFBfC1wsKMLU1y5QP14MASxoyC4Dh9DShUCw=; b=X5hQ1XgPOYX29VjO07jDqjO/3weABEthcKd6THMiB+0NLD5T30F8a1r1liX8kYrcRqv3JDiE3FJNJz1y92uT8i468VaY4+ASCSK0bK7RecAxYGYBXyGD8MiU3ysggTejqRhoOWpq9MG3U9MWzz9+TtDSyIIIWgk5TmRWNDYVs/FtuZmkMaecPoT3k3o4wjQ6j10dXZEU+MVXHx6kmMo9vR258qME8qIqawfEH5ObpZ6AgjFuZ70ZxX2M01AbH/pcGO9Vn5JDtkl027p2WzQdZ2gD5Q9cJzlLh9lSF61MIvopnK5cl3xFNMhPV7AlNe45legPE8mbcEzJOTIEtdItbg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1, 1, smtp.mailfrom=arm.com] dmarc=[1, 1, header.from=arm.com]) Received: from DU2PR04CA0015.eurprd04.prod.outlook.com (2603:10a6:10:3b::20) by VE1PR08MB5263.eurprd08.prod.outlook.com (2603:10a6:803:116::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Thu, 5 May 2022 13:59:09 +0000 Received: from DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:3b:cafe::ba) by DU2PR04CA0015.outlook.office365.com (2603:10a6:10:3b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.27 via Frontend Transport; Thu, 5 May 2022 13:59:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT008.mail.protection.outlook.com (100.127.142.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.15 via Frontend Transport; Thu, 5 May 2022 13:59:08 +0000 Received: ("Tessian outbound 9511859e950a:v118"); Thu, 05 May 2022 13:59:08 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b7afec00be12cae5 X-CR-MTA-TID: 64aa7808 Received: from d37af081a25a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DC49563D-A526-40EE-B042-9CCA4D610FC9.1; Thu, 05 May 2022 13:59:01 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d37af081a25a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 05 May 2022 13:59:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jq6jSRlETa5zLdunwTA9zLZ1KPMKOUAiIX0OTSzkANwjLBfB9A0kKkduGcvl1HRwX8Ze9q05o/V+G7aCL2pwsbapjvG2OYKf6Cv/aZIGHicx3SMsvfbt5izTRyDb5/sO2zEDezADfVJudbxQvHZxsZrfFY1iWqvLX63dEItt4br2+eOPi/JYtuNfxDRSDKzGVaYR/1cSwPoE40P3xpFOTlVyie19643qUzGVKu4m2YxOqfrE0WdMA9Klq/rqcYAXv+MgKOds0zRcEkL2iEZJ0vQXFFLmHQ1EwfpkG8BQbh1OjbkanwuGcdjTDkGqhzwG/f55g6gxNVWv09jRvOASAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3INzy7QVFBfC1wsKMLU1y5QP14MASxoyC4Dh9DShUCw=; b=Ek0wjRTLF4mo+kPCec5xCSj+R6g3OL8mzw/eY9TKlX6T5vRtNZfB8EjBfAelaBqgSU5f/wmK0SCevnd57Xal9ZkSUbWnfZDjZbKsMyZaMfSRtvUOcwVW6XnFL58cgNz+sVzZJCb22DmCH/gjsRdeD6iGkuTbt43qYHvPY1VW9mkhL7vICX9BR1mGbFEfwRLzvDuXZAYpTHGOfagRBkPd/Feb3skPjY4YVS9FO74talr/vCgPvCJCGth/IK+Kiu+jgaBMhjTqmSF3OZKteVsa4PFzjZQRS2uHq2vv0RCwLo0d7naicPtmlZbUfhT21jldA3IQ/ofXTR/AOe5Qkxbp8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from AS9PR06CA0255.eurprd06.prod.outlook.com (2603:10a6:20b:45f::26) by AS8PR08MB7095.eurprd08.prod.outlook.com (2603:10a6:20b:402::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Thu, 5 May 2022 13:59:00 +0000 Received: from AM5EUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:45f:cafe::3e) by AS9PR06CA0255.outlook.office365.com (2603:10a6:20b:45f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.14 via Frontend Transport; Thu, 5 May 2022 13:59:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT050.mail.protection.outlook.com (10.152.17.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5227.15 via Frontend Transport; Thu, 5 May 2022 13:59:00 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 5 May 2022 13:59:03 +0000 Received: from armchair.cambridge.arm.com (10.2.80.71) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Thu, 5 May 2022 13:59:03 +0000 To: Subject: [PATCH v6 2/4] rtld: Remove DL_ARGV_NOT_RELRO and make _dl_skip_args const Date: Thu, 5 May 2022 14:58:59 +0100 Message-ID: <94c82dda28369de49a68e25ac606b828a2e4fd02.1651757640.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 3db43076-b3d0-4716-73cf-08da2e9f6ce8 X-MS-TrafficTypeDiagnostic: AS8PR08MB7095:EE_|DBAEUR03FT008:EE_|VE1PR08MB5263:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: VTyGycnsyXxF33lMqnut9VamE5x0p6OPdPM2j/WlVosUIE9p94VkQq28WPyUtl2zHN2b9On6tBV9nVUcl557STBV8SLD2Ilc5VhNICHIZv2FuOB2dX9J3WrjhzK/EIJ6xJ3jBHS2KxL5s7IPmcNCLaPd+wswIFUKEPqkZy+Z68bhvZ8Km1GyXwyww+csfMVDBD3w73AiseDG9ewoNG+REXUiIdLZlSNomPJqH+KdWVMTw3K/EpF6GRnKIfsU9scSCwIEJLioNNWG3yqUun3fW8s07WtbeGMDH77sqEX3BJ3Q+fCSvPbDscVxHquzkFxR7HB52A0qBB4YxXFROny52rZrOyNH3aJMLfy3zkN6Av2Y1E1dtedK8cl0V58Ao8wysTp1voQukR0Ip1iZ5ib3uvAXXOlh4edb9o2bCBoKeKVAwdsr+N+SCuP4dIFofCuMt9Woa+5DKMigtgyQXDxm9ApAKjssWrmbBs81+lyYfUJ51nwEFcspBWV1XPQz7ll9+GPlWRnpo4HILHoFrZ3eZXYePyqevpYwQlWjyuUhkAqvoqrm6g8rFJmaA50PbxLO91xtpCwM+88pTdce5WuwOSKMKpz6BaUrCXfaRlr4xK25nSf7uesK7+b6Qv1lxcMWl5HvC9d9CvK2i1gCaivIMTSeJv3ruixsJ7OkH69OPLl3KHzHqqT7cdMODwmEn3e41pkeaRqu62gknYjs8bG0MAEW7jfW9bGpOyK2NiuOczSVTJhKXclbwMvuUAcDFScCs6UcqI1wN1O2i/qw9NlH/K3cYOwC8zVfprAExAczp3vQ+7AqxDOZq4qr3AXPqJOi X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(83380400001)(6916009)(40460700003)(26005)(508600001)(8676002)(2906002)(36756003)(44832011)(82310400005)(70586007)(70206006)(316002)(8936002)(7696005)(4326008)(2616005)(356005)(6666004)(36860700001)(47076005)(336012)(426003)(30864003)(86362001)(5660300002)(81166007)(186003)(2004002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7095 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4dc04924-96a0-4f69-48c6-08da2e9f67de X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t2uFASj9HYZns7bzO5swJxn+UL312pTza31MMHZufjJMNkTpSRiprkf6qHRAYqV9Zy3wkl//Jx08qznJffg4gqhDhXlwm+9dRT9Kz0slQH4qgzHDQbUqjJgUNKvT0+W4W6hrt6QqexX9RyijswzzuWMaIfnRXgILoB2tTwAfhNwMoxS3SCvLSS7fPvfOZ7Bnb4g/WVUoP4EipdCT/FZpefL6o/HKvRuThCByTspV8KacL7SnhQiKTUAx6D2QFw1JE08jAV1Z5vVDWd56izaCLQXxvKKugU0gZBwcAgEc7BEz+RUPnZXQsOq+lQzELdjWnu/kEELi2Kuyn8ICP55k8tmbXzUdOuS3FRxGV3UGLWMLGjqNoOt7MlqRvHzaqbNwUr/JSrKCyXlVGt6vszB77E+njpGCbamEKVeTzuFZGWZloJp3fvC6rdK5q8xb1WwDGliifmKCeuZPd7jXLHZ9hC9odZhVoPJGAWK2+ki3wAhXnpY18/l9114/AxOtdhMlP6Un4VzBXQeIfJK/60l8PRSamgMNiOfq5Xv2chgR33WgyFnHTsHukPa5/PVdYuCSFlOdoNDqiH96vVx0IbVwUazOSkILqTz7amUNS/Hztj38uI6u3e9jHfYKZqup4T3sG39cyBaGEPSFmTmr1tRbUKcO5w1JYxTuSu+c9/P/QxxPFfaG9ENHcLHPzYEO8EKXpDB2zHDfRIyUG0n4KET0IyOnXXfqS/PYsmf43aDkHLt1h8k9FnoijAU79Ae9MlJ5A9sVjQ3NsdyJcgqhnS64c3jI/7j+hMOU4H0BkhQgWyI= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(86362001)(30864003)(36756003)(44832011)(5660300002)(8936002)(36860700001)(508600001)(2906002)(6666004)(82310400005)(7696005)(83380400001)(107886003)(2616005)(26005)(81166007)(336012)(47076005)(426003)(186003)(40460700003)(316002)(70586007)(70206006)(4326008)(8676002)(6916009)(2004002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2022 13:59:08.8197 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3db43076-b3d0-4716-73cf-08da2e9f6ce8 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5263 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_ASCII_DIVIDERS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Szabolcs Nagy via Libc-alpha From: Szabolcs Nagy Reply-To: Szabolcs Nagy Cc: Florian Weimer Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" _dl_skip_args is always 0, so the target specific code that modifies argv after relro protection is applied is no longer used. After the patch relro protection is applied to _dl_argv consistently on all targets. Reviewed-by: Adhemerval Zanella --- v6: - const _dl_skip_args. v4: - New patch. Reviewed-by: Florian Weimer Tested-by: Florian Weimer --- elf/rtld.c | 10 ++-------- sysdeps/aarch64/dl-sysdep.h | 4 ---- sysdeps/alpha/dl-sysdep.h | 23 ----------------------- sysdeps/arc/dl-sysdep.h | 4 ---- sysdeps/arm/dl-sysdep.h | 4 ---- sysdeps/csky/dl-sysdep.h | 23 ----------------------- sysdeps/generic/ldsodefs.h | 13 +++---------- sysdeps/ia64/dl-sysdep.h | 23 ----------------------- sysdeps/nios2/dl-sysdep.h | 4 ---- sysdeps/s390/s390-32/dl-sysdep.h | 23 ----------------------- sysdeps/sparc/dl-sysdep.h | 23 ----------------------- sysdeps/unix/sysv/linux/ia64/dl-sysdep.h | 4 ---- 12 files changed, 5 insertions(+), 153 deletions(-) delete mode 100644 sysdeps/alpha/dl-sysdep.h delete mode 100644 sysdeps/csky/dl-sysdep.h delete mode 100644 sysdeps/ia64/dl-sysdep.h delete mode 100644 sysdeps/s390/s390-32/dl-sysdep.h delete mode 100644 sysdeps/sparc/dl-sysdep.h diff --git a/elf/rtld.c b/elf/rtld.c index b5070d453f..71f7095def 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -157,16 +157,10 @@ static void dl_main_state_init (struct dl_main_state *state); extern char **_environ attribute_hidden; static void process_envvars (struct dl_main_state *state); -#ifdef DL_ARGV_NOT_RELRO -int _dl_argc attribute_hidden; -char **_dl_argv = NULL; -/* Nonzero if we were run directly. */ -unsigned int _dl_skip_args attribute_hidden; -#else int _dl_argc attribute_relro attribute_hidden; char **_dl_argv attribute_relro = NULL; -unsigned int _dl_skip_args attribute_relro attribute_hidden; -#endif +/* Always 0, only kept for not-yet-updated target start code. */ +const unsigned int _dl_skip_args attribute_hidden; rtld_hidden_data_def (_dl_argv) #ifndef THREAD_SET_STACK_GUARD diff --git a/sysdeps/aarch64/dl-sysdep.h b/sysdeps/aarch64/dl-sysdep.h index 667786671c..1516dd7d3f 100644 --- a/sysdeps/aarch64/dl-sysdep.h +++ b/sysdeps/aarch64/dl-sysdep.h @@ -18,8 +18,4 @@ #include_next -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 - #define DL_EXTERN_PROTECTED_DATA diff --git a/sysdeps/alpha/dl-sysdep.h b/sysdeps/alpha/dl-sysdep.h deleted file mode 100644 index 3099ee419f..0000000000 --- a/sysdeps/alpha/dl-sysdep.h +++ /dev/null @@ -1,23 +0,0 @@ -/* System-specific settings for dynamic linker code. Alpha version. - Copyright (C) 2002-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include_next - -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 diff --git a/sysdeps/arc/dl-sysdep.h b/sysdeps/arc/dl-sysdep.h index da060ceeee..cf4d160a73 100644 --- a/sysdeps/arc/dl-sysdep.h +++ b/sysdeps/arc/dl-sysdep.h @@ -18,8 +18,4 @@ #include_next -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 - #define DL_EXTERN_PROTECTED_DATA diff --git a/sysdeps/arm/dl-sysdep.h b/sysdeps/arm/dl-sysdep.h index ce7a84a7de..7a99107436 100644 --- a/sysdeps/arm/dl-sysdep.h +++ b/sysdeps/arm/dl-sysdep.h @@ -18,8 +18,4 @@ #include_next -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 - #define DL_EXTERN_PROTECTED_DATA diff --git a/sysdeps/csky/dl-sysdep.h b/sysdeps/csky/dl-sysdep.h deleted file mode 100644 index fc8a58b94c..0000000000 --- a/sysdeps/csky/dl-sysdep.h +++ /dev/null @@ -1,23 +0,0 @@ -/* System-specific settings for dynamic linker code. C-SKY version. - Copyright (C) 2018-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include_next - -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 4a5e698db2..f3d3c78927 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -762,18 +762,11 @@ rtld_hidden_proto (__libc_stack_end) /* Parameters passed to the dynamic linker. */ extern int _dl_argc attribute_hidden attribute_relro; -extern char **_dl_argv -#ifndef DL_ARGV_NOT_RELRO - attribute_relro -#endif - ; +extern char **_dl_argv attribute_relro; rtld_hidden_proto (_dl_argv) #if IS_IN (rtld) -extern unsigned int _dl_skip_args attribute_hidden -# ifndef DL_ARGV_NOT_RELRO - attribute_relro -# endif - ; +/* Always 0, only kept for not-yet-updated target start code. */ +extern const unsigned int _dl_skip_args attribute_hidden; #endif #define rtld_progname _dl_argv[0] diff --git a/sysdeps/ia64/dl-sysdep.h b/sysdeps/ia64/dl-sysdep.h deleted file mode 100644 index e3a58bec24..0000000000 --- a/sysdeps/ia64/dl-sysdep.h +++ /dev/null @@ -1,23 +0,0 @@ -/* System-specific settings for dynamic linker code. IA-64 version. - Copyright (C) 2002-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include_next - -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 diff --git a/sysdeps/nios2/dl-sysdep.h b/sysdeps/nios2/dl-sysdep.h index 0354650042..257b37c258 100644 --- a/sysdeps/nios2/dl-sysdep.h +++ b/sysdeps/nios2/dl-sysdep.h @@ -18,8 +18,4 @@ #include_next -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 - #define DL_EXTERN_PROTECTED_DATA diff --git a/sysdeps/s390/s390-32/dl-sysdep.h b/sysdeps/s390/s390-32/dl-sysdep.h deleted file mode 100644 index 699b50f156..0000000000 --- a/sysdeps/s390/s390-32/dl-sysdep.h +++ /dev/null @@ -1,23 +0,0 @@ -/* System-specific settings for dynamic linker code. S/390 version. - Copyright (C) 2014-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include_next - -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 diff --git a/sysdeps/sparc/dl-sysdep.h b/sysdeps/sparc/dl-sysdep.h deleted file mode 100644 index f32f16a107..0000000000 --- a/sysdeps/sparc/dl-sysdep.h +++ /dev/null @@ -1,23 +0,0 @@ -/* System-specific settings for dynamic linker code. SPARC version. - Copyright (C) 2002-2022 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include_next - -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 diff --git a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h index 0d2a1d093a..aa1de6b361 100644 --- a/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h +++ b/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h @@ -48,8 +48,4 @@ extern int _dl_sysinfo_break attribute_hidden; ".previous"); #endif -/* _dl_argv cannot be attribute_relro, because _dl_start_user - might write into it after _dl_start returns. */ -#define DL_ARGV_NOT_RELRO 1 - #endif /* dl-sysdep.h */