diff mbox

[v3,2/5] arm/config: Declare ELFSIZE_[32|64] respectively.

Message ID 20160212141753.GC6596@localhost.localdomain (mailing list archive)
State New, archived
Headers show

Commit Message

Konrad Rzeszutek Wilk Feb. 12, 2016, 2:17 p.m. UTC
On Fri, Feb 12, 2016 at 11:26:10AM +0000, Stefano Stabellini wrote:
> On Thu, 11 Feb 2016, Konrad Rzeszutek Wilk wrote:
> > Otherwise any code that tries to use Elf_* macros instead of
> > Elf32_ or Elf_64 fails to compile.
> > 
> > CC: ian.campbell@citrix.com
> > CC: wei.liu2@citrix.com
> > CC: stefano.stabellini@citrix.com
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > ---
> >  xen/include/asm-arm/config.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
> > index bd832df..4ea66bf 100644
> > --- a/xen/include/asm-arm/config.h
> > +++ b/xen/include/asm-arm/config.h
> > @@ -15,8 +15,10 @@
> >  
> >  #if defined(CONFIG_ARM_64)
> >  # define LONG_BYTEORDER 3
> > +# define ELFSIZE 64
> >  #else
> >  # define LONG_BYTEORDER 2
> > +# define ELFSIZE 32
> >  #endif
> 
> I wonder if we should use ELF64 on ARM32 too, for simplicity (x86 only
> uses ELF64) and because ARM32 is LPAE.

Done. And this resolves also the question Jan raised in the design
document about ARM32 and the ELF payload declaring the ELF only in
64-bit syntax.

Thanks! Updated the patch to be:
 
P.S.
It compiles without trouble.
From 7756ddc1e2aa0be487df05ce76577c6fa15a75ce Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Fri, 5 Feb 2016 10:44:45 -0500
Subject: [PATCH] arm/config: Declare ELFSIZE_64.

Otherwise any code that tries to use Elf_* macros would
require us to use Elf64_* types instead of the more
friendly Elf_ one.

This is OK to do since 32-bit ARM uses LPAE mode.

CC: ian.campbell@citrix.com
CC: wei.liu2@citrix.com
CC: stefano.stabellini@citrix.com
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/include/asm-arm/config.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jan Beulich Feb. 12, 2016, 3:04 p.m. UTC | #1
>>> On 12.02.16 at 15:17, <konrad.wilk@oracle.com> wrote:
> --- a/xen/include/asm-arm/config.h
> +++ b/xen/include/asm-arm/config.h
> @@ -15,8 +15,10 @@
>  
>  #if defined(CONFIG_ARM_64)
>  # define LONG_BYTEORDER 3
> +# define ELFSIZE 64
>  #else
>  # define LONG_BYTEORDER 2
> +# define ELFSIZE 64
>  #endif

Leaving the question - why twice instead of outside the #ifdef?

Jan
Stefano Stabellini Feb. 12, 2016, 3:26 p.m. UTC | #2
On Fri, 12 Feb 2016, Jan Beulich wrote:
> >>> On 12.02.16 at 15:17, <konrad.wilk@oracle.com> wrote:
> > --- a/xen/include/asm-arm/config.h
> > +++ b/xen/include/asm-arm/config.h
> > @@ -15,8 +15,10 @@
> >  
> >  #if defined(CONFIG_ARM_64)
> >  # define LONG_BYTEORDER 3
> > +# define ELFSIZE 64
> >  #else
> >  # define LONG_BYTEORDER 2
> > +# define ELFSIZE 64
> >  #endif
> 
> Leaving the question - why twice instead of outside the #ifdef?

Right, please move it out of the #ifdef.
diff mbox

Patch

diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index bd832df..d5321b4 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -15,8 +15,10 @@ 
 
 #if defined(CONFIG_ARM_64)
 # define LONG_BYTEORDER 3
+# define ELFSIZE 64
 #else
 # define LONG_BYTEORDER 2
+# define ELFSIZE 64
 #endif
 
 #define BYTES_PER_LONG (1 << LONG_BYTEORDER)