Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1170168pxu; Thu, 17 Dec 2020 04:03:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0SrtvAaTfO4MONkpf35ZsgmFXUhJja62IXB4T+00c9Dc3rNTuEJ2VaV56U6UuGDhnVrKa X-Received: by 2002:a17:906:a106:: with SMTP id t6mr35309043ejy.63.1608206587865; Thu, 17 Dec 2020 04:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608206587; cv=none; d=google.com; s=arc-20160816; b=NeATHhazHeGQIArjxV+kZwoCJkocfymk6SwmYOd5kE/5QEDjYszVBfuQBQwb0kLzvH aIOMpR+Bavep6mJdl43vLD9JcAtphdzEvZQf+4BclCbCmtZUhbwODY34ivkqWaPD6Bkm vmRkh/jma1YPwircZWnrjwoSybasu0IVJPQ4BtHT0cmuX44t46j+dHvSGfivf4J1DyG/ BZxC8Z7rK6QvAvjRfWmZ4aOl7rMvhGtVaX40HuviGNjK2hKBt0kHY1G1A+l7jF5EYki4 o/BtRilj+CXUA8E1G+2PoCSl1Ya8+RWth71a9joV7jg3CFluKgmaQu2CcW/+7qCuwPsa HGog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from :dkim-signature:date; bh=FOPsZyXx4iN8p0/4mxhvAamcUnQWn1EP2C1OkJ+wAcc=; b=KX5nIGGtopH4YLXTxNknaxlMsiKAujSGvAvIdqYhZl3GvfXnDX16L5+xHNQuuBdQ+k pMw4IDcirvhEL2IQDbCR8pAk6ousfF2s7hNnS5wphC5hhO+WrAMp7peJCgK1aU/yTqxX eCsSaqE0kq5I86LkJtjzQ7DGiRS1VdsVfLlTpGm9O8etV5uytVfq/WT4PoexjwMCMMdL A4q9C8VF59BW2MDmtWwJL3bV1GWA/q53c/M5Q2a5jjtb0w+jHL0ujpnQAW9CS3jvSrns 2aT+rDcmULeQzbB1oHPfH5WZx12yR89aG9kcRk0AbhikimQSONe0zy34//JvLDCT7uX4 XK1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YC253vLN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si4487783edv.602.2020.12.17.04.02.42; Thu, 17 Dec 2020 04:03:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=k20201202 header.b=YC253vLN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726699AbgLQMCH (ORCPT + 99 others); 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