Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7859479ybi; Thu, 6 Jun 2019 02:42:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3lYJhJVprWtmu6Jn81MQ1G2btUzQpqjkPfu0+C1R8/g3OlRcCmmDNkz55LsicjWEIJH1K X-Received: by 2002:a62:764d:: with SMTP id r74mr29104919pfc.110.1559814151984; Thu, 06 Jun 2019 02:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559814151; cv=none; d=google.com; s=arc-20160816; b=akB6lbEQ/eXRRkqoFn9mPFazi57EnF3IYoIYNJSMwOs8AKBhDsHxpB/GkJ3vXjNQ16 QKiIeXyiiijJyBPUrJ+IEa8qL9ljjqjd1rJ0Rz4RReyH4igfTxNbBAfAPDCf+r5Pl6vi l9dpKsV3TeTHTkQ35N8qxwuJw3a9aH2lwmKOfFiV13+o+zAOjsU5zn3PdSADRTM6TPZl I4hlTCiWB0tnghmTmG5gUtR/8pfAHfyesAm+nGXoD4MS/PmErQsgMecGjw1IMIeXrV9K j89Qm1gSXApRZTRC1r0yxMko721qzJWudVCJZuSdyKylltaLT+CXLE0UUtpIe8KKtRYR 74Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :organization:message-id:date:subject:cc:to:from; bh=wQVLbgtjBtT7qv3m4RlaLRL+VTvVIGWEWfGAsAFIjMo=; b=Ip24Vib1hvxnGjLZIzxigWzSQi0XxBCWuK2JwWayx4/jvU/nUM5ok8coXxpCj9UbLE MfYlsc5AZNozR8ecIvETXsnNykBhEzg/6mytKflE24c1Pu8JKkhG+IxxZxx0pH1oXCqk 7mtnJzPXOxH8t1KIxNFQFc9Y8mTiBaICxMWYWcNYK2VyfLlbQ7HQM2F6GS/b1x6Khr0i vXpC23HeUhJKk3+wd694AfTfpWKXIodI3G6//8GyEgyUPw2r6jqLdSjQAKviYQaM6HWK g4s9EZm+DZdTDx+FPDIY0PCe55HOvYyTtcHNHHirwNxDvHyuhOeFnyUvTAdO42AID5rM mx9Q== ARC-Authentication-Results: i=1; mx.google.com; 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 u25si1464530pfh.45.2019.06.06.02.42.15; Thu, 06 Jun 2019 02:42:31 -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; 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 S1727957AbfFFJlC (ORCPT + 99 others); Thu, 6 Jun 2019 05:41:02 -0400 Received: from mx1.emlix.com ([188.40.240.192]:36146 "EHLO mx1.emlix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727359AbfFFJlC (ORCPT ); Thu, 6 Jun 2019 05:41:02 -0400 Received: from mailer.emlix.com (unknown [81.20.119.6]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id 6503E600A1; Thu, 6 Jun 2019 11:40:59 +0200 (CEST) From: Rolf Eike Beer To: Ard Biesheuvel Cc: Greg KH , Nick Desaulniers , Linus Torvalds , Matt Fleming , Peter Zijlstra , Thomas Gleixner , linux-efi , Linux Kernel Developers List , stable Subject: Re: Building arm64 EFI stub with -fpie breaks build of 4.9.x (undefined reference to `__efistub__GLOBAL_OFFSET_TABLE_') Date: Thu, 06 Jun 2019 11:40:55 +0200 Message-ID: <2433398.iiuBUrR0On@devpool35> Organization: emlix GmbH In-Reply-To: References: <779905244.a0lJJiZRjM@devpool35> <1993275.kHlTELq40E@devpool35> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1867592.6WJ3IrGa0d"; micalg="pgp-sha256"; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart1867592.6WJ3IrGa0d Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Ard Biesheuvel wrote: > On Thu, 6 Jun 2019 at 09:50, Rolf Eike Beer wrote: > > Am Donnerstag, 6. Juni 2019, 09:38:41 CEST schrieb Rolf Eike Beer: > > > 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. > > > > >=20 > > > > > Upgrading the kernel to 4.9.180 caused the boot to suddenly fail: > > > > >=20 > > > > > 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-st= ub. > > > > > c:63 > > > > >=20 > > > > > undefined reference to `__efistub__GLOBAL_OFFSET_TABLE_' > > > > > aarch64-unknown-linux-gnueabi-ld: > > > > > ./drivers/firmware/efi/libstub/lib.a(arm64- stub.stub.o): relocat= ion > > > > > R_AARCH64_ADR_PREL_PG_HI21 against symbol > > > > > `__efistub__GLOBAL_OFFSET_TABLE_' which may bind externally can n= ot > > > > > be > > > > > used when making a shared object; recompile with -fPIC > > > > > /tmp/e2/build/linux-4.9.139/drivers/firmware/efi/libstub/arm64-st= ub. > > > > > c:63 > > > > >=20 > > > > > (.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 > > > > >=20 > > > > > This is caused by commit 27b5ebf61818749b3568354c64a8ec2d9cd5ecca > > > > > from > > > > > linux-4.9.y (which is 91ee5b21ee026c49e4e7483de69b55b8b47042be), > > > > > reverting > > > > > this commit fixes the build. > > > > >=20 > > > > > This happens with vanilla binutils 2.32 and gcc 8.3.0 as well as > > > > > 9.1.0. > > > > > See > > > > > the attached .config for reference. > > > > >=20 > > > > > If you have questions or patches just ping me. > > > >=20 > > > > Does Linus's latest tree also fail for you (or 5.1)? > > >=20 > > > 5.1.7 with the same config as before and "make olddefconfig" builds f= or > > > me. > >=20 > > Just for the fun of it: both 4.19 and 4.19.48 also work. > Could you please check whether patch > 60f38de7a8d4e816100ceafd1b382df52527bd50 applies cleanly, and whether > it fixes the problem? Thanks. The part in drivers/firmware/efi/libstub/arm-stub.c needs to be applied by= =20 hand, but afterwards things build fine. Eike =2D-=20 Rolf Eike Beer, emlix GmbH, http://www.emlix.com =46on +49 551 30664-0, Fax +49 551 30664-11 Gothaer Platz 3, 37083 G=C3=B6ttingen, Germany Sitz der Gesellschaft: G=C3=B6ttingen, Amtsgericht G=C3=B6ttingen HR B 3160 Gesch=C3=A4ftsf=C3=BChrung: Heike Jordan, Dr. Uwe Kracke =E2=80=93 Ust-IdNr= =2E: DE 205 198 055 emlix - smart embedded open source --nextPart1867592.6WJ3IrGa0d Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iLMEAAEIAB0WIQQ/Uctzh31xzAxFCLur5FH7Xu2t/AUCXPjfpwAKCRCr5FH7Xu2t /BzjA/9Pd3USy15vnfffsX50V3lfJ/gubyNSje0W25gGCPDqVoehWg/KfXRZea1s 0fPwkDaZ36+B1eQxa9PBqmYOm3+XcuM+/rOp1/7EBagM6SXZxlPzuIMgM4+i3+CG eq/Xgow6Dpz7ewh/OLubSZFoCN57J8e/VQTl2lTRMpDZh1+8dQ== =yAuE -----END PGP SIGNATURE----- --nextPart1867592.6WJ3IrGa0d--