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

Re: [PATCH for-4.15] elfstructs: add relocation defines for i386


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 24 Feb 2021 16:25:58 +0100
  • 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=7rf4THjaV32Kqcxxb+3mvPFGJP/HPmVlHwfGg8rvX54=; b=A+CV5soXthExcXgPu45AtQYlRRtoqgMnMKdWHGSuZwNgSfdodJrAxIRv1c+HXWXKrjj10aSkXrtVSqPwdQ63ePMmeC9BiEMtw9dJK/bTws+FdukgAF1Mh3pxMzypyvLcPksVR5bWCNtf1pcn9usor+9N2PjiI7Qq2sKobO/UZ6oUI3clqPqgc96uqEC89t3pII+nsmCgmp25a1dNe+6Yd3TJxkwVbRfesGNQ7LUguIR4mHDM7Yz9IRYjbCTDIZvbYfk6R6EoTUOk+yoesmiU0Xk2b3AlPKRcPB7mBD1Cnn8VfU4bYFoYcCBQK4oHsuaJaV6PPI6GgKE9UjapsxGAtA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H2opRxzn8zggQHq6cm1wa1v1wCp00XX1bP5bN2WTIf/qb8tu864lA7mFzkMup4fab237OHXjq6xEVdiM0cmZhASKVEFMJ2/2zJYzVM9OEYxjM65mVGblMUrRKHyQg7nrRPfO2eZjW59K86VA7zYLGJoy8dPcGHJLecYM7N+nefmPxBQr20ldrSBUlwLLRX6caxB4RUOYNXuedNRy8u2vUAasG0VZSVBe486KJAfJS5hqyy6BrCs/ICgmm/IqKZ5OaqhYJR0lKp880y1yrngE2F9m5jZQYGlYTpCmohMaBOOXfL3A2Si4Fb/yV86yLV35id2FKPfSkPG7sADAmyG7jg==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 24 Feb 2021 15:26:11 +0000
  • Ironport-sdr: xcXNY8ZZzFmGuxTgpieVIvZxNpYCgE7Q2Ww29819WviihNzH4ynGbXABmA/FW2sakKFt3SfbCr 1bebHiNJk4vaYyaGd7yNQvxmO58UzjGeEUZI5NSlo2gYcgP/aOHOXI+ev60aeD2muJg6K8sp0E d3MIA4RvBbl4+AzXpFZasH0X96nifZBZnIIwMSJ1l+fDPFqYtdU26fqvfZW75FKcujvuwKEIoE K5WOqe7dRDd6FNNafiMoi/VhP24KCLXDUhPHM9tmDjBi2XOHCHc140lm6uo00R5JDOFwUHekHy DN8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Feb 24, 2021 at 04:01:13PM +0100, Jan Beulich wrote:
> On 24.02.2021 15:58, Roger Pau Monne wrote:
> > Those are need by the rombios relocation code in hvmloader. Fixes the
> > following build error:
> > 
> > 32bitbios_support.c: In function 'relocate_32bitbios':
> > 32bitbios_support.c:130:18: error: 'R_386_PC32' undeclared (first use in 
> > this function); did you mean 'R_X86_64_PC32'?
> >              case R_386_PC32:
> >                   ^~~~~~~~~~
> >                   R_X86_64_PC32
> > 32bitbios_support.c:130:18: note: each undeclared identifier is reported 
> > only once for each function it appears in
> > 32bitbios_support.c:134:18: error: 'R_386_32' undeclared (first use in this 
> > function)
> >              case R_386_32:
> >                   ^~~~~~~~
> > 
> > Only add the two defines that are actually used, which seems to match
> > what we do for amd64.
> > 
> > Fixes: 81b2b328a26c1b ('hvmloader: use Xen private header for elf structs')
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> In principle
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> But ...
> 
> > --- a/xen/include/xen/elfstructs.h
> > +++ b/xen/include/xen/elfstructs.h
> > @@ -348,6 +348,9 @@ typedef struct {
> >  #define ELF32_R_TYPE(i)            ((unsigned char) (i))
> >  #define ELF32_R_INFO(s,t)  (((s) << 8) + (unsigned char)(t))
> >  
> > +#define R_386_32           1            /* Direct 32 bit  */
> > +#define R_386_PC32         2            /* PC relative 32 bit */
> > +
> >  typedef struct {
> >     Elf64_Addr      r_offset;       /* where to do it */
> >     Elf64_Xword     r_info;         /* index & type of relocation */
> 
> ... I'm heavily inclined to move this a few lines down to where
> the other relocation types get defined, and add a respective
> comment.

I've placed it together with the other 32bit ELF relocation structures
and macros, but I see the rest of the relocation defines are a bit
below, feel free to move it. For a comment:

/*
 * Relocation definitions required by the rombios hvmloader relocation
 * code.
 */

Does seem fine?

Thanks, Roger.



 


Rackspace

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