WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [patch 1/5] add libelf: an ELF binary parser library.

To: Gerd Hoffmann <kraxel@xxxxxxx>
Subject: [Xen-devel] Re: [patch 1/5] add libelf: an ELF binary parser library.
From: Emmanuel Ackaouy <ack@xxxxxxxxxxxxx>
Date: Tue, 23 Jan 2007 20:03:29 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 23 Jan 2007 11:03:05 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070123145408.909708619@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070123145344.754866428@xxxxxxx> <20070123145408.909708619@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Gerd,

I have to say I'm not a big fan of sticking a 32bit and 64bit version
of each structure in a union and then checking at all levels of the
function call stack which one to reference (via elf_xval() for example).

Wouldn't it be cleaner to just have 2 different version of each elf
data structure and function? elf32_xxx and elf64_xxx . And go down
one path or the other at the start of your function call stack? I'm not
usually a fan of multiple compilation, but due to the layout of 32
and 64bit elf structures, this is one case where it makes sense
to me.

Also, do we actually have a need to look at elf files with a different
ELFDATA (byte ordering) ?


On Jan 23, 2007, at 15:53, Gerd Hoffmann wrote:

This patch adds a library with a small collection of helper functions
to parse and load elf binaries.  The library handles endianess and
elfsize at runtime.

The patch also shuffles around the include files a bit.  Now there is
*one* include file holding all the elf structures
(xen/include/public/elfstructs.h) which is included by everyone who
needs them.

It's dead code with this patch only, putting the code into use happens
in followup patches.

Signed-off-by: Gerd Hoffmann <kraxel@xxxxxxx>
---
tools/libxc/xc_elf.h | 525 -----------------------------------
 xen/arch/x86/boot/mkelf32.c         |    2
 xen/common/Makefile                 |    2
 xen/common/libelf/Makefile          |    4
 xen/common/libelf/README            |    1
xen/common/libelf/libelf-dominfo.c | 420 ++++++++++++++++++++++++++++
 xen/common/libelf/libelf-loader.c   |  156 ++++++++++
 xen/common/libelf/libelf-private.h  |   51 +++
 xen/common/libelf/libelf-relocate.c |  345 +++++++++++++++++++++++
 xen/common/libelf/libelf-tools.c    |  225 +++++++++++++++
xen/include/public/elfstructs.h | 527 ++++++++++++++++++++++++++++++++++++
 xen/include/public/libelf.h         |  238 ++++++++++++++++
xen/include/xen/elf.h | 490 ---------------------------------
 13 files changed, 1972 insertions(+), 1014 deletions(-)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel