ia64/xen-unstable

changeset 15700:e0b424bc9572

Merge
author Tim Deegan <Tim.Deegan@xensource.com>
date Thu Aug 02 09:02:26 2007 +0100 (2007-08-02)
parents bf85b467ee89 07364f8574b8
children 29f349a3b452
files
line diff
     1.1 --- a/tools/xenstore/utils.c	Thu Aug 02 09:02:08 2007 +0100
     1.2 +++ b/tools/xenstore/utils.c	Thu Aug 02 09:02:26 2007 +0100
     1.3 @@ -10,19 +10,18 @@
     1.4  #include <signal.h>
     1.5  #include "utils.h"
     1.6  
     1.7 -void xprintf(const char *fmt, ...)
     1.8 +static void default_xprintf(const char *fmt, ...)
     1.9  {
    1.10  	va_list args;
    1.11  
    1.12 -	if (!stderr)
    1.13 -		return; /* could trace()? */
    1.14 -
    1.15  	va_start(args, fmt);
    1.16  	vfprintf(stderr, fmt, args);
    1.17  	va_end(args);
    1.18  	fflush(stderr);
    1.19  }
    1.20  
    1.21 +void (*xprintf)(const char *fmt, ...) = default_xprintf;
    1.22 +
    1.23  void barf(const char *fmt, ...)
    1.24  {
    1.25  	char *str;
     2.1 --- a/tools/xenstore/utils.h	Thu Aug 02 09:02:08 2007 +0100
     2.2 +++ b/tools/xenstore/utils.h	Thu Aug 02 09:02:26 2007 +0100
     2.3 @@ -24,7 +24,7 @@ static inline bool strends(const char *a
     2.4  void barf(const char *fmt, ...) __attribute__((noreturn));
     2.5  void barf_perror(const char *fmt, ...) __attribute__((noreturn));
     2.6  
     2.7 -void xprintf(const char *fmt, ...);
     2.8 +void (*xprintf)(const char *fmt, ...);
     2.9  
    2.10  #define eprintf(_fmt, _args...) xprintf("[ERR] %s" _fmt, __FUNCTION__, ##_args)
    2.11  
     3.1 --- a/tools/xenstore/xenstored_core.c	Thu Aug 02 09:02:08 2007 +0100
     3.2 +++ b/tools/xenstore/xenstored_core.c	Thu Aug 02 09:02:26 2007 +0100
     3.3 @@ -1880,14 +1880,14 @@ int main(int argc, char *argv[])
     3.4  
     3.5  	/* close stdin/stdout now we're ready to accept connections */
     3.6  	if (dofork) {
     3.7 -		close(STDIN_FILENO);
     3.8 -		close(STDOUT_FILENO);
     3.9 -		close(STDERR_FILENO);
    3.10 -
    3.11 -		/* Get ourselves a nice xenstored crash if these are used. */
    3.12 -		stdin = NULL;
    3.13 -		stdout = NULL;
    3.14 -		stderr = NULL;
    3.15 +		int devnull = open("/dev/null", O_RDWR);
    3.16 +		if (devnull == -1)
    3.17 +			barf_perror("Could not open /dev/null\n");
    3.18 +		close(STDIN_FILENO);  dup2(STDIN_FILENO, devnull);
    3.19 +		close(STDOUT_FILENO); dup2(STDOUT_FILENO, devnull);
    3.20 +		close(STDERR_FILENO); dup2(STDERR_FILENO, devnull);
    3.21 +		close(devnull);
    3.22 +		xprintf = trace;
    3.23  	}
    3.24  
    3.25  	signal(SIGHUP, trigger_reopen_log);
     4.1 --- a/xen/arch/x86/domain_build.c	Thu Aug 02 09:02:08 2007 +0100
     4.2 +++ b/xen/arch/x86/domain_build.c	Thu Aug 02 09:02:26 2007 +0100
     4.3 @@ -316,6 +316,9 @@ int __init construct_dom0(
     4.4             parms.pae       ? ", PAE"  : "",
     4.5             elf_msb(&elf)   ? "msb"    : "lsb",
     4.6             elf.pstart, elf.pend);
     4.7 +    if ( parms.bsd_symtab )
     4.8 +        printk(" Dom0 symbol map 0x%" PRIx64 " -> 0x%" PRIx64 "\n",
     4.9 +               elf.sstart, elf.send);
    4.10  
    4.11      if ( !compatible )
    4.12      {
    4.13 @@ -385,7 +388,7 @@ int __init construct_dom0(
    4.14      v_start          = parms.virt_base;
    4.15      vkern_start      = parms.virt_kstart;
    4.16      vkern_end        = parms.virt_kend;
    4.17 -    vinitrd_start    = round_pgup(vkern_end);
    4.18 +    vinitrd_start    = round_pgup(parms.virt_end);
    4.19      vinitrd_end      = vinitrd_start + initrd_len;
    4.20      vphysmap_start   = round_pgup(vinitrd_end);
    4.21      vphysmap_end     = vphysmap_start + (nr_pages * (!is_pv_32on64_domain(d) ?
    4.22 @@ -795,7 +798,7 @@ int __init construct_dom0(
    4.23  
    4.24      /* Copy the OS image and free temporary buffer. */
    4.25      elf.dest = (void*)vkern_start;
    4.26 -    elf_load_binary(&elf);
    4.27 +    elf_xen_dom_load_binary(&elf, &parms);
    4.28  
    4.29      if ( UNSET_ADDR != parms.virt_hypercall )
    4.30      {
     5.1 --- a/xen/common/libelf/libelf-dominfo.c	Thu Aug 02 09:02:08 2007 +0100
     5.2 +++ b/xen/common/libelf/libelf-dominfo.c	Thu Aug 02 09:02:26 2007 +0100
     5.3 @@ -333,6 +333,99 @@ static int elf_xen_note_check(struct elf
     5.4      return 0;
     5.5  }
     5.6  
     5.7 +
     5.8 +static void elf_xen_loadsymtab(struct elf_binary *elf,
     5.9 +                               struct elf_dom_parms *parms)
    5.10 +{
    5.11 +    unsigned long maxva, len;
    5.12 +
    5.13 +    if ( !parms->bsd_symtab )
    5.14 +        return;
    5.15 +
    5.16 +    /* Calculate the required additional kernel space for the elf image */
    5.17 +
    5.18 +    /* The absolute base address of the elf image */
    5.19 +    maxva = elf_round_up(elf, parms->virt_kend);
    5.20 +    maxva += sizeof(long); /* Space to store the size of the elf image */
    5.21 +    /* Space for the elf and elf section headers */
    5.22 +    maxva += (elf_uval(elf, elf->ehdr, e_ehsize) +
    5.23 +              elf_shdr_count(elf) * elf_uval(elf, elf->ehdr, e_shentsize));
    5.24 +    maxva = elf_round_up(elf, maxva);
    5.25 +
    5.26 +    /* Space for the symbol and string tabs */
    5.27 +    len = (unsigned long)elf->send - (unsigned long)elf->sstart;
    5.28 +    maxva = elf_round_up(elf, maxva + len);
    5.29 +
    5.30 +    /* The address the kernel must expanded to */
    5.31 +    parms->virt_end = maxva;
    5.32 +}
    5.33 +
    5.34 +int elf_xen_dom_load_binary(struct elf_binary *elf,
    5.35 +                            struct elf_dom_parms *parms)
    5.36 +{
    5.37 +    elf_ehdr *sym_ehdr;
    5.38 +    unsigned long shdr, symtab_addr;
    5.39 +    unsigned long maxva, symbase;
    5.40 +    uint8_t i;
    5.41 +    char *p;
    5.42 +
    5.43 +    elf_load_binary(elf);
    5.44 +
    5.45 +    if ( !parms->bsd_symtab )
    5.46 +        return 0;
    5.47 +
    5.48 +#define elf_hdr_elm(_elf, _hdr, _elm, _val)     \
    5.49 +do {                                            \
    5.50 +    if ( elf_64bit(_elf) )                      \
    5.51 +        (_hdr)->e64._elm = _val;                \
    5.52 +    else                                        \
    5.53 +        (_hdr)->e32._elm = _val;                \
    5.54 +} while ( 0 )
    5.55 +
    5.56 +    /* ehdr right after the kernel image (4 byte aligned) */
    5.57 +    symbase = elf_round_up(elf, parms->virt_kend);
    5.58 +    symtab_addr = maxva = symbase + sizeof(long);
    5.59 +
    5.60 +    /* Set up Elf header. */
    5.61 +    sym_ehdr = (elf_ehdr *)symtab_addr;
    5.62 +    maxva = elf_copy_ehdr(elf, sym_ehdr);
    5.63 +
    5.64 +    elf_hdr_elm(elf, sym_ehdr, e_phoff, 0);
    5.65 +    elf_hdr_elm(elf, sym_ehdr, e_shoff, elf_uval(elf, elf->ehdr, e_ehsize));
    5.66 +    elf_hdr_elm(elf, sym_ehdr, e_phentsize, 0);
    5.67 +    elf_hdr_elm(elf, sym_ehdr, e_phnum, 0);
    5.68 +
    5.69 +    /* Copy Elf section headers. */
    5.70 +    shdr = maxva;
    5.71 +    maxva = elf_copy_shdr(elf, (elf_shdr *)shdr);
    5.72 +
    5.73 +    for ( i = 0; i < elf_shdr_count(elf); i++ )
    5.74 +    {
    5.75 +        uint8_t type;
    5.76 +        unsigned long tmp;
    5.77 +        type = elf_uval(elf, (elf_shdr *)shdr, sh_type);
    5.78 +        if ( (type == SHT_STRTAB) || (type == SHT_SYMTAB) )
    5.79 +        {
    5.80 +             elf_msg(elf, "%s: shdr %i at 0x%p -> 0x%p\n", __func__, i,
    5.81 +                     elf_section_start(elf, (elf_shdr *)shdr), (void *)maxva);
    5.82 +             tmp = elf_copy_section(elf, (elf_shdr *)shdr, (void *)maxva);
    5.83 +             /* Mangled to be based on ELF header location. */
    5.84 +             elf_hdr_elm(elf, (elf_shdr *)shdr, sh_offset,
    5.85 +                         maxva - symtab_addr);
    5.86 +             maxva = tmp;
    5.87 +        }
    5.88 +        shdr += elf_uval(elf, elf->ehdr, e_shentsize);
    5.89 +    }
    5.90 +
    5.91 +    /* Write down the actual sym size. */
    5.92 +    p = (char *)symbase;
    5.93 +    *(long *)p = maxva - symtab_addr; /* sym size */
    5.94 +
    5.95 +#undef elf_ehdr_elm
    5.96 +
    5.97 +    return 0;
    5.98 +}
    5.99 +
   5.100  static int elf_xen_addr_calc_check(struct elf_binary *elf,
   5.101                                     struct elf_dom_parms *parms)
   5.102  {
   5.103 @@ -374,22 +467,28 @@ static int elf_xen_addr_calc_check(struc
   5.104      parms->virt_offset = parms->virt_base - parms->elf_paddr_offset;
   5.105      parms->virt_kstart = elf->pstart + parms->virt_offset;
   5.106      parms->virt_kend   = elf->pend   + parms->virt_offset;
   5.107 +    parms->virt_end    = parms->virt_kend;
   5.108  
   5.109      if ( parms->virt_entry == UNSET_ADDR )
   5.110          parms->virt_entry = elf_uval(elf, elf->ehdr, e_entry);
   5.111  
   5.112 +    if ( parms->bsd_symtab )
   5.113 +        elf_xen_loadsymtab(elf, parms);
   5.114 +
   5.115      elf_msg(elf, "%s: addresses:\n", __FUNCTION__);
   5.116      elf_msg(elf, "    virt_base        = 0x%" PRIx64 "\n", parms->virt_base);
   5.117      elf_msg(elf, "    elf_paddr_offset = 0x%" PRIx64 "\n", parms->elf_paddr_offset);
   5.118      elf_msg(elf, "    virt_offset      = 0x%" PRIx64 "\n", parms->virt_offset);
   5.119      elf_msg(elf, "    virt_kstart      = 0x%" PRIx64 "\n", parms->virt_kstart);
   5.120      elf_msg(elf, "    virt_kend        = 0x%" PRIx64 "\n", parms->virt_kend);
   5.121 +    elf_msg(elf, "    virt_end         = 0x%" PRIx64 "\n", parms->virt_end);
   5.122      elf_msg(elf, "    virt_entry       = 0x%" PRIx64 "\n", parms->virt_entry);
   5.123  
   5.124      if ( (parms->virt_kstart > parms->virt_kend) ||
   5.125           (parms->virt_entry < parms->virt_kstart) ||
   5.126           (parms->virt_entry > parms->virt_kend) ||
   5.127 -         (parms->virt_base > parms->virt_kstart) )
   5.128 +         (parms->virt_base > parms->virt_kstart) ||
   5.129 +         (parms->virt_kend > parms->virt_end) )
   5.130      {
   5.131          elf_err(elf, "%s: ERROR: ELF start or entries are out of bounds.\n",
   5.132                  __FUNCTION__);
     6.1 --- a/xen/common/libelf/libelf-loader.c	Thu Aug 02 09:02:08 2007 +0100
     6.2 +++ b/xen/common/libelf/libelf-loader.c	Thu Aug 02 09:02:26 2007 +0100
     6.3 @@ -10,6 +10,8 @@ int elf_init(struct elf_binary *elf, con
     6.4  {
     6.5      const elf_shdr *shdr;
     6.6      uint64_t i, count, section, offset;
     6.7 +    uint64_t low = -1;
     6.8 +    uint64_t high = 0;
     6.9  
    6.10      if ( !elf_is_elfbinary(image) )
    6.11      {
    6.12 @@ -24,7 +26,11 @@ int elf_init(struct elf_binary *elf, con
    6.13      elf->class = elf->ehdr->e32.e_ident[EI_CLASS];
    6.14      elf->data = elf->ehdr->e32.e_ident[EI_DATA];
    6.15  
    6.16 -    /* sanity check phdr */
    6.17 +#ifdef VERBOSE
    6.18 +    elf_set_verbose(elf);
    6.19 +#endif
    6.20 +
    6.21 +    /* Sanity check phdr. */
    6.22      offset = elf_uval(elf, elf->ehdr, e_phoff) +
    6.23          elf_uval(elf, elf->ehdr, e_phentsize) * elf_phdr_count(elf);
    6.24      if ( offset > elf->size )
    6.25 @@ -34,7 +40,7 @@ int elf_init(struct elf_binary *elf, con
    6.26          return -1;
    6.27      }
    6.28  
    6.29 -    /* sanity check shdr */
    6.30 +    /* Sanity check shdr. */
    6.31      offset = elf_uval(elf, elf->ehdr, e_shoff) +
    6.32          elf_uval(elf, elf->ehdr, e_shentsize) * elf_shdr_count(elf);
    6.33      if ( offset > elf->size )
    6.34 @@ -44,29 +50,55 @@ int elf_init(struct elf_binary *elf, con
    6.35          return -1;
    6.36      }
    6.37  
    6.38 -    /* find section string table */
    6.39 +    /* Find section string table. */
    6.40      section = elf_uval(elf, elf->ehdr, e_shstrndx);
    6.41      shdr = elf_shdr_by_index(elf, section);
    6.42      if ( shdr != NULL )
    6.43          elf->sec_strtab = elf_section_start(elf, shdr);
    6.44  
    6.45 -    /* find symbol table, symbol string table */
    6.46 +    /* Find symbol table and symbol string table. */
    6.47      count = elf_shdr_count(elf);
    6.48      for ( i = 0; i < count; i++ )
    6.49      {
    6.50 +        const char *sh_symend, *sh_strend;
    6.51 +
    6.52          shdr = elf_shdr_by_index(elf, i);
    6.53          if ( elf_uval(elf, shdr, sh_type) != SHT_SYMTAB )
    6.54              continue;
    6.55          elf->sym_tab = shdr;
    6.56 +        sh_symend = (const char *)elf_section_end(elf, shdr);
    6.57          shdr = elf_shdr_by_index(elf, elf_uval(elf, shdr, sh_link));
    6.58          if ( shdr == NULL )
    6.59          {
    6.60              elf->sym_tab = NULL;
    6.61 +            sh_symend = 0;
    6.62              continue;
    6.63          }
    6.64          elf->sym_strtab = elf_section_start(elf, shdr);
    6.65 -        break;
    6.66 +        sh_strend = (const char *)elf_section_end(elf, shdr);
    6.67 +
    6.68 +        if ( low > (unsigned long)elf->sym_tab )
    6.69 +            low = (unsigned long)elf->sym_tab;
    6.70 +        if ( low > (unsigned long)shdr )
    6.71 +            low = (unsigned long)shdr;
    6.72 +
    6.73 +        if ( high < ((unsigned long)sh_symend) )
    6.74 +            high = (unsigned long)sh_symend;
    6.75 +        if ( high < ((unsigned long)sh_strend) )
    6.76 +            high = (unsigned long)sh_strend;
    6.77 +
    6.78 +        elf_msg(elf, "%s: shdr: sym_tab=%p size=0x%" PRIx64 "\n",
    6.79 +                __FUNCTION__, elf->sym_tab,
    6.80 +                elf_uval(elf, elf->sym_tab, sh_size));
    6.81 +        elf_msg(elf, "%s: shdr: str_tab=%p size=0x%" PRIx64 "\n",
    6.82 +                __FUNCTION__, elf->sym_strtab, elf_uval(elf, shdr, sh_size));
    6.83 +
    6.84 +        elf->sstart = low;
    6.85 +        elf->send = high;
    6.86 +        elf_msg(elf, "%s: symbol map: 0x%" PRIx64 " -> 0x%" PRIx64 "\n",
    6.87 +                __FUNCTION__, elf->sstart, elf->send);
    6.88      }
    6.89 +
    6.90      return 0;
    6.91  }
    6.92  
     7.1 --- a/xen/common/libelf/libelf-tools.c	Thu Aug 02 09:02:08 2007 +0100
     7.2 +++ b/xen/common/libelf/libelf-tools.c	Thu Aug 02 09:02:26 2007 +0100
     7.3 @@ -238,6 +238,36 @@ int elf_phdr_is_loadable(struct elf_bina
     7.4      return ((p_type == PT_LOAD) && (p_flags & (PF_W | PF_X)) != 0);
     7.5  }
     7.6  
     7.7 +unsigned long
     7.8 +elf_copy_ehdr(struct elf_binary *elf, void *dest)
     7.9 +{
    7.10 +    uint64_t size;
    7.11 +
    7.12 +    size = elf_uval(elf, elf->ehdr, e_ehsize);
    7.13 +    memcpy(dest, elf->ehdr, size);
    7.14 +    return elf_round_up(elf, (unsigned long)(dest) + size);
    7.15 +}
    7.16 +
    7.17 +unsigned long
    7.18 +elf_copy_shdr(struct elf_binary *elf, void *dest)
    7.19 +{
    7.20 +    uint64_t size;
    7.21 +
    7.22 +    size = elf_shdr_count(elf) * elf_uval(elf, elf->ehdr, e_shentsize);
    7.23 +    memcpy(dest, elf->image + elf_uval(elf, elf->ehdr, e_shoff), size);
    7.24 +    return elf_round_up(elf, (unsigned long)(dest) + size);
    7.25 +}
    7.26 +
    7.27 +unsigned long
    7.28 +elf_copy_section(struct elf_binary *elf, const elf_shdr *shdr, void *dest)
    7.29 +{
    7.30 +    uint64_t size;
    7.31 +
    7.32 +    size = elf_uval(elf, shdr, sh_size);
    7.33 +    memcpy(dest, elf_section_start(elf, shdr), size);
    7.34 +    return elf_round_up(elf, (unsigned long)(dest) + size);
    7.35 +}
    7.36 +
    7.37  /*
    7.38   * Local variables:
    7.39   * mode: C
     8.1 --- a/xen/include/public/libelf.h	Thu Aug 02 09:02:08 2007 +0100
     8.2 +++ b/xen/include/public/libelf.h	Thu Aug 02 09:02:26 2007 +0100
     8.3 @@ -65,6 +65,8 @@ struct elf_binary {
     8.4  
     8.5      /* loaded to */
     8.6      char *dest;
     8.7 +    uint64_t sstart;
     8.8 +    uint64_t send;
     8.9      uint64_t pstart;
    8.10      uint64_t pend;
    8.11      uint64_t reloc_offset;
    8.12 @@ -91,33 +93,32 @@ struct elf_binary {
    8.13  #define elf_lsb(elf)   (ELFDATA2LSB == (elf)->data)
    8.14  #define elf_swap(elf)  (NATIVE_ELFDATA != (elf)->data)
    8.15  
    8.16 -#define elf_uval(elf, str, elem)			\
    8.17 -	((ELFCLASS64 == (elf)->class)			\
    8.18 -	? elf_access_unsigned((elf), (str),		\
    8.19 -		offsetof(typeof(*(str)),e64.elem),	\
    8.20 -		sizeof((str)->e64.elem))		\
    8.21 -	: elf_access_unsigned((elf), (str),		\
    8.22 -		offsetof(typeof(*(str)),e32.elem),	\
    8.23 -		sizeof((str)->e32.elem)))
    8.24 +#define elf_uval(elf, str, elem)                                        \
    8.25 +    ((ELFCLASS64 == (elf)->class)                                       \
    8.26 +     ? elf_access_unsigned((elf), (str),                                \
    8.27 +                           offsetof(typeof(*(str)),e64.elem),           \
    8.28 +                           sizeof((str)->e64.elem))                     \
    8.29 +     : elf_access_unsigned((elf), (str),                                \
    8.30 +                           offsetof(typeof(*(str)),e32.elem),           \
    8.31 +                           sizeof((str)->e32.elem)))
    8.32  
    8.33 -#define elf_sval(elf, str, elem)			\
    8.34 -	((ELFCLASS64 == (elf)->class)			\
    8.35 -	? elf_access_signed((elf), (str),		\
    8.36 -		offsetof(typeof(*(str)),e64.elem),	\
    8.37 -		sizeof((str)->e64.elem))		\
    8.38 -	: elf_access_signed((elf), (str),		\
    8.39 -		offsetof(typeof(*(str)),e32.elem),	\
    8.40 -		sizeof((str)->e32.elem)))
    8.41 +#define elf_sval(elf, str, elem)                                        \
    8.42 +    ((ELFCLASS64 == (elf)->class)                                       \
    8.43 +     ? elf_access_signed((elf), (str),                                  \
    8.44 +                         offsetof(typeof(*(str)),e64.elem),             \
    8.45 +                         sizeof((str)->e64.elem))                       \
    8.46 +     : elf_access_signed((elf), (str),                                  \
    8.47 +                         offsetof(typeof(*(str)),e32.elem),             \
    8.48 +                         sizeof((str)->e32.elem)))
    8.49  
    8.50 -#define elf_size(elf, str)		\
    8.51 -	((ELFCLASS64 == (elf)->class)	\
    8.52 -	? sizeof((str)->e64)		\
    8.53 -	: sizeof((str)->e32))
    8.54 +#define elf_size(elf, str)                              \
    8.55 +    ((ELFCLASS64 == (elf)->class)                       \
    8.56 +     ? sizeof((str)->e64) : sizeof((str)->e32))
    8.57  
    8.58  uint64_t elf_access_unsigned(struct elf_binary *elf, const void *ptr,
    8.59 -			     uint64_t offset, size_t size);
    8.60 +                             uint64_t offset, size_t size);
    8.61  int64_t elf_access_signed(struct elf_binary *elf, const void *ptr,
    8.62 -			  uint64_t offset, size_t size);
    8.63 +                          uint64_t offset, size_t size);
    8.64  
    8.65  uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr);
    8.66  
    8.67 @@ -149,6 +150,11 @@ const elf_note *elf_note_next(struct elf
    8.68  int elf_is_elfbinary(const void *image);
    8.69  int elf_phdr_is_loadable(struct elf_binary *elf, const elf_phdr * phdr);
    8.70  
    8.71 +unsigned long elf_copy_ehdr(struct elf_binary *elf, void *dest);
    8.72 +unsigned long elf_copy_shdr(struct elf_binary *elf, void *dest);
    8.73 +unsigned long elf_copy_section(struct elf_binary *elf,
    8.74 +                               const elf_shdr *shdr, void *dest);
    8.75 +
    8.76  /* ------------------------------------------------------------------------ */
    8.77  /* xc_libelf_loader.c                                                       */
    8.78  
    8.79 @@ -185,8 +191,8 @@ struct xen_elfnote {
    8.80      enum xen_elfnote_type type;
    8.81      const char *name;
    8.82      union {
    8.83 -	const char *str;
    8.84 -	uint64_t num;
    8.85 +        const char *str;
    8.86 +        uint64_t num;
    8.87      } data;
    8.88  };
    8.89  
    8.90 @@ -215,7 +221,8 @@ struct elf_dom_parms {
    8.91      /* calculated */
    8.92      uint64_t virt_offset;
    8.93      uint64_t virt_kstart;
    8.94 -    uint64_t virt_kend;
    8.95 +    uint64_t virt_kend; /* end of kernel image */
    8.96 +    uint64_t virt_end;  /* end of kernel symtab (== virt_kend if none) */
    8.97  };
    8.98  
    8.99  static inline void elf_xen_feature_set(int nr, uint32_t * addr)
   8.100 @@ -228,14 +235,17 @@ static inline int elf_xen_feature_get(in
   8.101  }
   8.102  
   8.103  int elf_xen_parse_features(const char *features,
   8.104 -			   uint32_t *supported,
   8.105 -			   uint32_t *required);
   8.106 +                           uint32_t *supported,
   8.107 +                           uint32_t *required);
   8.108  int elf_xen_parse_note(struct elf_binary *elf,
   8.109 -		       struct elf_dom_parms *parms,
   8.110 -		       const elf_note *note);
   8.111 +                       struct elf_dom_parms *parms,
   8.112 +                       const elf_note *note);
   8.113  int elf_xen_parse_guest_info(struct elf_binary *elf,
   8.114 -			     struct elf_dom_parms *parms);
   8.115 +                             struct elf_dom_parms *parms);
   8.116  int elf_xen_parse(struct elf_binary *elf,
   8.117 -		  struct elf_dom_parms *parms);
   8.118 +                  struct elf_dom_parms *parms);
   8.119 +
   8.120 +int elf_xen_dom_load_binary(struct elf_binary *elf,
   8.121 +                            struct elf_dom_parms *parms);
   8.122  
   8.123  #endif /* __XC_LIBELF__ */