From patchwork Wed May 4 06:26:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 53443 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 D07B0385840C for ; Wed, 4 May 2022 06:28:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D07B0385840C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651645724; bh=3BIAq4Njp7cM4SYBnx0ZzKR4638cpgAiP7F6RB/K454=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gRAAixY9gvwh+/YhvPbqfKgK7JguZvTw50xMU+shFuohiFW62OqkODBT20kR6l+sp 7DSh25ADnN+JKnRMx4kHZ0eetK2VtBDWVQW/jNu03xf2FqtxAVF31VqH9Zd8YOi/F3 +r+GYzMEoKDcbn+NRf7yWag+Xyh4slwZz+L2TnJs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20085.outbound.protection.outlook.com [40.107.2.85]) by sourceware.org (Postfix) with ESMTPS id CEEC63858418 for ; Wed, 4 May 2022 06:27:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CEEC63858418 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=FjT3DPv0CqG4c5yI1lobFWD06pPPispSHvl/WZEuvpoyT0uAvUhhWrdar0RBkc8hf5IU99CFMhGFhgIswb+HG6Jt5SoKV4OwB2+0PjinGDLhExPMr9GbPD5ZDDqezjd6tc0PzoX79T5sC0/KU9/g94GF23a9AZ4Kb5cU3Pa9zibrAL9vUNo06xPmdcN0Brjmw529p1LfCNCHkbDxI4MAiY19fazWzIZX3A/gRZdZ+1utRL+bUeeU1iZ+lNsMFZ/UZ09BYU2xtAPLI4lEy9s9x7EBr5zbWlxUFklU2Uj4EVoViLQY1o0ILei+TRjgdODeaE8IH91fJRbSdCLOqbWMRA== 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=3BIAq4Njp7cM4SYBnx0ZzKR4638cpgAiP7F6RB/K454=; b=jd65LEvld7v0YxwkWaA2t8uGFMP4TYew3AWdgvBVuXfvQc8Tb+T597pit/4qO2tpU/9QLs1PzSMlKeeBIBU8+kOLgnUT5F2gnLOJ8NTcKknwjcNy/xMFvQPMh49bBFi4U3G6LoyQr/8C3d3F/P6RboCXJXKvb9agychQJWqCd0/soGJRBLXYyPPNlI/DV2a+dXQOa/7jqeeNf3GqEMzG584wDZVveaQTpLdyY+5Re9hRl4as7Zq0j0HEnEXR9owiRUI7JNBEvGXJ1kxmOH67iHPXxMGxUJ5HSJ4Ac9R87eLihx702e0X08zogBQ+6fmBnwe6490+XjQpForrxLEkyA== 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 AM6P195CA0090.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::31) by AM5PR0801MB1826.eurprd08.prod.outlook.com (2603:10a6:203:39::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Wed, 4 May 2022 06:27:04 +0000 Received: from VE1EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:86:cafe::eb) by AM6P195CA0090.outlook.office365.com (2603:10a6:209:86::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24 via Frontend Transport; Wed, 4 May 2022 06:27:04 +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 VE1EUR03FT055.mail.protection.outlook.com (10.152.19.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.15 via Frontend Transport; Wed, 4 May 2022 06:27:04 +0000 Received: ("Tessian outbound ab7864ef57f2:v118"); Wed, 04 May 2022 06:27:03 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 08e8598561a37663 X-CR-MTA-TID: 64aa7808 Received: from f5714ee4a5fc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 833477AF-74E3-4550-BA98-A97BD4A7CA32.1; Wed, 04 May 2022 06:26:58 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f5714ee4a5fc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 04 May 2022 06:26:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ws6okuHrVnLOCWeso9x2KXSrbZkXVAWOfIXGr9o8CCyqV9dA2F2EzmrKse56KfVbkClcw1t0V1nUn5Q28Y7daH3yGix1CQrnSp7Gwpr4vlKuJ1uYEWCXQJQwS12no7XuFg4gEAVYNBcrZrLMM+Mog168bZszm1baROXaK3l5A1kaUaUjXNcedLicij0VR/qLmSkrjNMGdPiXqyzGfc5CFKtuk11ysja6Gfrr1xlb13zQlPSjiFvRYoiGEAJqOHfaNB1N0ft+D20N+MLPSW4u3bRlqwl9UaFdGCwachqpwB90U8hBPXooPAOWeDQdczSrTbq/rpJqTIDyWa+aFzShRQ== 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=3BIAq4Njp7cM4SYBnx0ZzKR4638cpgAiP7F6RB/K454=; b=JLWl6zbRcUy1fPYhaERf1FmjyJoEB6T8v53EUXmfLIi2pkQTxWf3aA0MTiFf0l1Icdhbvmp8/WTG0sFTuuoeR+knJIwTjFLgkMK2Q52kbMN/OIgiEDFc6WLboZSS3ldtV3/ifTngbJBDyFdmAfxyUKiZ5JBC452Uy3L/sJtEgYdcf3lSvbSgzPbLLrAw8BAR8aqTAVT/BKnqGFK4NQeeXGvFgPU+qGXiJWkGYLvBN6qZIryzIBFqRDNIKD2uXgTJ7vAcYyX9BGhmEvOaYTfUCXP4xyHb8CQgcPIRvFCqWdAQRCeAWI9xChlWt7/eVa7Bxh2HuCn1RpHwW6L981kW5w== 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 DB6PR0802CA0042.eurprd08.prod.outlook.com (2603:10a6:4:a3::28) by PAXPR08MB6382.eurprd08.prod.outlook.com (2603:10a6:102:15b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Wed, 4 May 2022 06:26:56 +0000 Received: from DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:a3:cafe::db) by DB6PR0802CA0042.outlook.office365.com (2603:10a6:4:a3::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24 via Frontend Transport; Wed, 4 May 2022 06:26:55 +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 DBAEUR03FT052.mail.protection.outlook.com (100.127.142.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5227.15 via Frontend Transport; Wed, 4 May 2022 06:26:55 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.27; Wed, 4 May 2022 06:26:58 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.27; Wed, 4 May 2022 06:26:54 +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; Wed, 4 May 2022 06:26:58 +0000 To: Subject: [PATCH v4 2/4] rtld: Remove DL_ARGV_NOT_RELRO Date: Wed, 4 May 2022 07:26:54 +0100 Message-ID: <3e12f8fc7eb1050f90fae30b4f20357c638181e6.1651643916.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: 4537934f-3b54-4d0a-a2b4-08da2d971af5 X-MS-TrafficTypeDiagnostic: PAXPR08MB6382:EE_|VE1EUR03FT055:EE_|AM5PR0801MB1826: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: 6D+8fAWwWqcf2l/wOLNwfgGn15vlRECiTUXCmLUjypz/0PjAvmBA+s2jFGxIIfb3slD5iRLqMuz1VI80QfRViYds56qmpxSRRasa3S6a3fC7sX1XC5iuyseTsrPNWqUVtL7CpU/Yqay1jnmGKIIBymvVRuPO5m3DrhDOHM9ooIUkALBXCjVeJVyYZTO2qtiwQEBOkvTrMmDWB73erPqH2CzwMKTGgXUSslvYy9XP2nVicderiqIKPvr6w08jyLR0XvZagxLf9ZZ6PpxKv4Wmg5tom8bqPGihhDGxiNp7jt68ZehBEfxy9Ow5uLRrsaq1KkX2nmXmq9UZ1xtEgiwuYD3qrzPTH8C/duHmS50I5Y3EYzJtMkv8CfAWcPgDUA/wl2vYBRrrHjV1JXOifXam+ks92YOEAcFfR1bb04g5p9MSZji37pHRvFX8+WmGbuS07UTCMVXoQM9KSqhLilOX8Lb9lxl8w0f5hslOsdj5UjnSud/WSgpsd+UocEp3kBe30r7ukCK6fw7Yp04eXI8ul9zdBQdoQTkLxu4cd37WQ1bmwklD7ct5JUlA5NZHZ8R4DArZLy4DqrId4Tj+6mdZUG32WkiyNirdCDtA4ypbYCn51cxkitmdLpfAvFejhxlF/NX2IZVl/QfmPQcdKSWsG2W/zcYS3m3tt7XYkZ5s92m9OWVhx2n4zrkOTlwiYWufK6E3EzeBOIHtY4O6f0JptSQj3eNoPTid1DyA5VR6PvyL9/ImEpKlV39qMAMvXQepDyuYjBm125e4kj9mLrb12zu3/deu5QgNx186rNNBaZ40FoKVjsS8TCpnlsfkoGXc 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)(40470700004)(46966006)(36840700001)(82310400005)(7696005)(356005)(83380400001)(2616005)(70586007)(8676002)(86362001)(36860700001)(6666004)(70206006)(40460700003)(81166007)(36756003)(2906002)(336012)(47076005)(8936002)(186003)(316002)(5660300002)(426003)(508600001)(44832011)(30864003)(26005)(6916009)(2004002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6382 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a7340a9f-631b-4554-980c-08da2d97159f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iTF3N9oadr1u+uPwZFysSZHUHxy7f9pG56SD6iK3cgdFCVPV4pg63oq8zw5eUw3DyPK/WnLtHIBAJUiZkS8EjCU8YwSHw5DHqAHQjbBWUw0x0wrbb+u4FgLFDNLt9j42gCPoGDfguMFJIvqUd5aaRoh51V7hz1WD5zwuzMdnr3eXAVYSCiPwgia4KMOKPdt6Nifsv0BRg5PLs+ZY9AGzFV++aU8eZ/ITzmW7NWdRqZhf4BIUqAs3IJelR46wTeVBnjiJEo/N3064HWogKnO1WBMG+KRsicoEbxY3SI4g2kI/0ciTHxVNe/VEg5+9EI2VHYssEuojJ/VnI4BIZhG8HjyWN1U1EE9q4EzTdjJ/y4OHlyOmIEXAaE45y+fPzzKYjWC5XExGeEF/ygSRDrXUjVmOccBtHohXPbCLHbXPJ921qzyOfyySsUprZRKa36ZjYIMphTPrMjhtcBkozlpTDJCkeesrtdWwOolMgTlRYs2StH4M7jPN0zTk3VAoOdNK6R828pKt5zMbYucca4/SyzYU5zllIr8FXE2noc/OQ3xnwHiZN5+rr1cfULjlvkCcHWpI6Lzy0l+5YJL16ICX3cvb7NiyZOHET3NQK2s5mxo1iMRK84uAd9N4eI6hI0aVcfaFE9y04mu1dflzU1C/c9HW/yGdmaH41lduBFmOY7yzKW3BnrCZSR3ra/oB7nCaCUi2dFBQzBun/Kn1xpgtZ4kyAo4D2EQuM00Bi6KhnhWTVkzLX79dZcimdTe6DCRH1VHvALs2CfzEDHCATSD2Ueyq9u8YqfUIoz6dIMQX3e8= 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)(40470700004)(46966006)(186003)(44832011)(6916009)(36860700001)(36756003)(8676002)(30864003)(81166007)(40460700003)(5660300002)(316002)(6666004)(70586007)(47076005)(336012)(70206006)(83380400001)(8936002)(426003)(2906002)(508600001)(86362001)(7696005)(2616005)(26005)(82310400005)(2004002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2022 06:27:04.0557 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4537934f-3b54-4d0a-a2b4-08da2d971af5 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: VE1EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1826 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 Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This is no longer needed because _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: Florian Weimer Tested-by: Florian Weimer --- v4: - New patch. --- elf/rtld.c | 7 ------- 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 | 12 ++---------- 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, 2 insertions(+), 152 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 d959dab0d0..afff1b87fa 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -157,16 +157,9 @@ 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 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 31de149f23..e3c4d09bc6 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -762,18 +762,10 @@ 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 - ; +extern unsigned int _dl_skip_args attribute_hidden attribute_relro; #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 */