Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9860794imu; Wed, 5 Dec 2018 11:31:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/XzObvnTIG1Rdem4astEI4PTg5Ky/YYRMepAIP43O1oc5wfeNAnxGXNjf2TupU0XSfLwphM X-Received: by 2002:a63:9306:: with SMTP id b6mr20704503pge.36.1544038293997; Wed, 05 Dec 2018 11:31:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544038293; cv=none; d=google.com; s=arc-20160816; b=QwUCDilo4rBoEr/YTuAc5Aw+uzIzAg4wx1KulrzcDvTctXgeX+ZvhSbE6AcYkPzt2U W5y+zGknYsiAYWTasIG834Gw1DiVHiuJoU8+gzM79P+OAYoWUcpXeE+AX3+sPrlk66yp 0xqHatCKDvD/ALOcL8DZZDCuBnq4yzvbSXiUvBZK7TkwoI8HAc/ITnJzSXjEPw648dky IhnDNbMS12N1tEzJW78uRSybb8moMFVs60fIdmSbQpONk9A4YJeqXC7W+f3XsmKBNQUI lntA5qPNiijufhrELoEgKIxVp2vJrzuV82O4qyYDIBtFR7VVWirV61FOOkxMg1JYYy3V wKsQ== 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=Ewfe0w25rqowReqHV6TpWvacevriFTKv9Ol1/yY+UJQ=; b=aZWRDT/XoeHSoEIG6H5vyHP/+5Bul7ArZHrjSskIvfpuonL5om8NHRFUbFsTCxXsVL U+NtOf0AYcoDgwaiAL85vKWd3VjlKFK48Xqu+ilY76YNqUnXa04QxlcEvjFz/snhwjvs QJpHUJ7FR6s2zd/2BUXJSSzyU9iVsbCTh0WIp/GA8Or5QrqIiwGX5FUxbRh2ONp+4X64 r+/fALbzphqwaiBD/jaF3Zg6X0IxE4W7upWpXojxVu3jnnAe2uSU8/1dpkXGxiuvcb6R ZE8oD4OT0VbrCvHLLhHx5Iw3/7Ciy2gTHZyJRvhkVemzjuhloaWAAOqluUgEvPlOWq8y /zDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JVEhQtmw; 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 v8si20733634ply.126.2018.12.05.11.31.19; Wed, 05 Dec 2018 11:31:33 -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=JVEhQtmw; 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 S1728428AbeLETao (ORCPT + 99 others); Wed, 5 Dec 2018 14:30:44 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:34257 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727297AbeLETao (ORCPT ); Wed, 5 Dec 2018 14:30:44 -0500 Received: by mail-wm1-f66.google.com with SMTP id y185so12483307wmd.1 for ; Wed, 05 Dec 2018 11:30:42 -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=Ewfe0w25rqowReqHV6TpWvacevriFTKv9Ol1/yY+UJQ=; b=JVEhQtmwxsXYVL2QlhHOakAgD/aB9iOrGk5kZH3hKCAaep9lDYZIXSS39hUVjPK2dW wJsqb/XvuHAC724m3tEh2I5ADqjDzG3jg71Niu+tLGQrqLqMmZMz+nWX8IIGHFZZqGs0 lcbS3e2ja4LUAGNuQ7Fo9q79Lsco+sMAZLBs8= 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=Ewfe0w25rqowReqHV6TpWvacevriFTKv9Ol1/yY+UJQ=; b=SGLM2xeo3q4KKNZi8UDV4zXEye1astIJmcCjHCUQZIYOvVLkAYSp9+VVa3vw0CNaxC f3MFHWmy0PMB89XMOpd/2ge/oFC/B9y6f56wVXSAGiQq2qq2DiAK2+BmPXKMNucCXsMz kc/UmKm7gde6Vy+xCDzsRu0lYXwsMYDmL/dYnVR6X9n3YAXQt5UQqkn3nJC4DEpMLVly NPonJKgd5UcWlliadWqCqi7cv1q43+QYj3A33YoKVeN9gZS1ttETwX/iJUX2gHBA38lR EL941jCXfCiUU52vIWj/7Ugj0AFVMNTxXKOIZNEScvy82l4yno1I39zPwCTQLPiXnZJF n/Bw== X-Gm-Message-State: AA+aEWbj2WsuJZkrz2JGySGSHyh4CYfz6vKNQXLrW1Km2h5m/CbYKWrO TdIGRd7ts0CNLpEuBqwrtdc0mUCILZV1OU0Ioqho1Q== X-Received: by 2002:a1c:400b:: with SMTP id n11mr17431022wma.85.1544038241906; Wed, 05 Dec 2018 11:30:41 -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: From: Peter Smith Date: Wed, 5 Dec 2018 19:30:30 +0000 Message-ID: Subject: Re: [PATCH 2/2] ARM: Wrap '--pic-veneer' with ld-option To: Nick Desaulniers Cc: Ard Biesheuvel , natechancellor@gmail.com, Arnd Bergmann , linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stefan@agner.ch, nicolas.pitre@linaro.org 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 On Wed, 5 Dec 2018 at 18:22, Nick Desaulniers wrote: > > On Wed, Dec 5, 2018 at 12:10 AM Ard Biesheuvel > wrote: > > > > (+ 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? > > (+ Peter) who might be able to answer this. > LLD will only use position independent veneers when --shared or --pie is used, otherwise it will use veneers with absolute addresses. If the kernel must use position independent veneers even when the rest of the code isn't then we'll have to implement --pic-veneer. Peter > > > > > > > > > > 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) > > Not sure clang can compile an arm32 allyesconfig (haven't tried > personally, yet, TODO), but we could try gcc+lld. > > > > > > 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 > > > > > > > > > -- > Thanks, > ~Nick Desaulniers