From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 670EBC4361B for ; Thu, 17 Dec 2020 12:02:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C8D2238EF for ; Thu, 17 Dec 2020 12:02:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727119AbgLQMCH (ORCPT ); Thu, 17 Dec 2020 07:02:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:51144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbgLQMCF (ORCPT ); Thu, 17 Dec 2020 07:02:05 -0500 Date: Thu, 17 Dec 2020 12:01:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608206484; bh=r7jUwdDtR40JwLDq4mN8x2Vdpjg4t/rJFJC0XlwKltM=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=YC253vLNdtERLVRDsI1bn/nR9wmfN11MHTmXEIsd31azR4jyO+1EQyuBvbJBbeipx 6Gsg5cPZjTaMw0+lcelI9BCq0Z+3PYzfyYqQWB4BUWbDv9U7yBx7blSS+iQH/EQoh4 4JZx0aCB84UkDTdPIuDys50mhZCFVb2aWtC7uJEYu2FHvTk0YtcECivzX1bocVfGru u4/VmBoxro9bdA4gg2iVUXZCFQ+NMexV+Hiw0ErTCJ6HAMQem6gMG0b6WlmmDSFW1o mQUdhzceqOkZrZlNvZ2kQmB6n4fw7/wABkbg0D9DKz02F2tKLK9KVRVFhjkx5HNFCE a8OlX9bK2TVfg== From: Will Deacon To: Nick Desaulniers Cc: Catalin Marinas , kernel-team , Peter Smith , clang-built-linux , stable , Ard Biesheuvel , =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= , Quentin Perret , Alan Modra , "kernelci . org bot" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: link with -z norelro for LLD or aarch64-elf Message-ID: <20201217120118.GC17544@willie-the-truck> References: <20201217004051.1247544-1-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201217004051.1247544-1-ndesaulniers@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 16, 2020 at 04:40:51PM -0800, Nick Desaulniers wrote: > With newer GNU binutils, linking with BFD produces warnings for vmlinux: > aarch64-linux-gnu-ld: warning: -z norelro ignored > > BFD can produce this warning when the target emulation mode does not > support RELRO relocation types, and -z relro or -z norelro is passed. > > Alan Modra clarifies: > The default linker emulation for an aarch64-linux ld.bfd is > -maarch64linux, the default for an aarch64-elf linker is > -maarch64elf. They are not equivalent. If you choose -maarch64elf > you get an emulation that doesn't support -z relro. > > The ARCH=arm64 kernel prefers -maarch64elf, but may fall back to > -maarch64linux based on the toolchain configuration. > > LLD will always create RELRO relocation types regardless of target > emulation. > > To avoid the above warning when linking with BFD, pass -z norelro only > when linking with LLD or with -maarch64linux. Given that, prior to 3b92fa7485eb, we used to pass '-z norelro' if CONFIG_RELOCATABLE then was this already broken with the ELF toolchain? Will From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DE5BC4361B for ; Thu, 17 Dec 2020 12:02:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4464E238EF for ; Thu, 17 Dec 2020 12:02:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4464E238EF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YtX9312GMcqINiCEkrMGD3q+M6dozEtExNp6uvvFaVI=; b=cjzmnGTNjdN9Z1xWhEDv7F5dY Ruq0L/NeTSXJFaZHJmA7R6gsPTrl8X7dnncMedhmcc7ErnTkeYr2UwnRttwwR+N2T+Y9ogaEuPzjT o8JwfdvDjNPujZ/3+kcktLySE0CfGbCPkDUv7MESbq24gEFYxAv9DaXTRs8NrlgxKzsB0gsoCJY5m qG++w6ikUgbCOyswNKG/B4He4Rm53NfKdS2gt1aP4Bvxaxrg7xSNjtHJYHV8Js4gSrhda5tXTzkZl trC1fMD0gCZEXk5K6OE7GppBErMjDBdDDtBVDJ2VDIWthrpZIxMdK9Mv3Hab3Fcjm65lNvEix+oC8 ZxWwnBNyQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpryK-0003Ls-Mb; Thu, 17 Dec 2020 12:01:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpryH-0003LS-Mu for linux-arm-kernel@lists.infradead.org; Thu, 17 Dec 2020 12:01:26 +0000 Date: Thu, 17 Dec 2020 12:01:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608206484; bh=r7jUwdDtR40JwLDq4mN8x2Vdpjg4t/rJFJC0XlwKltM=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=YC253vLNdtERLVRDsI1bn/nR9wmfN11MHTmXEIsd31azR4jyO+1EQyuBvbJBbeipx 6Gsg5cPZjTaMw0+lcelI9BCq0Z+3PYzfyYqQWB4BUWbDv9U7yBx7blSS+iQH/EQoh4 4JZx0aCB84UkDTdPIuDys50mhZCFVb2aWtC7uJEYu2FHvTk0YtcECivzX1bocVfGru u4/VmBoxro9bdA4gg2iVUXZCFQ+NMexV+Hiw0ErTCJ6HAMQem6gMG0b6WlmmDSFW1o mQUdhzceqOkZrZlNvZ2kQmB6n4fw7/wABkbg0D9DKz02F2tKLK9KVRVFhjkx5HNFCE a8OlX9bK2TVfg== From: Will Deacon To: Nick Desaulniers Subject: Re: [PATCH] arm64: link with -z norelro for LLD or aarch64-elf Message-ID: <20201217120118.GC17544@willie-the-truck> References: <20201217004051.1247544-1-ndesaulniers@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201217004051.1247544-1-ndesaulniers@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201217_070125_859248_D266A4CF X-CRM114-Status: GOOD ( 11.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "kernelci . org bot" , =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= , Quentin Perret , Catalin Marinas , Alan Modra , Peter Smith , stable , linux-kernel@vger.kernel.org, clang-built-linux , kernel-team , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 16, 2020 at 04:40:51PM -0800, Nick Desaulniers wrote: > With newer GNU binutils, linking with BFD produces warnings for vmlinux: > aarch64-linux-gnu-ld: warning: -z norelro ignored > > BFD can produce this warning when the target emulation mode does not > support RELRO relocation types, and -z relro or -z norelro is passed. > > Alan Modra clarifies: > The default linker emulation for an aarch64-linux ld.bfd is > -maarch64linux, the default for an aarch64-elf linker is > -maarch64elf. They are not equivalent. If you choose -maarch64elf > you get an emulation that doesn't support -z relro. > > The ARCH=arm64 kernel prefers -maarch64elf, but may fall back to > -maarch64linux based on the toolchain configuration. > > LLD will always create RELRO relocation types regardless of target > emulation. > > To avoid the above warning when linking with BFD, pass -z norelro only > when linking with LLD or with -maarch64linux. Given that, prior to 3b92fa7485eb, we used to pass '-z norelro' if CONFIG_RELOCATABLE then was this already broken with the ELF toolchain? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel