aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-01-19 15:03:02 +0000
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-01-19 15:03:02 +0000
commit24425e8b0eac1a8504bb7c9136d0a58181bf9e13 (patch)
tree5da9a26f95fd24e45911183d90f7daeece332efe /xen/common
parent2e68ac5f9753eaf889ac524cc7ee1dd117815ffb (diff)
downloadxen-24425e8b0eac1a8504bb7c9136d0a58181bf9e13.tar.gz
xen-24425e8b0eac1a8504bb7c9136d0a58181bf9e13.tar.bz2
xen-24425e8b0eac1a8504bb7c9136d0a58181bf9e13.zip
[XEN] Avoid void* arithmetic in elfnote code.
From: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common')
-rw-r--r--xen/common/elf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xen/common/elf.c b/xen/common/elf.c
index 8414f5e933..877c704201 100644
--- a/xen/common/elf.c
+++ b/xen/common/elf.c
@@ -102,7 +102,7 @@ static unsigned long long xen_guest_numeric(struct domain_setup_info *dsi,
/*
* Interface to the Xen ELF notes.
*/
-#define ELFNOTE_NAME(_n_) ((const void*)(_n_) + sizeof(*(_n_)))
+#define ELFNOTE_NAME(_n_) ((const char*)(_n_) + sizeof(*(_n_)))
#define ELFNOTE_DESC(_n_) (ELFNOTE_NAME(_n_) + (((_n_)->namesz+3)&~3))
#define ELFNOTE_NEXT(_n_) (ELFNOTE_DESC(_n_) + (((_n_)->descsz+3)&~3))
@@ -115,7 +115,7 @@ static int is_xen_elfnote_section(const char *image, const Elf_Shdr *shdr)
for ( note = (const Elf_Note *)(image + shdr->sh_offset);
note < (const Elf_Note *)(image + shdr->sh_offset + shdr->sh_size);
- note = ELFNOTE_NEXT(note) )
+ note = (const Elf_Note *)ELFNOTE_NEXT(note) )
{
if ( !strncmp(ELFNOTE_NAME(note), "Xen", 4) )
return 1;
@@ -134,7 +134,7 @@ static const Elf_Note *xen_elfnote_lookup(
for ( note = (const Elf_Note *)dsi->__elfnote_section;
note < (const Elf_Note *)dsi->__elfnote_section_end;
- note = ELFNOTE_NEXT(note) )
+ note = (const Elf_Note *)ELFNOTE_NEXT(note) )
{
if ( strncmp(ELFNOTE_NAME(note), "Xen", 4) )
continue;
@@ -227,9 +227,9 @@ int parseelfimage(struct domain_setup_info *dsi)
image + ehdr->e_shoff + (h*ehdr->e_shentsize));
if ( !is_xen_elfnote_section(image, shdr) )
continue;
- dsi->__elfnote_section = (const void *)image + shdr->sh_offset;
+ dsi->__elfnote_section = (const char *)image + shdr->sh_offset;
dsi->__elfnote_section_end =
- (const void *)image + shdr->sh_offset + shdr->sh_size;
+ (const char *)image + shdr->sh_offset + shdr->sh_size;
break;
}