Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6993142ybi; Wed, 5 Jun 2019 09:28:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqmBtU0fv5R4RTY8qHQe1RynZiMg1ocAuyCloUrmgEh04BXn29+B44UbobwMJR7g/92com X-Received: by 2002:a17:902:848c:: with SMTP id c12mr44171085plo.17.1559752081341; Wed, 05 Jun 2019 09:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559752081; cv=none; d=google.com; s=arc-20160816; b=RtwcPzCobmVukH4hLwfCb2aUvtSuauMijNVeK6HiuVcrNHIdiNi//Ah+3nIrechixP U8qVtPxVLkb9sebnUXjyo06Bb+yAzAeZYlE/MwOkgsOX+fT/wFjV1r/R/ryE2EG+SUi2 XpwxYcJH+p68mNH9LFoT6DSYphFSW2BPoLuKrKe4K1bGw8xokjzMJUcKL0pnyqTcFQm5 e6Eb/UkNPAhI3HUXhYWGVPy8pBAbpP4O//nxEmVIi1IfclyqZAXHO3j+Ryk2+RubYD+r aZje4B1aohkpEPzIFjcsE8F7DKi3gxeO6/B417OGDQAX9coRa7SN8iMvF+ULva3eg4wq b9rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HPE9kUHlPGhHtOmIYj+s3gGNCsz6JpBBGA1ljIt3Ujs=; b=lTMippyjvCGfvOCJFIks24GuU+zQHqb2ZB63vz/+LMYKS1ZWVp52AFIofZXgqwDlwP Mw89JM9ox1LigULWVK/ICfUaThRJxrAsxqVgAI4BbwzgERRgpLt/vTBXvMzgnKBiawS8 8IqE1tVkLCQUB9dQ2wfMSp8vCEYet8SnUtJ6w6IxP8YxfkBp5gCb2zayHRCrik9GAbpM +KFJTDeknaQPITcTy24R35TtPgtqlSU0Q5+8JILkqmb31fX/uPj6JcB8vqWVFN77Erf/ DvZLTmH4CDwA/6voVHIiY9p7crm8DDAaDqwliYAvnDad02k89exFmCpYM8rZtioQBMHC 7HdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=g70kvZ4h; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si15504597plp.304.2019.06.05.09.27.44; Wed, 05 Jun 2019 09:28:01 -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=@kernel.org header.s=default header.b=g70kvZ4h; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728665AbfFEQ0a (ORCPT + 99 others); Wed, 5 Jun 2019 12:26:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:51062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726670AbfFEQ0a (ORCPT ); Wed, 5 Jun 2019 12:26:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 28E37206C3; Wed, 5 Jun 2019 16:26:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559751989; bh=RRuTmiiCL4ohzUXB1ETCVXEBTEd5MWjinBA96qt0pQU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g70kvZ4hhkO9JA7ZPvRvgVMal9GJL5Xzl89Bc4OOuz56PxzyGYFmwuNsefODsCtjX Za+YWKrYj4KvkKj9Hj92BxVEVwwwblgV7qR7NRrVAnJ8gj/yWUlplWQvU4wSj02WqD Qqer/L58HwWoxDc2SjM0ukfHKXRb/KUHBp6zkoLE= Date: Wed, 5 Jun 2019 18:26:26 +0200 From: Greg KH To: Rolf Eike Beer , Nick Desaulniers Cc: Ard Biesheuvel , Linus Torvalds , Matt Fleming , Peter Zijlstra , Thomas Gleixner , linux-efi@vger.kernel.org, Linux Kernel Developers List , stable@vger.kernel.org Subject: Re: Building arm64 EFI stub with -fpie breaks build of 4.9.x (undefined reference to `__efistub__GLOBAL_OFFSET_TABLE_') Message-ID: <20190605162626.GA31164@kroah.com> References: <779905244.a0lJJiZRjM@devpool35> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <779905244.a0lJJiZRjM@devpool35> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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