Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1569480pxu; Thu, 17 Dec 2020 13:10:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzO3ecZtvZXt8lToKY6PUNGLclc/9ip3hTR80zpl8wPFUSnci3NekeafEwOOb8zRuLufcWi X-Received: by 2002:a17:906:6414:: with SMTP id d20mr982419ejm.82.1608239404676; Thu, 17 Dec 2020 13:10:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608239404; cv=none; d=google.com; s=arc-20160816; b=iDSSEaOGynZCqUDtMEbHB2BUw4GabLsJQWbZVkvlVHpkANW742wrlgw5025pQBt/ST uq+tjS3aioYo6geyEtZ2DePmcPhsmwIGwgFdgH5TGqpQwmZlWzMTv6061eoO3r2HMEST +rMhfxS5v3hg5EES+EZFR3SU2o1s5y1Q208T7Il5VDcL4dwPLz0lRQhIw/rVmjF0qpvp 6ER3f7RyWSp0DsPumgSnNZni8k47D2uZAYk+HvYb/VoaKqgs7Ea9dNXgrLRzmn5Mee8h hsBnnUb5OaY+JHG5BV/tf5Xo205aCFbBAxEkPp+9MvP7SbaofhdTwARa0gHbVosDVzQh ho5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Pn64gL1PFy3T6aEaSewOwhAXHuHI8RuWQ88aIPK+DJ0=; b=yGOhmAgbaVPcNEUOVhFbq/tcp4QeMcrvvdn7yINKgGKcghgO6BzFQI93IQybrOZHEU tizGSCZzmBf/fk+FL/Tj5HWFROi1vpqoJJifQC4hNF7rb8w8rIyu/APT7WcUQeJL1byf lx1PZFu+IQpc/hO7rsa8JRQxS3AFqYbWr4P+Akiq7ffH0lbr4SMC3VhJm4ywn0RvV37m 7mNknTnBoUJhkRJiwDpJ5Ks/svk1yaHvlxSM3Kk0NmB23xnjTXRwkfKD6YQrdARLpiUw AGdoYsYhV1NcCjhUdQrIEsNFVw6VjINoVgPcBfs8iHhj0UOe5fYXHxKKh3LULO3jb/Dc 4pWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uyu8VTEG; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si6146953edv.597.2020.12.17.13.09.40; Thu, 17 Dec 2020 13:10:04 -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=@google.com header.s=20161025 header.b=uyu8VTEG; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731524AbgLQVIe (ORCPT + 99 others); Thu, 17 Dec 2020 16:08:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729612AbgLQVIe (ORCPT ); Thu, 17 Dec 2020 16:08:34 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77438C0617A7 for ; Thu, 17 Dec 2020 13:07:54 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id h186so188298pfe.0 for ; Thu, 17 Dec 2020 13:07:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Pn64gL1PFy3T6aEaSewOwhAXHuHI8RuWQ88aIPK+DJ0=; b=uyu8VTEGuSZJ0tQIowYFWiWOKwtj8ojCTOGEEPNHCr+oMko3vIj0fZovNXF+Nv1bTc FNlgWZ3tCl922WpnP24+KDKTMn4LfkkmC9Ns8nlTVkXZUpHszNhSKY2E5m5Ux608etcq hE4Yg4C8NzZRbwp9lKUgnt2nxh82PHB1jglyNUIy45lqWzNgoQ41DSKXLVkKYH0VPDE2 byzdgK7duzdAd6HEfmhoGfzQs8HLXZYTV27g+zQjQfbUBnSnoiOqwUnwQdIuuQHrTj5H rlcMivKS17p8O4KTXR991kOqB/0W1Ksk+RXmVQZp9Bb5xacWLEFzhL9TeN4BrV3bpg4E C3mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Pn64gL1PFy3T6aEaSewOwhAXHuHI8RuWQ88aIPK+DJ0=; b=YleiYS6xf3NlcSbX7A7mmLswxTIRA7+vLRARqFHU+PIn9ZzOR7Ofj6lMqTGrXiXUEf CQWgj4uWBaz41OparWbZDeH8ZH6iTAqRpgPjM7sEZ6f19D7I360GoLDOsXFKIYgpL2ju ZhV2QL6Cjn/IdYQUNoxCA0E5uzlqHrkI+vQhKFKNGdbpmLmkrXDM/SlPbRvjTQYIiLDO PhNkWi7m2Mp127oDJPcc5yWkfRXOTnO0E3lJd0JxjADSz6juhvgIRYPsobvo1K1FJ4p6 st4vmc8e42QUXO0UTmfojVvwLJiUd+GG8e0npQkY0AgRGnRiwwumVaPo3qT7LcXz8rVC cxuw== X-Gm-Message-State: AOAM531yDgMPMrLim19F2LTeVq+6B0+tvCQzm0L8L4V84EwQb812iHeH XqKfER0T/toojfDtPCYFeTXSlhlnLufahPo3oF+jIQ== X-Received: by 2002:a63:1142:: with SMTP id 2mr1079220pgr.263.1608239273686; Thu, 17 Dec 2020 13:07:53 -0800 (PST) MIME-Version: 1.0 References: <20201217004051.1247544-1-ndesaulniers@google.com> <20201217120118.GC17544@willie-the-truck> In-Reply-To: <20201217120118.GC17544@willie-the-truck> From: Nick Desaulniers Date: Thu, 17 Dec 2020 13:07:41 -0800 Message-ID: Subject: Re: [PATCH] arm64: link with -z norelro for LLD or aarch64-elf To: Will Deacon 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 , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 17, 2020 at 4:01 AM Will Deacon wrote: > > 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 > > > Given that, prior to 3b92fa7485eb, we used to pass '-z norelro' if > CONFIG_RELOCATABLE then was this already broken with the ELF toolchain? Yes, though it would have been hard to foresee the change to BFD ~6 months later. Specifically, binutils-gdb commit 5fd104addfddb ("Emit a warning when -z relro is unsupported") was committed Fri Jun 19 09:50:20 2020 +0930. The first git tag that describes this commit was binutils-2_35 which was tagged Fri Jul 24 11:05:23 2020 +0100. I noticed about a month ago that the version of binutils-aarch64-linux-gnu installed on my gLinux workstation had auto updated to version 2.35.1; I was authoring kernel patches for DWARF v5 support, which relied on 2.35 for DWARF v5 assembler support. I suspect Quentin's host was auto updated as well, at which point he noticed and mentioned to me since I had touched `-z norelro` last. But if we look at commit 3bbd3db86470 ("arm64: relocatable: fix inconsistencies in linker script and options") which was committed at Tue Dec 4 12:48:25 2018 +0000, it was not possible to foresee that binutils-gdb would change to produce such a warning for such an emulation mode. So I'm not sure whether my patch should either: - have a fixes tag for just the latest commit that touched anything related to `-z norelro`, mine, 3b92fa7485eb. - have an additional fixes tag for 3bbd3db86470 which first introduced `-z norelro`. - have no fixes tag I'll respin a v2 folding in Ard's suggestions. Meanwhile, I've filed: - https://bugs.llvm.org/show_bug.cgi?id=48549 against LLD - https://sourceware.org/bugzilla/show_bug.cgi?id=27093 against BFD -- Thanks, ~Nick Desaulniers