Message ID | 20210625155012.4aec8450@xhacker.debian |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1203656jao; Fri, 25 Jun 2021 00:57:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzR2EHQMvwjtakG+SC4mdvN8q2xD0e+ldWRHeLFYRhLSl4hvzuCliWait5JskeG8fPKtTtA X-Received: by 2002:a17:907:3f03:: with SMTP id hq3mr9177508ejc.436.1624607841235; Fri, 25 Jun 2021 00:57:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624607841; cv=pass; d=google.com; s=arc-20160816; b=rsOmww+/bwOvoo1Ae1ZDeM8gUqVChijO6b4MSK/knkrcgH/HODaMwwgNeoEHbIj7U2 DF8R943npSBDMtasVfGNqLC8CLbJAwGriRm2YGayy6x9dTSALMTGV3PV2cZjRdetAiN4 muN8JDVfR8kOxqAMMpgqNrAplmJRQyH9v8iZ7whioo9cXyLjxPK2AjIxpxmDSAtnZTvG abGy6C5bn47WETIsu+V871FEswNT3rzGcjEMxXyyEaNoJmaGKo4aP6i/nhkEJ94pufHk XhkmqxCMxnkgl9ze9SiokYwFvSffL3bDsIu4IXCe8onj2kaOnlVgptYmGo5f6jmPujTW EGMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ntAtTCMcbHSjuDHVGPGm1FRLN0bmiJDw3df60Y/3c3o=; b=P3gQooY8JzT+kPxDll56DFC9vJMt0j3YFJTqgFVgdc45Nu90mLr5CpSsYmK8XDlfLH BjpNIiBQgPZIvuKLk2539JspuNq0ZI0b6zRW4IwSD1CiwEr9f9j6b2o3Q69y5BLSIvPD 2B6VRgi9Bcz429x0Hu0ovMueNL36wBA/FVWRXmw4n3lFTLuXtdgLZcYnKEj0cZKBTk77 2XKInZ/Cx5UQkhb5JM2VlHUHCZfzRD8Oz5QeG8HQtcigHqKGOKKNGio481yckKuj9zUI 3MCtd97952gb+H87LSdF3Xx8Q9I1jAqrHw1t7VcFvuPe1NFgH4Y1h7eI5ILqm8VFttZh rNVA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b=VOxLsZlx; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.com); spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synaptics.com Return-Path: <stable-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dq7si3753932ejc.675.2021.06.25.00.57.20; Fri, 25 Jun 2021 00:57:21 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b=VOxLsZlx; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.com); spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synaptics.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229474AbhFYH7k (ORCPT <rfc822;semen.protsenko@linaro.org> + 12 others); Fri, 25 Jun 2021 03:59:40 -0400 Received: from mail-bn8nam12on2089.outbound.protection.outlook.com ([40.107.237.89]:63905 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229454AbhFYH7j (ORCPT <rfc822;stable@vger.kernel.org>); Fri, 25 Jun 2021 03:59:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OgeOMtT2or774+unO0zvKKs+YU0d6wonFbqPZsE7AFfSBtUrJoTdlK6lU/+DXlJXQDRQaZzoEo91qM9WBSKeF69mhMLxi0Jk7Lh/ft1oNqaInSO/ticAgzYvXktryFZZcH+qv1xsHgpONeBcq7zOtT1fZHwWRgAwy0YtMQQyfIDGWxu0WytHMfI1sILuSW0jNo/h7QDBv0TUxSP9dX2xnVUCVHcmUw+V0kdSMJg4ddKm/950P5PsUd5Bl/4NCzP0beZLj3v5kPpmdMAMFYzUcI4gKe8ZRZVCWBxuNBquIlEvvVmUr/i0U3hS4LLDbdIW6QGdPv3NrqLAVKhdmId4AA== 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-SenderADCheck; bh=ntAtTCMcbHSjuDHVGPGm1FRLN0bmiJDw3df60Y/3c3o=; b=iRg/NoWOwWjjjc4h96e680DZH7H0iU9lI5b/g805M02nIWsc/91QaYJSPR2VyHTi5MBxfKSMe5AbWgYx/tcwAicZ5CQgShcQ6vqMQ5X+aL9fiBPO4+1QnkLpezwM33zwIG1+9Y9mwTIaFYI6cd5L5VECbBuEQY7v5ZuFzi2IToGE7kZsyj410mSJZmWcGZXZPmMBjLga+1mVKyLeIcxoxTQdpcAT5Ho0zsVt9EfO1YKVq2JRQ62wDDQl/NhZLzsBChxGVL/qP7vPU3YCuxSXu4VyUTryMGT1CixM5V0qMqxQg7xbsK7QQsjwGCOyGULV0ofvuSCxvEmBDXdBsT0Bcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ntAtTCMcbHSjuDHVGPGm1FRLN0bmiJDw3df60Y/3c3o=; b=VOxLsZlxllY75Miftz8l9LqXMwOxCqwGszT2/qvkJDCetb+TsEhMb3pofuGUPdZ0+nW2naLp0M41ooI1QPEARWfU68d7xJelLZXoBs7CCgajVnDO1UmQoScdoMc83ywQa/mCGtm2+U4c+LHRWiPj39fzZhUKD/eTxERU/oUb8/s= Received: from BN9PR03MB6058.namprd03.prod.outlook.com (2603:10b6:408:137::15) by BN9PR03MB6137.namprd03.prod.outlook.com (2603:10b6:408:11a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.20; Fri, 25 Jun 2021 07:57:17 +0000 Received: from BN9PR03MB6058.namprd03.prod.outlook.com ([fe80::502a:5487:b3ee:f61c]) by BN9PR03MB6058.namprd03.prod.outlook.com ([fe80::502a:5487:b3ee:f61c%3]) with mapi id 15.20.4264.023; Fri, 25 Jun 2021 07:57:17 +0000 Date: Fri, 25 Jun 2021 15:50:12 +0800 From: Jisheng Zhang <Jisheng.Zhang@synaptics.com> To: Nick Desaulniers <ndesaulniers@google.com>, stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Nathan Chancellor <natechancellor@gmail.com>, Ard Biesheuvel <ardb@kernel.org>, Sami Tolvanen <samitolvanen@google.com>, Masahiro Yamada <masahiroy@kernel.org>, Sedat Dilek <sedat.dilek@gmail.com>, Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Alan Modra <amodra@gmail.com>, =?utf-8?b?RsSBbmctcnXDrCBTw7JuZw==?= <maskray@google.com>, Quentin Perret <qperret@google.com>, linux-arm-kernel@lists.infradead.org Subject: [PATCH stable-v5.4 v2 2/2] arm64: link with -z norelro for LLD or aarch64-elf Message-ID: <20210625155012.4aec8450@xhacker.debian> In-Reply-To: <20210625154737.3d64a434@xhacker.debian> References: <20210625154737.3d64a434@xhacker.debian> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.147.44.204] X-ClientProxiedBy: BYAPR06CA0033.namprd06.prod.outlook.com (2603:10b6:a03:d4::46) To BN9PR03MB6058.namprd03.prod.outlook.com (2603:10b6:408:137::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from xhacker.debian (192.147.44.204) by BYAPR06CA0033.namprd06.prod.outlook.com (2603:10b6:a03:d4::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.19 via Frontend Transport; Fri, 25 Jun 2021 07:57:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 14318e6b-7165-4199-c414-08d937aeda0c X-MS-TrafficTypeDiagnostic: BN9PR03MB6137: X-Microsoft-Antispam-PRVS: <BN9PR03MB61372E2FCFCFE1A04D415A1FED069@BN9PR03MB6137.namprd03.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:1923; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4IV2hppgoe4nxQaMeQnnFa7NB9eZC8lq7K3BWtHf/49sQQQTsA6nBqFkajLC19zPI1GEtEFVNvziGPJBeL7vuPU052hxGuif+Rm/nhNnZRme5J6t4iU9M+WxxB+TZRSit9mpSAx/G5ABIOPBvYOHVxCK3uoluV+/BWWj8rq8ua4Zl6G5KAXEVrj98hijiT5GKyi/nPMm8o1eGd3nYGTvBM0kd/bFNZD5+r6Yq4xFyNl7p1iVAtlNRp6yorJha8zTOZ95niEfYxjkSrL20YNhDTQY+l+eOs6JsPsRISRTiNlpljmd582bJedES8rCtPWlUL2Bu+pPOA8m697kPPDUMH71bHmn1Nt49Kb/w0Wy1BFPX8GxlvAuzKwdRHkfPzLnkuBX3//ui/n97QMk9VVNkme+XxUNejHLS9hqWNGqjR3CCwab95Aq3K8Om0DSsh+GWfK7JNWsgMY5FSQArTNsdiEWVL6zVY9HLJLPPnfIaF0Zm8HrwL4p5MPNNEbpSl2wzysqFcFqaxdY+Vkm10nW7Lc/n9my0Iq4i2BnZlfO4wgJeFf302TpSDHwgQErNYvZZYpjjjuYw9J5NzrSfxNrUI3F9u9Axgh6tpQphtwjQi3fnL3ME+6yP6034CVZ3+Os7PlObW3kZLNbUqv9wEWlRayj5mm/cgrpXUay3P9s1HlxGMkwAFmc/QjpyAXAh1ZAhmOmoORa5I7CkDZoYzgrKCu9bXaO8+Yi/y1kGkWzQVpMqil5WAGVEEyTlQ9S/1EqxXYdn+dmS32UOS03zKaaHJUeSerVVORuZgThZiwMKV+RIO5ZmphyeG2wJCwr9mS6Qvl7NJjd2RTVuVeNyiIqFg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR03MB6058.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(136003)(366004)(396003)(39850400004)(376002)(52116002)(2906002)(186003)(66946007)(316002)(66476007)(8936002)(66556008)(7696005)(26005)(478600001)(55016002)(5660300002)(966005)(16526019)(66574015)(9686003)(110136005)(7416002)(1076003)(54906003)(86362001)(6506007)(8676002)(38350700002)(38100700002)(956004)(4326008)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?O0m7ptXkaEA14l/QBPWoEWMvN?= =?utf-8?q?NDpOYpGNUC8aBFxKB+Ns0I2zZEjmPEDwwGTyaaBAKG4/Y2Ozs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J0ND1tiICIZ5NwFAqzNNxisRPE6L0DVv+m4pz0O3GuDUTMRnDt+xZVk/?= =?utf-8?q?gWMKfeXzy4gYmYpibNE2p+B5R3N8f1J77S/aZVHIbXFVoYzse13I932T?= =?utf-8?q?2IAgqTn59qe1FTbSgt2Vw1fa9JfUfgQrAgqQCMjS/5AbCRMprwleW26U?= =?utf-8?q?4kZ5PaCFfqOAKos5uMfqQECA+aB5qGV7LtgeI5oNpW+5hw/teQhhnMC0?= =?utf-8?q?Zsm18tDftmddPWYYXahcPRr4ouiFiUcd8iFAuTBqAkcjldv7uEwx6TvZ?= =?utf-8?q?0N9vVRV6UJ2ydBiJseiITfPYncIuLtAiaYxj03+U7ptV3iKZir+Vl1rz?= =?utf-8?q?lzyIJwWMzHss+KXCQNZ8tHs3lBojzTJ?= X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14318e6b-7165-4199-c414-08d937aeda0c X-MS-Exchange-CrossTenant-AuthSource: BN9PR03MB6058.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2021 07:57:17.3564 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: a6mkC3YbMYqKDtHJMwrS7s2vECuequtvWIK1c2lqqXUHECjjdW4p+zaAEu4V890BGtlktBsV7acKOQkuFvxxdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR03MB6137 Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
properly cope with -z norelro
|
expand
|
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index cd8f3cdabfd0..d227cf87c48f 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -10,7 +10,7 @@ # # Copyright (C) 1995-2001 by Russell King -LDFLAGS_vmlinux :=--no-undefined -X -z norelro +LDFLAGS_vmlinux :=--no-undefined -X CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET) GZFLAGS :=-9 @@ -82,17 +82,21 @@ CHECKFLAGS += -D__AARCH64EB__ AS += -EB # Prefer the baremetal ELF build target, but not all toolchains include # it so fall back to the standard linux version if needed. -KBUILD_LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb) +KBUILD_LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb -z norelro) UTS_MACHINE := aarch64_be else KBUILD_CPPFLAGS += -mlittle-endian CHECKFLAGS += -D__AARCH64EL__ AS += -EL # Same as above, prefer ELF but fall back to linux target if needed. -KBUILD_LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux) +KBUILD_LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux -z norelro) UTS_MACHINE := aarch64 endif +ifeq ($(CONFIG_LD_IS_LLD), y) +KBUILD_LDFLAGS += -z norelro +endif + CHECKFLAGS += -D__aarch64__ ifeq ($(CONFIG_ARM64_MODULE_PLTS),y)