Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7056583ybi; Wed, 5 Jun 2019 10:29:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJGOyuPNtiggZ36RJMvGVMMY62vYNl6WbA2KGyTC/WJBCVrTYwJrFKJAgO2vQyVWH+oQVm X-Received: by 2002:a17:90a:ac18:: with SMTP id o24mr47390636pjq.116.1559755768425; Wed, 05 Jun 2019 10:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559755768; cv=none; d=google.com; s=arc-20160816; b=TSBc6HIe5PvknT1D/6l7Xden+98wiCpqaW29xxy/FuoAR92YU67PWEt1M678GaWJ9J A7vua2NLqU8JP9n89zms63H9km+D0eZ+Pfl/yu9QBfodsrxQRpwm7tavAENY+oyqq5bY CibXx24MCR02I9fS+OyiOrfOu9kn4pVClkS97w4WLuuVzdDJMoISdikbWIS7XA3YxIyf Gxogn9YKQVYIC9oRuhaI5C1U/i9I4XlII4FDt+bz/3iC5sI5lRZ9NUbLJ+n+4gwJLu05 mojYmw7tPwMZhLMr/aASyAQ9B37viFwBvd9NjHg5O+86MlqqA0VAwqAFiQyYpKL8SbWe 4D8A== 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=T3Lwn5KZOUsmk/CRmt27tCNdDcr83HnHWyJ2IYSv5hU=; b=BvdeNmclZWgjqrf0v//gKEZNHuqqL7HCnr3fOEwG21ehbJz7frhZpL4sE285SYTZuA a87J6sWCfllvHIdxyKiHFQy2ESyjRIMxbJ31T+n2CRlLLC3Mot3P0f7IjKc/dyG6Vfhb YygncQdYXANov/kQ3vDS/zDAbYWYw3fBTXotKDRq7hpELtQ2k6LElbdOcLT6Ww+IVHuH tFIhuoNlZ8ogGnm4h5WLXbDCi4mlJp6t/g8fKamIIwzdYsRSkUYIOe1S5mXPPgmagjuM gXumH1FO4MyGZHUghupBANFj6RfoucTt3/o+fCc+XaGAamEWhO7GXe3HXBg4nRo77nxF muvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=brFnAQBT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o24si29690411pgh.375.2019.06.05.10.29.11; Wed, 05 Jun 2019 10:29:28 -0700 (PDT) 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=@google.com header.s=20161025 header.b=brFnAQBT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726704AbfFER1o (ORCPT + 99 others); Wed, 5 Jun 2019 13:27:44 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:43623 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbfFER1o (ORCPT ); Wed, 5 Jun 2019 13:27:44 -0400 Received: by mail-pg1-f194.google.com with SMTP id f25so12759317pgv.10 for ; Wed, 05 Jun 2019 10:27:44 -0700 (PDT) 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=T3Lwn5KZOUsmk/CRmt27tCNdDcr83HnHWyJ2IYSv5hU=; b=brFnAQBTHCmizluyZdMy/yCOBe4bRtDcpPheZP3WtwvWtaQLm6jSU5flAYbI3SyF/X NsSQ9cLWedTCWdSwLhFp9cCmNYDn1Del4bCQMvTIPxMeiIbXKwTdUcquEn7WTs1H/8pa lZggkmglMEYZFLnYzbg4r0SSdLGRyY918JaArc+/bhECb+Tdsokcp6QeBaAkrLv+qIvU usqKESIHK+0J2y16O/WpW867KbjhpP01d840yg7p9JAjtqLrVM0QtS9ef+RzQ/42215F MSeK8RpwOE2dQadDwMNvwIbstYHxZdGNrn5MBBL1t2TFeoaFDeEz2zmsQMBr6XVOgwep mFww== 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=T3Lwn5KZOUsmk/CRmt27tCNdDcr83HnHWyJ2IYSv5hU=; b=AxGMi90AljRb9ICd5AV+00C2UvddoNzXlppvpuAXjq1Ik8P4DWgWY9swOxQMjFFe+k DB8bVZe/1kVLCFdK03RKJ00fBQ94EDyMRWuaypySktUZ0Tt1tkJSy0DZxHyz4aGoMCSP VdGYSZ2QD0q3LoCw46RR/Uq2F2BcgdI3zebqwnA3vdGIOaePo13SPsNTMPt9BwV4BQ/m BfwvXhIFp+EmrOcX/6/mreRWZdEa2TdYcyHU4/K/kvjaYk8uLmsp0kKYY4afbbu1rbvD cBeL9pBbApG3mUGyiRna16dWUmcJvVnyhfrJmoA1DNhacq/LYBorXPG5u7CI878KAQLN CtcQ== X-Gm-Message-State: APjAAAVe61OPZzvtv/68N6/WrdzoFit0Cm4F+ZJK0CGese6jXtf6Hc8W HZBH5K5AqXRwGXfi8tT9cshQjc2XRfLmxP5rEOfQzQ== X-Received: by 2002:a62:1b85:: with SMTP id b127mr48116131pfb.165.1559755663352; Wed, 05 Jun 2019 10:27:43 -0700 (PDT) MIME-Version: 1.0 References: <779905244.a0lJJiZRjM@devpool35> <20190605162626.GA31164@kroah.com> In-Reply-To: <20190605162626.GA31164@kroah.com> From: Nick Desaulniers Date: Wed, 5 Jun 2019 10:27:32 -0700 Message-ID: Subject: Re: Building arm64 EFI stub with -fpie breaks build of 4.9.x (undefined reference to `__efistub__GLOBAL_OFFSET_TABLE_') To: Greg KH Cc: Rolf Eike Beer , Ard Biesheuvel , Linus Torvalds , Matt Fleming , Peter Zijlstra , Thomas Gleixner , linux-efi@vger.kernel.org, Linux Kernel Developers List , "# 3.4.x" , Matthias Kaehlcke 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, Jun 5, 2019 at 9:26 AM Greg KH wrote: > > On Wed, Jun 05, 2019 at 05:19:40PM +0200, Rolf Eike Beer wrote: > > I decided to dig out a toy project which uses a DragonBoard 410c. This has > > been "running" with kernel 4.9, which I would keep this way for unrelated > > reasons. The vanilla 4.9 kernel wasn't bootable back then, but it was > > buildable, which was good enough. > > > > Upgrading the kernel to 4.9.180 caused the boot to suddenly fail: > > > > aarch64-unknown-linux-gnueabi-ld: ./drivers/firmware/efi/libstub/lib.a(arm64- > > stub.stub.o): in function `handle_kernel_image': > > /tmp/e2/build/linux-4.9.139/drivers/firmware/efi/libstub/arm64-stub.c:63: > > undefined reference to `__efistub__GLOBAL_OFFSET_TABLE_' > > aarch64-unknown-linux-gnueabi-ld: ./drivers/firmware/efi/libstub/lib.a(arm64- > > stub.stub.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol > > `__efistub__GLOBAL_OFFSET_TABLE_' which may bind externally can not be used > > when making a shared object; recompile with -fPIC > > /tmp/e2/build/linux-4.9.139/drivers/firmware/efi/libstub/arm64-stub.c:63: > > (.init.text+0xc): dangerous relocation: unsupported relocation > > /tmp/e2/build/linux-4.9.139/Makefile:1001: recipe for target 'vmlinux' failed > > -make[1]: *** [vmlinux] Error 1 > > > > This is caused by commit 27b5ebf61818749b3568354c64a8ec2d9cd5ecca from > > linux-4.9.y (which is 91ee5b21ee026c49e4e7483de69b55b8b47042be), reverting > > this commit fixes the build. > > > > This happens with vanilla binutils 2.32 and gcc 8.3.0 as well as 9.1.0. See > > the attached .config for reference. > > > > If you have questions or patches just ping me. > > Does Linus's latest tree also fail for you (or 5.1)? > > Nick, do we need to add another fix that is in mainline for this to work > properly? > > thanks, > > greg k-h Doesn't immediately ring any bells for me. +mka@ who helped test 91ee5b21ee026c49e4e7483de69b55b8b47042be. Nothing in that series (https://lore.kernel.org/lkml/20170818194947.19347-5-ard.biesheuvel@linaro.org/T/#u) is immediately obvious. Rolf, can you please email me your config so I can see if I can reproduce? Also, which version of GCC are you using, and binutils? (would be good to know if you hit this in mainline too, as if not maybe there's an existing fix to be backported to stable). -- Thanks, ~Nick Desaulniers