[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/EFI: suppress GNU ld 2.36'es creation of base relocs


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 22 Feb 2021 16:36:56 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=igvHt88+y0PxeuZPTsv7W3aUySGlin14FYCjRGWRSMQ=; b=Gcxn2hOVoFkANg5BczBtG+19OwFLfNchJzgRJ2mUjskcg+njK3Fp+MISo15vZRNzvzB0r9M7y0hljWd2F7Q3LgUcMvl/0qrIoInA7aUlTUDWJKM1s76eznUMLnuoikQkvUQj5/Pm3v1MaLiwzyOn1vRPXax1UZVo9YA6VXaBy8znNRejRxB4Qc5R6m54bz1WzIwG6TCkCN2w3JmqD4Hr12U4zCSCvyF4atBDwwtLrqDhoeAAOY9aA9sFvU8l+PXRfrlcI1t09DXWOZsilJA1ZYWYFDtpBE8MYP1eQhdF+sH9sidE39lwBPlaDA253KNuRL0yfB2sr4W4Rg1NoDvCNA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GfxlvWRwlQHr6IgDGhGjvYlomkzFXpRrgq4ganAoN61LASLKtdU5AjdypBFRgIIYRMMV//4nyJzN9ZSuC//aXE7TdBUviSYk2hbWx533wW/JDcOCRj68wGUBcd24RJNBvL7hxs/5mQuJ7OVEsqVGMegZyRb3teig6conQMrVEXGWOOzWRuI/IAruUGZqpKyF5o6dHy0XSKDHngVHahoAo5wYnvM5bzx4Z5GJFNIOjU8vkfP4HCgfHaWyPc29irYMRHPUalEkDzLl+ZBI4CBHjwLhrEcZFzsnOd9DDx/XCPQh/g8hyg/Kq7DhGoncFkFNqjTZY5NdfjxulZRUIW5orQ==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 22 Feb 2021 16:37:15 +0000
  • Ironport-sdr: Jggs+ESgMP3fPHTF3L32ZHyCfkkkZ6CdBchiNHwNJiy10eeFxaC4316lFVyJLBXkWLXCpKBBwM uT17aEQXtY5SdLuHVdv/pfEDMdtXK3MeFG85tHhfur3UbJgyprfuyAANdPzod4be0Mu5flvW6c Ui+TcGqriSsMfpaQL4QsOsMTHsdRFC+hkHpuoJ2YiRpN4oPk9mbbxy5lMCiqHK1KTv/h33A5Q6 hjqK22mc1BY4vPs9Ywr6V/X0Ch7O6EEdCVmK9g4ySTSVZz73Iac+RxanOUuTVXJB4qqwJMSi1P ISU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19/02/2021 08:09, Jan Beulich wrote:
> All of the sudden ld creates base relocations itself, for PE
> executables - as a result we now have two of them for every entity to
> be relocated. While we will likely want to use this down the road, it
> doesn't work quite right yet in corner cases, so rather than suppressing
> our own way of creating the relocations we need to tell ld to avoid
> doing so.
>
> Probe whether --disable-reloc-section (which was introduced by the same
> commit making relocation generation the default) is recognized by ld's PE
> emulation, and use the option if so. (To limit redundancy, move the first
> part of setting EFI_LDFLAGS earlier, and use it already while probing.)
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>
> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -123,8 +123,13 @@ ifneq ($(efi-y),)
>  # Check if the compiler supports the MS ABI.
>  export XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o 
> efi/check.o 2>/dev/null && echo y)
>  # Check if the linker supports PE.
> -XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 
> -S -o efi/check.efi efi/check.o 2>/dev/null && echo y))
> +EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(XEN_LDFLAGS)) --subsystem=10 
> --strip-debug
> +XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) $(EFI_LDFLAGS) -o 
> efi/check.efi efi/check.o 2>/dev/null && echo y))
>  CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
> +# Check if the linker produces fixups in PE by default (we need to disable 
> it doing so for now).
> +XEN_NO_PE_FIXUPS := $(if $(XEN_BUILD_EFI), \
> +                         $(shell $(LD) $(EFI_LDFLAGS) 
> --disable-reloc-section -o efi/check.efi efi/check.o 2>/dev/null && \
> +                                 echo --disable-reloc-section))

Why does --strip-debug move?

What's wrong with $(call ld-option ...) ?  Actually, lots of this block
of code looks to be opencoding of standard constructs.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.