From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 668D621A16ECB for ; Sun, 28 May 2017 05:13:10 -0700 (PDT) Received: by mail-it0-x230.google.com with SMTP id c15so15748058ith.0 for ; Sun, 28 May 2017 05:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ozo0WTC3uB5eQNCAiGacUUgFXMyvPqUbpYnQVc3n8Gs=; b=J5guSt/fey4vfzjGguI8V7ehLd2jDwOjsQfvspC7SSFLavEy05S54S/XWtnU/AxvGe IhsCFjPG2aOzFqq3Jq5SfDO/bcG8EGjiPT8GEHkD/oUdjpnOkGM4SmyipIdJbyfGs0aw rCBbUDkXq2nlkJr0TiiT7jefI7MaT+ixPQbTU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ozo0WTC3uB5eQNCAiGacUUgFXMyvPqUbpYnQVc3n8Gs=; b=ECBAOeQlBSFNtAM39jGxJ5qYDQKO652Lb8xX4RSfmiuSKYZv1Ceb7ng0IbwV3WDD8X IiVhMHYYYzG+lDLHMspTrT5Tvm/iJ4dfHgjBiSRgKlB7NqVgnye0ZvmTr+cIs/RRXvWz gFy+EcIDxU8OZmZL1KvFnj2FqAu6GmBnWoQsqMBWq4R798ua3IQLdM1ubh9hMwjXQvmO oxkkLgnEhxeb0NS7lgGpdaNsxfXFYeue94OMUHPQ+3tXjJiy8HIxVvUeYth19Ik1N8uV OuLl+9uTuutzpbLnKHcGo+FNpEz13MunJQWJ+O8ET3wWV5ZdZQA65e32HL1D1/0pFLxv hZHA== X-Gm-Message-State: AODbwcCslQEdr0kHhYn5JMABYDtgLCoaMTgwV8IoT1NNhuUEqww8v4X4 qdwlyT93DCUV0bPv4wu9h7RtKi9QVZx7zBw= X-Received: by 10.36.237.72 with SMTP id r69mr10453859ith.98.1495973646860; Sun, 28 May 2017 05:14:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.164.24 with HTTP; Sun, 28 May 2017 05:14:06 -0700 (PDT) In-Reply-To: <20170525212456.zxlmhaxvckemc3gv@xps13.dannf> References: <20170524202618.kgxxlewemfn4rpho@xps13.dannf> <20170525212456.zxlmhaxvckemc3gv@xps13.dannf> From: Ard Biesheuvel Date: Sun, 28 May 2017 12:14:06 +0000 Message-ID: To: dann frazier Cc: Leif Lindholm , Yonghong Zhu , Liming Gao , "edk2-devel@lists.01.org" Subject: Re: [PATCH v2] BaseTools/GCC ARM/AARCH64: Force disable PIE X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 12:13:10 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 25 May 2017 at 21:24, dann frazier wrote: > On Wed, May 24, 2017 at 03:27:07PM -0700, Ard Biesheuvel wrote: >> On 24 May 2017 at 13:26, dann frazier wrote: >> > v2: >> > * Replace -no-pie w/ -static for compat with GCC 4.9 >> > >> >> For my understanding, could you elaborate on what goes wrong if you >> omit -static / -no-pie? > > Well, nothing... now :) -static/-no-pie was avoiding an issue with GenFw: > > ----------- > "GenFw" -e SEC -o /tmp/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC49/AARCH64= /ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore/DEBUG/ArmPlatformPrePeiCore.ef= i /tmp/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC49/AARCH64/ArmPlatformPkg/Pr= ePeiCore/PrePeiCoreUniCore/DEBUG/ArmPlatformPrePeiCore.dll > GenFw: ERROR 3000: Invalid > WriteSections64(): > /tmp/edk2/Build/ArmVirtQemu-AARCH64/DEBUG_GCC49/AARCH64/ArmPlatformPkg/= PrePeiCore/PrePeiCoreUniCore/DEBUG/ArmPlatformPrePeiCore.dll > AARCH64 small code model requires identical ELF and PE/COFF section > offsets modulo 4 KB. > [...] > ----------- > > Upon rebase/retest, I found that this was no longer reproducible. > Bisection shows that the problem went away recently after this commit: > > commit 00b00cc57bfe0fca54c904d4dd44a263e243c88b > Author: Ard Biesheuvel > Date: Fri May 19 11:47:40 2017 +0100 > > BaseTools/Scripts: discard .gnu.hash section in GCC builds > > -*f*no-pie does still seem to be needed though. Without it, the ARM > build fails with: > > ----------- > "GenFw" -e DXE_DRIVER -o /tmp/edk2/Build/ArmVirtQemu-ARM/DEBUG_GCC49/ARM/= MdeModulePkg/Universal/Network/DpcDxe/DpcDxe/DEBUG/DpcDxe.efi /tmp/edk2/Bui= ld/ArmVirtQemu-ARM/DEBUG_GCC49/ARM/MdeModulePkg/Universal/Network/DpcDxe/Dp= cDxe/DEBUG/DpcDxe.dll > GenFw: ERROR 3000: Invalid > /tmp/edk2/Build/ArmVirtQemu-ARM/DEBUG_GCC49/ARM/MdeModulePkg/Universal/= Network/DpcDxe/DpcDxe/DEBUG/DpcDxe.dll: Bad definition for symbol '_GLOBAL_= OFFSET_TABLE_'@0x5e94 or unsupported symbol type. For example, absolute an= d undefined symbols are not supported. > ----------- > Meh. That is actually quite annoying. For AARCH64, we simply haven't implemented the GOT related ELF relocations in the ELF to PE/COFF converter, so there we cannot deal with PIC code involving GOT entries at all. For ARM, the only roadblock appears to be that __GLOBAL_OFFSET_TABLE__ is emitted as SHN_ABS (which makes no sense at all given that it points into the image, which makes it relative like any other symbol reference). In any case, could you please drop the -static and respin? Thanks.