Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7079790ybi; Wed, 5 Jun 2019 10:52:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrC+NX+QWwwfhWO7Tuhxj+12wWxMSftnu3ExJgG5mGvf1xft5pNnKya/Ez7z/6leQYw2WX X-Received: by 2002:a17:902:29c8:: with SMTP id h66mr45503208plb.269.1559757126123; Wed, 05 Jun 2019 10:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559757126; cv=none; d=google.com; s=arc-20160816; b=Y9o6yQO4WJ0AwZ9pS7CVjbLFD70aWf2If4R+DdmrjlaoyBTTkDHolElCZXPVErLvhJ 4uOD/t5ac16PS2/AiR6/kvj2NQnVvt5zhqBKI2tCYeMdVWNIcZ6vx7wX/jIS0Bjl1Gtm YO8Uga1fhrgLaV3lJyvtvYMdvYO9SY8opQWUQgnp22DAgR7lqcw/t5U++EBkgZKdqIti DzKZGG3ccYQuwOXbaadZz14gmvi6r0qc5sBRHkNOcoqw8FP3blESOG8De4qbETfbE1eH tqFRlbhIc39C5KUFoX3WQQMLLFiwfRYJVSAUvp2K3C5xi1gLDGIkyLj6fOHMfPWaMaxr mYrQ== 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=69gfPapSEdMi+yvUYn9H/fvtRsee0abVJTNm1kq4LuQ=; b=nnSFZbjeXf4ObgHx97IbDZLCfGxPpoBSEstwdMrpP60iP1nMRyKO5gaKT4x79jCux5 292YsG9ftZyTvbznT8OSd0ne4NChLFuMJsR8rE2DVlp0HXA5dQXHlWogcdS+puyomU0W /Bh7T+t001657NL6dtVZxj0YmaW7xcHOJW2gqoBkh+Z0/McZ5fO5Y1/XTT8b37KAIJQt Yn9Ty9UUiiJw6Fi1OzkKJlRHDov9g85+dP6Q6IS9sKsNUUH+N8fOBuull5kXhpWSk2vG E570eupy1BTvj+GNp3K7BieGQxXEJOtR0Ovk4WcfMKRQ8ra2XUBYY4RY3CHX8egr/qby 0b1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pBEWo0Nc; 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 h5si27807680plt.232.2019.06.05.10.51.49; Wed, 05 Jun 2019 10:52:06 -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=pBEWo0Nc; 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 S1726658AbfFERud (ORCPT + 99 others); Wed, 5 Jun 2019 13:50:33 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:32849 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbfFERub (ORCPT ); Wed, 5 Jun 2019 13:50:31 -0400 Received: by mail-pl1-f196.google.com with SMTP id g21so9970572plq.0 for ; Wed, 05 Jun 2019 10:50:31 -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=69gfPapSEdMi+yvUYn9H/fvtRsee0abVJTNm1kq4LuQ=; b=pBEWo0NcAk4QU02NxTDdbliP+YTRia8y0ucJJGA7LQ27Dml7fTz0Jj7L+hvksvcg2l +6IqellipsEcoKmeMDdrTqJFm7m0lWacCdNP/p+k0ieaT5Y+8FFdYD3/7betJZ0yMFTR FgJBwbPs28J/ge+AbH9zZeGFNqKupC2AzM0Mm0nWibG0fHrmi7G7q5eBkZjYo0xkr+uc oonNEwzsr1anDnJzm4Md4Wd0hsQklfvAAxHZKgH3bGpylKvdpqtbFRId2W5hfa5wESvZ 26WDbHB3TtkefLuqlQ/90mBXhDsrtvXIydkK9xsU6eOy+gWFaMHbAJ5e07OOGRWsKOw9 SEyg== 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=69gfPapSEdMi+yvUYn9H/fvtRsee0abVJTNm1kq4LuQ=; b=YBAYpPEefCD45SPnMupGlbdax1n3hXxLrticVDbt6shtEwsAVS8nJOOxa34HbwsIMl dP+Kg8fvKoJk3oPy5A+Ue9FkjE/FCconxN9enrOh70HmO0N+5vLiqwZhVK5AR4NuH/Qc vV5iUz2lsVJhQoiysaApsCmQcASaqWgydZ44DcGyofxiu7P6gBuJxZXH3HMsj+yj2bhx IwIQlgVYPoAmfNFW2TLwUt7IdoFdNRQLfhfq9KuPfZRD80e2hlWYPLgMYzE0Nlse4aSn SDaqn/AWyoxiloxuawhUC6v87lbThbkOmh7xa/V5uEYHr92Q9Tj6umnd5SJpP2C3d31H MbGw== X-Gm-Message-State: APjAAAXk11+WrO1wVleoixf3aoaHSgiGQWmSToeyBG/tN2OIwanstkIe Dvj2mr715iJ8JZUj+mcQY8ium/Er6bBLYn6wRw2t6g== X-Received: by 2002:a17:902:b696:: with SMTP id c22mr43639929pls.119.1559757030282; Wed, 05 Jun 2019 10:50:30 -0700 (PDT) MIME-Version: 1.0 References: <779905244.a0lJJiZRjM@devpool35> <20190605162626.GA31164@kroah.com> In-Reply-To: From: Nick Desaulniers Date: Wed, 5 Jun 2019 10:50:19 -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 , clang-built-linux 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 10:27 AM Nick Desaulniers wrote: > > 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. Upstream commits: dd6846d77469 ("arm64: drop linker script hack to hide __efistub_ symbols") 1212f7a16af4 ("scripts/kallsyms: filter arm64's __efistub_ symbols") Look related to __efistub__ prefixes on symbols and aren't in stable 4.9 (maybe Rolf can try cherry picks of those). -- Thanks, ~Nick Desaulniers