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

Re: [Xen-devel] [PATCH 3/4] x86/linker: add a reloc section to ELF binary


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 19 Jun 2019 16:30:27 +0200
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@xxxxxxxxxx; spf=Pass smtp.mailfrom=roger.pau@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Wei Liu <wl@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Wed, 19 Jun 2019 14:30:39 +0000
  • Ironport-sdr: YnxHfFtdX0YUMBbupop5zms6sMWm7xBSKPoolb6PwaGp92rNRrKUI+ilCjddIGRxeiYsz4dq9B 8EYA9Wdtq90t13obbARJxxKj6+mnpd7TC6ecvLBZ31Rq0R36siWSVDQFbCm24SzRJu/QEkAlz4 zmyiRO4LIgSNGT5hUbJpvv3HxLiEi32GxesC++t6ZQaKmWB2/O9IDfW7XCBwGqfIZJXlUX3dn1 sS9+JuH50DT26MuLZz3Y29zR3IR7DrlGgJeDKnC7f52ZnFklr/mjryQfHps9soZH84kTCef5/u qhM=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Jun 19, 2019 at 12:20:40PM +0100, Andrew Cooper wrote:
> On 19/06/2019 12:02, Roger Pau Monne wrote:
> > If the hypervisor has been built with EFI support (ie: multiboot2).
> 
> Seeing as this continues the sentence from the subject, it should start
> without a capital.  Otherwise the result is werd to read.
> 
> > This allows to position the .reloc section correctly in the output
> > binary, or else the linker might place .reloc before the .text
> > section.
> 
> Really?  How can this be a legitimate transformation for the linker to make?

I've already submitted a bug report:

https://bugs.llvm.org/show_bug.cgi?id=42327

GNU ld behaviour is to place orphaned sections at the end.

> >
> > Note that the .reloc section is moved before .bss for two reasons: in
> > order for the resulting binary to not contain any section with data
> > after .bss, so that the file size can be smaller than the loaded
> > memory size, and because the data it contains is read-only, so it
> > belongs with the other sections containing read-only data.
> 
> The content of .relocs is transformed via mkreloc to become
> __base_relocs_{start,end} and shouldn't exist into the final linked
> image AFAICT.

__base_relocs_{start/end} is actually what's contained in the .relocs
section, or at least that was mny impression based on the contents of
xen/arch/x86/efi/relocs-dummy.S

> Since the MB1/MB2 builds aren't relocatable, I think we might be able to
> get away with simply excluding them in the non-EFI build.

Hm, OK. I'm slightly loss then. I've taken a look at the history of
xen/arch/x86/efi/relocs-dummy.S and it's not clear to me why such a
dummy file was added. My guess is that it's done in order to prevent
missing symbols errors. If that's the case I guess the code that makes
use of such symbols can be guarded, and the dummy file removed?

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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