From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=RpQUrb6k; spf=pass (domain: linaro.org, ip: 209.85.221.66, mailfrom: ard.biesheuvel@linaro.org) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by groups.io with SMTP; Thu, 05 Sep 2019 10:07:12 -0700 Received: by mail-wr1-f66.google.com with SMTP id h7so2646744wrw.8 for ; Thu, 05 Sep 2019 10:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UttjN31wr61Goe3m+eZ3qildVa0AuGi3PPZBXzDL1m8=; b=RpQUrb6kTQF4532xI9HmGq0cR9Ogq7joVmVS5p+mIZJpxUM0Jvm+RXBkyWSpU3y86k olgpWgYHLDw/cVAMdRQLPnzjnRxj0ramCs/zm7SPD944qJivEHWSilGUWDddXPjs+UAB aOSgr8PcF1SBMGs1etUxVcd3Hq1XwnLNbwm5ypNWpkcKZu6jw8uMxwISAzD8erTv21/d e1r4dRufdRcAKTco9Yee7sa59GjHpfy+Kn615r55K1h2lx+pLW7LewAYgzYbO1JQca9N ZTyCSgd8mD2YpqeCRaSXXxvvJ5sbpkxMcqKHrGBEwhJaE6Ht3hULbqlos01Wh+VcOFlH vX3w== 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=UttjN31wr61Goe3m+eZ3qildVa0AuGi3PPZBXzDL1m8=; b=ZVoKb83SFBaq9uXPdn+u8KzKkWwBu3X/sSpBzSONdanbveFFCt4p8Xs7FZ2cxYt0gr P1sTd5+VSsHWgbel9DxmpY+NP9qf3FuHAo8+3Zc26mH2R6oOgVS5FQuXk5ll7i5IImGY 3uWfHyGsBLQPwgIWib/37NuPwrLrI9RB0JHy4nR3DMMYqBDoEhaBOBqFhHM9/gu/BUQ1 s1mpIn9/r1N1rSzu/qJOpZpmbZsYBLwVC3bHGnYBtdz20OzIAEUPc41ndpZ786BVqlzX ghWBB3hFYE1t4mH6jr3ZHb0peJukfz3kRVVznKOP0H/Wt1x1ARcSprq7m5zXbbl3BU3q bUPg== X-Gm-Message-State: APjAAAUw6Y1ZUXXgzAnBW/GGG50569LDrJHr31gUf+UHnfMLPQ3murFo m2bACydyyLKDlujfx2SGcf4Ovl9QtY0bfg/0lKCsmA== X-Google-Smtp-Source: APXvYqxM0+X2JPoWY15Lra5egP16zKe0qo4ApDzHjuFesDwrx8ibk2K0BCk2aWz3MMlYinf1DXzSUZtJOxJOAZiCaiY= X-Received: by 2002:adf:ec48:: with SMTP id w8mr3445662wrn.198.1567703230544; Thu, 05 Sep 2019 10:07:10 -0700 (PDT) MIME-Version: 1.0 References: <20190904230423.24661-1-ard.biesheuvel@linaro.org> <20190905141923.GX29255@bivouac.eciton.net> <20190905155556.GD29255@bivouac.eciton.net> In-Reply-To: <20190905155556.GD29255@bivouac.eciton.net> From: "Ard Biesheuvel" Date: Thu, 5 Sep 2019 10:06:56 -0700 Message-ID: Subject: Re: [PATCH] ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: revert to PIE linking To: Leif Lindholm Cc: edk2-devel-groups-io , Laszlo Ersek Content-Type: text/plain; charset="UTF-8" On Thu, 5 Sep 2019 at 08:55, Leif Lindholm wrote: > > On Thu, Sep 05, 2019 at 07:25:39AM -0700, Ard Biesheuvel wrote: > > > > [BuildOptions] > > > > - GCC:*_*_*_DLINK_FLAGS = -shared -Wl,-Bsymbolic -Wl,-T,$(MODULE_DIR)/Scripts/PrePi-PIE.lds > > > > + GCC:*_*_*_DLINK_FLAGS = -Wl,-Bsymbolic,-pie,-T,$(MODULE_DIR)/Scripts/PrePi-PIE.lds > > > > > > We already merged a fix for AARCH64 though - could/should this be > > > active on ARM only? > > > > > > A problem I have with this patch is that ArmVirtQemuKernel curently > > > doesn't boot on my qemu (with/without kvm, built with GCC5 or CLANG38, > > > with or without this patch): > > > ProcessPciHost: Config[0x4010000000+0x10000000) Bus[0x0..0xFF] > > > Io[0x0+0x10000)@0x3EFF0000 Mem32[0x10000000+0x2EFF0000)@0x0 > > > Mem64[0x8000000000+0x8000000000)@0x0 > > > MapGcdMmioSpace: failed to set memory space attributes for region > > > [0x4010000000+0x10000000) > > > > > > ASSERT_EFI_ERROR (Status = Unsupported) > > > ASSERT [PciHostBridgeDxe] > > > /work/git/edk2/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c(293): > > > !EFI_ERROR (Status) > > > qemu-system-arm: terminating on signal 15 from pid 4680 (killall) > > > > > > > Does it work with -M virt,highmem=off ? > > Ah, yes - that works fine then, also with the patch. > > Well, with that, and your explanation in the other thread: > Acked-by: Leif Lindholm Thanks. I am going to replace the last paragraph of the commit log with Note that in this particular case, we are interested in PIE linking only (i.e., producing a .rela section containing dynamic relocations that the startup code can process directly), and not in position independent code generation, and by passing the -pie option to the linker directly using -Wl,-pie (and dropping -shared), we can coerce the GOLD linker into doing only the former rather than both when it performs its LTO code generation. and push (unless you have any objections)