Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9197638imu; Wed, 5 Dec 2018 00:11:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wlrg1HJdHhYJK44qXfegMUPXEsegdTgoVZsjwFqbU+ZFjUXqJ7RzbaFcO+gyp4a6H42pOl X-Received: by 2002:a63:4456:: with SMTP id t22mr20095614pgk.0.1543997467970; Wed, 05 Dec 2018 00:11:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543997467; cv=none; d=google.com; s=arc-20160816; b=AWlRBhLcR8be8PkVudZQAbyrIKb+vxR+WQya8WMWbSuy+G/wIKyKE+BvBeg8bG3tPx u3qMO/e/xlktZKPHWxgLlA0BU9vvce1Orfy3fr/9GVhy0XzqK4gD0eEdZnMOGjkmrGgZ gsBwtjIBRzGttWFhXhX9wPZusASJ5Pj2pXp0jH0Q/XJXkgezlmaLu1sk55LMzKj3rkxw O8S4+ejoOZTMTiM9xZXKslCDCj+8MLeZbFG1pzgqO7tYnihQ9JymZMPloNU1A9eTntlB 1nhQPUSkOeQKzNH5n7tXtPQg95ub7a40BiT7Zb8JZ1JJzYt6lqotbUEQ/+jXdzAtLcdJ NweA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=oZ3hSwv8XRSBREnEXqtCrC4UEedzsNDdAjUoXfYalNw=; b=nunODFjYeUJCHI/XIHnUFf2U2TM3h2IZv9qro+1t0MZbA2ketlEGRt9IdGSu9jko3e WaWpmXi3l2jKYmPndk4yqyGOfeMAqZJiFCmAzaG13NqhFZnB9BSTo410sh4ZRwnEj3HR woyC/aCFgwUuvXpH4jULLeyOrgeOpCQIIRcK8CsELVpFVf2zv8eABuSSlourNWcXb3R6 9HxLhZutPI/YVAOjXOKbJSu+VgDT6kW9tRyoszvN7X5M3cvPPn00Au/mMffdl459Y1r1 PlXajXSHIBemK0q399dRSzBoBhJxLusd499zoJZE2df33Z0hmCzVEs1Os/+w7Eclgx2w HCtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ewFQM0Vq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16si18535471pgb.140.2018.12.05.00.10.52; Wed, 05 Dec 2018 00:11:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ewFQM0Vq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727142AbeLEIKK (ORCPT + 99 others); Wed, 5 Dec 2018 03:10:10 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:35262 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbeLEIKK (ORCPT ); Wed, 5 Dec 2018 03:10:10 -0500 Received: by mail-it1-f194.google.com with SMTP id p197so18921086itp.0 for ; Wed, 05 Dec 2018 00:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oZ3hSwv8XRSBREnEXqtCrC4UEedzsNDdAjUoXfYalNw=; b=ewFQM0VqiOFg9qI5CSQ0Tbe7PkqavFPB5Fi1+3/uMSIxfHI23kxEUVaOljt0izfYRl k7MBOQfNdDPPSrgEeyc3cwwMFy8FUlwqgeOH/bxHAnKV8/fK7I2ADY0fQff88ce4AK2I 9kAOg03LR6uYo7tcKl39suY981XQPMx/dJQ0I= 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=oZ3hSwv8XRSBREnEXqtCrC4UEedzsNDdAjUoXfYalNw=; b=TH1/DDCgTFoIQ1tOu0faQv7psdSQcEopKWbx9xrgNJVPIg2Zn49RzBTy33SD9TiCyL Si0OlJl3Gmp5u8PC1JPx44fqp5ansrfKLRfvJsX++p/g1xwIJhO+XcpwDpQbjRWJZoSJ XLULN8BbG9XaRB881sSyx8S7TsmKYaUe7zzPiNutQChtJU7PciRODVbuCMTeQ7hQ3kKk 19+Y/vgRBPOYxvSllGlixFhFaMxhpC5HeSiS5kg3PeizOJlYfRxn1f6xD6C0MS9MUbiS qs1c1Z2uieOLahf9EJ3XOfteu86LS0mH6MClAVOYAi9/Kp78zsgL0N6AIgajVBbWRoO7 2Ttg== X-Gm-Message-State: AA+aEWbWNVaOvEnbSWJqI+WeP7/JVu71TnybtrjIwo9ls3oQ5ojbu0EY /eLDlGKcGwqlRjZ9HPz1XKbTtojR/GLByHAytZ4DPw== X-Received: by 2002:a02:183:: with SMTP id 3mr7522139jak.130.1543997408631; Wed, 05 Dec 2018 00:10:08 -0800 (PST) MIME-Version: 1.0 References: <20181205014213.943-1-natechancellor@gmail.com> <20181205014213.943-2-natechancellor@gmail.com> <20181205080645.GA11936@flashbox> In-Reply-To: <20181205080645.GA11936@flashbox> From: Ard Biesheuvel Date: Wed, 5 Dec 2018 09:09:56 +0100 Message-ID: Subject: Re: [PATCH 2/2] ARM: Wrap '--pic-veneer' with ld-option To: Nathan Chancellor , Arnd Bergmann Cc: Russell King , linux-arm-kernel , Linux Kernel Mailing List , Stefan Agner , Nicolas Pitre , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (+ Arnd) On Wed, 5 Dec 2018 at 09:06, Nathan Chancellor wrote: > > On Wed, Dec 05, 2018 at 08:37:05AM +0100, Ard Biesheuvel wrote: > > On Wed, 5 Dec 2018 at 02:42, Nathan Chancellor wrote: > > > > > > This flag is not supported by lld: > > > > > > ld.lld: error: unknown argument: --pic-veneer > > > > > > Signed-off-by: Nathan Chancellor > > > > Hi Nate, > > > > Does this mean ld.lld is guaranteed to produce position independent > > veneers if you build kernels that are bigger than the typical range of > > a relative branch? > > > > Hi Ard, > > Honestly, I'm not quite sure. I saw your commit that introduced this > flag and I wasn't quite sure what to make of it for lld. What > configuration would I use to verify and what would I check for? > Try building allyesconfig, and check the resulting binary for veneers (which have 'veneer' in the symbol name, at least when ld.bfd emits them). These veneers should not take the [virtual] address of the branch target directly, but take a PC relative offset (as in the example in the commit log of that patch you are referring to) > Additionally, I have filed an LLVM bug for the lld developers to > check and see if this is a flag they should support: > > https://bugs.llvm.org/show_bug.cgi?id=39886 > > Thanks for the quick reply, > Nathan > > > > --- > > > arch/arm/Makefile | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/arch/arm/Makefile b/arch/arm/Makefile > > > index e2a0baf36766..4fab2aa29570 100644 > > > --- a/arch/arm/Makefile > > > +++ b/arch/arm/Makefile > > > @@ -10,7 +10,7 @@ > > > # > > > # Copyright (C) 1995-2001 by Russell King > > > > > > -LDFLAGS_vmlinux := --no-undefined -X --pic-veneer > > > +LDFLAGS_vmlinux := --no-undefined -X $(call ld-option,--pic-veneer) > > > ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) > > > LDFLAGS_vmlinux += --be8 > > > KBUILD_LDFLAGS_MODULE += --be8 > > > -- > > > 2.20.0.rc1 > > >