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=-4.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 344EBC4361B for ; Mon, 14 Dec 2020 23:19:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA0CB2250F for ; Mon, 14 Dec 2020 23:19:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729099AbgLNXT1 (ORCPT ); Mon, 14 Dec 2020 18:19:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbgLNXTN (ORCPT ); Mon, 14 Dec 2020 18:19:13 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93C55C061793; Mon, 14 Dec 2020 15:18:33 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id k65so3554501pgk.0; Mon, 14 Dec 2020 15:18:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cy5+nb3a0dSIGsiUUPc3iQidez+Phr48KktH/YxEMmQ=; b=hHQI60c9sE6WrPTmn8orRED8IkFXLZWkiX83UJ2ENIiyTiIJU3sGVOIGBmOV568SUO 5o8F6TerM7xa7WsWeBIsoMDNpAxUWBKC8KrYx6GDFQoCz0sYuCO9yozK5mZ5YZYE3msc bDigUwaW8ry5XHclIaNzq64f5ORYjUogUm3Fmo7LAf/6klmGAw8LZa9VVhTruYx4Q7wn WtGPuD8yJWmZ/Ta3vvMiotVZFNOBQfuCnixBR3wRB0p5U8zf4dShbhV4FFJpuxO0PPcH BNJn+mPfhWOiNd1wcUIOlrh595NLrqo6cAj3qunAz60lte9MHxl64uzkfnPOJtglBIwQ 2F5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cy5+nb3a0dSIGsiUUPc3iQidez+Phr48KktH/YxEMmQ=; b=SDIj7hvk1ERsUa0wUpgxOHjs+rjAaszHgs0FCFXsRqTrciQMe/Zfk0uai+nuVX/31H Gs5nO4Ybf3EqV5B/ShzlAXwj+u7H5TznIrmQ4lMmLr4znGoq/gpH9IEvg/d9sXrcDGnA nf63yoS+x1gXy/tTKY7GYRBlP4280ZkXcW7dZMc+8TzpCUbYqTlLAEAfO9Ck3UzvRRkO 2xpiujIBxjjqZV3iGLkpLQN/MYz696rvY5i/PWjPN3O3NY+NVNZ3i0Ugj/ImVkhq0u4X AQLA2AvZ9VREBLHCaX/4aeZuJfcI/mBRf9i064QDdDjHk2LxZW9J2+UwDljX0wSigdRm 7tYQ== X-Gm-Message-State: AOAM530mwWrPCxhbA+0CaDPMDi9VZiWmh8HME61YeykZgW32iZI4qePa mjNb+EZAChGJyvyinU85Tr2s6/ORoomqow== X-Google-Smtp-Source: ABdhPJzyHb8JB2CtR88j8zHWZrn1qMJhhcJzF5HIzVScHKsGXTvaRsNSOElZB/fa4z0LhaD0vzzl5w== X-Received: by 2002:a63:1d59:: with SMTP id d25mr2636879pgm.259.1607987913173; Mon, 14 Dec 2020 15:18:33 -0800 (PST) Received: from bubble.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id h4sm22508539pgp.8.2020.12.14.15.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 15:18:32 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id D755681792; Tue, 15 Dec 2020 09:48:27 +1030 (ACDT) Date: Tue, 15 Dec 2020 09:48:27 +1030 From: Alan Modra To: Nick Desaulniers Cc: Catalin Marinas , kernel-team , Will Deacon , LKML , Peter Smith , clang-built-linux , "# 3.4.x" , Linux ARM , Ard Biesheuvel , =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= , Quentin Perret Subject: Re: [PATCH] arm64: link with -z norelro regardless of CONFIG_RELOCATABLE Message-ID: <20201214231827.GG8873@bubble.grove.modra.org> References: <20201016175339.2429280-1-ndesaulniers@google.com> <160319373854.2175971.17968938488121846972.b4-ty@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 14, 2020 at 01:44:06PM -0800, Nick Desaulniers wrote: > aarch64-linux-gnu-ld: warning: -z norelro ignored > > So we set the emulation mode via -maarch64elf, and our preprocessed 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. Now I don't know why the kernel uses -maarch64elf so you shouldn't interpret my comment as a recommendation to use -maarch64linux instead. That may have other unwanted effects. -- Alan Modra Australia Development Lab, IBM 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=-2.2 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 A7659C4361B for ; Mon, 14 Dec 2020 23:19:47 +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 37D2C2250F for ; Mon, 14 Dec 2020 23:19:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37D2C2250F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=oYkBBKsAhQCd19dfObdBezhNJudOOoSZTdNI60ZzsGI=; b=qGMk1I0N8DOrMdxZI4WXBlPIw /yUZZZkZ+IWn9jCFbo2aro+dOIlna3Wu9wh+3EodYH4Eh98U+nWoN/fJ6IUBYX9LYS8TfI1xVGX7N 7A2C3wLQGLfxxU6Ji0vZKrkyf//dDKCnmN3iZsmUWc9OCfuZ/QQOVl3RFubD4c9wXFKbdu9CCii+H URPTaONKngOhzI+lQbuhkl8ojr9v0l/w3ND80Kdb8AhWOmP7Cijo2asggxe4PbvVNd0ONb/obWoAQ HQWF2WKS+/O3JB4uNR1IVhNrsFr15p/vBnIPLceYq3sIgf4HVhBut4al4tIkFHYZPJ8MOV56GQ/Ts ZXyoOwFTA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kox71-00048C-Fy; Mon, 14 Dec 2020 23:18:39 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kox6z-00047S-4r for linux-arm-kernel@lists.infradead.org; Mon, 14 Dec 2020 23:18:37 +0000 Received: by mail-pf1-x441.google.com with SMTP id m6so3509178pfm.6 for ; Mon, 14 Dec 2020 15:18:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cy5+nb3a0dSIGsiUUPc3iQidez+Phr48KktH/YxEMmQ=; b=hHQI60c9sE6WrPTmn8orRED8IkFXLZWkiX83UJ2ENIiyTiIJU3sGVOIGBmOV568SUO 5o8F6TerM7xa7WsWeBIsoMDNpAxUWBKC8KrYx6GDFQoCz0sYuCO9yozK5mZ5YZYE3msc bDigUwaW8ry5XHclIaNzq64f5ORYjUogUm3Fmo7LAf/6klmGAw8LZa9VVhTruYx4Q7wn WtGPuD8yJWmZ/Ta3vvMiotVZFNOBQfuCnixBR3wRB0p5U8zf4dShbhV4FFJpuxO0PPcH BNJn+mPfhWOiNd1wcUIOlrh595NLrqo6cAj3qunAz60lte9MHxl64uzkfnPOJtglBIwQ 2F5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cy5+nb3a0dSIGsiUUPc3iQidez+Phr48KktH/YxEMmQ=; b=BfrQLSwiS516v7lnKr2OoMmgpX0w4jRAW2Li5KELGQ6rpTjkz8aO/QabeWM2Uo8pbV Llc1CfPH90bbJ/p3J6kiVT/JQO4jtFL46AJEknjjTYEJfHqvEPIald/F7ZYnLriRmqXK OhXzN9zVJKY+r0qrwSwosLgvl/8OcknSfLCr5zdBQdi91hnaSCtyeiL/8uPBNAWDdANb mQd3bhpXzT5ip3khmDYPfeaBNOQT4uJG3UGFDhfK9i6w1n7uJNOdsaJT/sDPY/sVMbRA gbJMIbl6n060qvYTN+FpP4YyO14kJjmvfBqiTtfNqKCKmCeaEyU5h/5jmHSw76Qr2bL2 0F6Q== X-Gm-Message-State: AOAM530YlRG6/NrL++c8iB6kFkYClE8aWVDG6aEBf7rrNAsw7vj1iRHO TbAGtZVUwIj1rCFAbuvw89k= X-Google-Smtp-Source: ABdhPJzyHb8JB2CtR88j8zHWZrn1qMJhhcJzF5HIzVScHKsGXTvaRsNSOElZB/fa4z0LhaD0vzzl5w== X-Received: by 2002:a63:1d59:: with SMTP id d25mr2636879pgm.259.1607987913173; Mon, 14 Dec 2020 15:18:33 -0800 (PST) Received: from bubble.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id h4sm22508539pgp.8.2020.12.14.15.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 15:18:32 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id D755681792; Tue, 15 Dec 2020 09:48:27 +1030 (ACDT) Date: Tue, 15 Dec 2020 09:48:27 +1030 From: Alan Modra To: Nick Desaulniers Subject: Re: [PATCH] arm64: link with -z norelro regardless of CONFIG_RELOCATABLE Message-ID: <20201214231827.GG8873@bubble.grove.modra.org> References: <20201016175339.2429280-1-ndesaulniers@google.com> <160319373854.2175971.17968938488121846972.b4-ty@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201214_181837_228945_B8E1F3EE X-CRM114-Status: GOOD ( 12.47 ) 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: =?utf-8?B?RsSBbmctcnXDrCBTw7JuZw==?= , Will Deacon , Quentin Perret , Catalin Marinas , LKML , "# 3.4.x" , Peter Smith , clang-built-linux , kernel-team , Ard Biesheuvel , Linux ARM 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 Mon, Dec 14, 2020 at 01:44:06PM -0800, Nick Desaulniers wrote: > aarch64-linux-gnu-ld: warning: -z norelro ignored > > So we set the emulation mode via -maarch64elf, and our preprocessed 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. Now I don't know why the kernel uses -maarch64elf so you shouldn't interpret my comment as a recommendation to use -maarch64linux instead. That may have other unwanted effects. -- Alan Modra Australia Development Lab, IBM _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel