All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH 6/8] x86/EFI: avoid use of GNU ld's --disable-reloc-section when possible
Date: Thu, 22 Apr 2021 12:42:44 +0200	[thread overview]
Message-ID: <0e102d7d-d633-7865-ea03-5d56238fb3c3@suse.com> (raw)
In-Reply-To: <YIEkPorW1vEibACD@Air-de-Roger>

On 22.04.2021 09:22, Roger Pau Monné wrote:
> On Wed, Apr 21, 2021 at 05:34:29PM +0200, Jan Beulich wrote:
>> On 21.04.2021 17:20, Roger Pau Monné wrote:
>>> On Wed, Apr 21, 2021 at 02:03:49PM +0200, Jan Beulich wrote:
>>>> On 21.04.2021 12:21, Roger Pau Monné wrote:
>>>>> On Thu, Apr 01, 2021 at 11:46:44AM +0200, Jan Beulich wrote:
>>>>>> @@ -189,7 +208,11 @@ EFI_LDFLAGS += --no-insert-timestamp
>>>>>>  endif
>>>>>>  
>>>>>>  $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p')
>>>>>> +ifeq ($(MKRELOC),:)
>>>>>> +$(TARGET).efi: ALT_BASE :=
>>>>>> +else
>>>>>>  $(TARGET).efi: ALT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A ALT_START$$,,p')
>>>>>
>>>>> Could you maybe check whether $(relocs-dummy) is set as the condition
>>>>> here and use it here instead of efi/relocs-dummy.o?
>>>>
>>>> I can use it in the ifeq() if you think that's neater (the current way
>>>> is minimally shorter), but using it in the ALT_BASE assignment would
>>>> make this differ more from the VIRT_BASE one, which I'd like to avoid.
>>>
>>> Sorry, I think I'm slightly confused because when the linker can
>>> produce the required relocations relocs-dummy variable is left empty,
>>> so it won't be added to $(TARGET).efi.
>>>
>>> But we still need to generate the efi/relocs-dummy.o file for the ELF
>>> build I assume?
>>
>> Not anymore (after "x86/EFI: redo .reloc section bounds determination").
>> We need it, as said, to fish VIRT_BASE out of it. It indeed wouldn't get
>> linked into any of the final binaries anymore.
> 
> Could you please add some text to the commit message to note that
> while relocs-dummy is not linked into the final binary it's still
> needed to get VIRT_BASE?

I've added

"Note that in the case that we leave base relocation generation to ld,
 while efi/relocs-dummy.o then won't be linked into any executable
 anymore, it still needs generating (and hence dependencies need to be
 kept as they are) in order to have VIRT_BASE pulled out of it."

> With that:
> 
> Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks.

> FWIW, it would also be nice to add some comments to the $(TARGET).efi
> target commands, as it's quite impenetrable right now.

Well, my preferred plan was to pull it (and $(TARGET)-sym's) apart
into separate steps, suitably linked together via dependencies. This
may not eliminate altogether the need for some comments, but we then
may get away with brief ones.

Jan


  reply	other threads:[~2021-04-22 10:43 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  9:43 [PATCH 0/8] x86/EFI: build adjustments Jan Beulich
2021-04-01  9:44 ` [PATCH 1/8] x86/EFI: drop stale section special casing when generating base relocs Jan Beulich
2021-04-01 11:51   ` Andrew Cooper
2021-04-01  9:44 ` [PATCH 2/8] x86/EFI: sections may not live at VA 0 in PE binaries Jan Beulich
2021-04-01 12:01   ` Andrew Cooper
2021-04-01 13:51     ` Jan Beulich
2021-04-21  8:52   ` Roger Pau Monné
2021-04-21 10:32     ` Jan Beulich
2021-04-21 12:57       ` Roger Pau Monné
2021-04-21 13:28         ` Jan Beulich
2021-04-01  9:45 ` [PATCH 3/8] x86/EFI: program headers are an ELF concept Jan Beulich
2021-04-21  9:11   ` Roger Pau Monné
2021-04-21 10:36     ` Jan Beulich
2021-04-21 14:21       ` Roger Pau Monné
2021-04-21 14:30         ` Jan Beulich
2021-04-01  9:45 ` [PATCH 4/8] x86/EFI: redo .reloc section bounds determination Jan Beulich
2021-04-21  9:46   ` Roger Pau Monné
2021-04-21 10:44     ` Jan Beulich
2021-04-21 14:54       ` Roger Pau Monné
2021-04-01  9:46 ` [PATCH 5/8] x86: drop use of prelink-efi.o Jan Beulich
2021-04-21  9:51   ` Roger Pau Monné
2021-04-01  9:46 ` [PATCH 6/8] x86/EFI: avoid use of GNU ld's --disable-reloc-section when possible Jan Beulich
2021-04-21 10:21   ` Roger Pau Monné
2021-04-21 12:03     ` Jan Beulich
2021-04-21 15:20       ` Roger Pau Monné
2021-04-21 15:34         ` Jan Beulich
2021-04-22  7:22           ` Roger Pau Monné
2021-04-22 10:42             ` Jan Beulich [this message]
2021-04-01  9:47 ` [PATCH 7/8] x86/EFI: keep debug info in xen.efi Jan Beulich
2021-04-21 11:15   ` Roger Pau Monné
2021-04-21 13:06     ` Jan Beulich
2021-04-21 15:30       ` Roger Pau Monné
2021-04-21 15:38         ` Jan Beulich
2021-04-22  8:14           ` Roger Pau Monné
2021-04-22 11:03             ` Jan Beulich
2021-04-22 14:56               ` Roger Pau Monné
2021-04-22 15:46                 ` Jan Beulich
2021-04-22 15:53                   ` Roger Pau Monné
2021-04-22 16:01                     ` Jan Beulich
2021-04-23  7:30                       ` Roger Pau Monné
2021-04-23  8:51                         ` Jan Beulich
2021-04-23 10:07                           ` Roger Pau Monné
2021-04-23 10:45                             ` Jan Beulich
2021-04-23 10:58                               ` Roger Pau Monné
2021-04-01  9:47 ` [PATCH 8/8] x86/EFI: don't have an overly large image size Jan Beulich
2021-04-21 11:18   ` Roger Pau Monné
2021-04-21 13:15     ` Jan Beulich
2021-04-15  9:53 ` Ping: [PATCH 0/8] x86/EFI: build adjustments Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0e102d7d-d633-7865-ea03-5d56238fb3c3@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.