static inline grub_err_t
{
return grub_errno;
{
if (grub_errno)
return grub_errno;
else
}
return GRUB_ERR_NONE;
}
static inline grub_err_t
{
return grub_errno;
if (grub_file_read (file, (char *) e, sizeof (*e)) != sizeof (*e))
{
if (grub_errno)
return grub_errno;
else
}
|| e->e_version != EV_CURRENT)
if (! *shdr)
return grub_errno;
return grub_errno;
!= e->e_shnum * e->e_shentsize)
{
if (grub_errno)
return grub_errno;
else
}
return GRUB_ERR_NONE;
}
/* On i386 FreeBSD uses "elf module" approarch for 32-bit variant
and "elf obj module" for 64-bit variant. However it may differ on other
platforms. So I keep both versions. */
#if OBJSYM
{
Elf_Ehdr e;
Elf_Shdr *s;
char *shdr = 0;
void *chunk_src;
if (err)
return err;
+ e.e_shnum * e.e_shentsize);
s = (Elf_Shdr *) ((char *) s + e.e_shentsize))
{
if (s->sh_size == 0)
continue;
if (s->sh_addralign)
- *kern_end;
chunk_size += s->sh_size;
}
{
module, chunk_size);
if (err)
return err;
}
+ e.e_shnum * e.e_shentsize);
s = (Elf_Shdr *) ((char *) s + e.e_shentsize))
{
if (s->sh_size == 0)
continue;
if (s->sh_addralign)
(int) s->sh_addralign);
switch (s->sh_type)
{
default:
case SHT_PROGBITS:
if (err)
return err;
break;
case SHT_NOBITS:
s->sh_size);
break;
}
}
if (! err)
&e, sizeof (e));
if (! err)
return err;
}
#else
{
Elf_Ehdr e;
Elf_Shdr *s;
char *shdr = 0;
void *chunk_src;
if (err)
return err;
+ e.e_shnum * e.e_shentsize);
s = (Elf_Shdr *) ((char *) s + e.e_shentsize))
{
if (s->sh_size == 0)
continue;
continue;
}
if (chunk_size < sizeof (e))
chunk_size = sizeof (e);
{
module, chunk_size);
if (err)
return err;
}
+ e.e_shnum * e.e_shentsize);
s = (Elf_Shdr *) ((char *) s + e.e_shentsize))
{
if (s->sh_size == 0)
continue;
continue;
(int) s->sh_addralign);
switch (s->sh_type)
{
default:
case SHT_PROGBITS:
if (err)
return err;
break;
case SHT_NOBITS:
break;
}
}
e.e_shnum * e.e_shentsize);
e.e_phnum * e.e_phentsize);
}
#endif
{
Elf_Ehdr e;
Elf_Shdr *s;
char *shdr = 0;
void *sym_chunk;
const char *str;
unsigned i;
if (err)
return err;
sizeof (e));
if (err)
return err;
+ e.e_shnum * e.e_shentsize);
s = (Elf_Shdr *) ((char *) s + e.e_shentsize))
if (s->sh_type == SHT_SYMTAB)
break;
+ e.e_shnum * e.e_shentsize))
symentsize = s->sh_entsize;
+ 2 * sizeof (grub_freebsd_addr_t);
{
if (err)
return err;
}
curload += sizeof (grub_freebsd_addr_t);
return grub_errno;
{
if (! grub_errno)
return grub_errno;
}
curload += sizeof (grub_freebsd_addr_t);
return grub_errno;
{
if (! grub_errno)
return grub_errno;
}
for (i = 0;
i * symentsize < symsize;
{
break;
}
if (i * symentsize < symsize)
{
sizeof (dynamic));
if (err)
return err;
}
sizeof (symstart));
if (err)
return err;
sizeof (symend));
if (err)
return err;
return GRUB_ERR_NONE;
}
{
Elf_Ehdr e;
void *sym_chunk;
if (err)
return err;
+ e.e_shnum * e.e_shentsize);
s = (Elf_Shdr *) ((char *) s + e.e_shentsize))
if (s->sh_type == SHT_SYMTAB)
break;
+ e.e_shnum * e.e_shentsize))
return GRUB_ERR_NONE;
symsh = s;
strsh = s;
+ sizeof (e) + e.e_shnum * e.e_shentsize;
{
if (err)
return err;
}
grub_memcpy (curload, &e, sizeof (e));
e2->e_phentsize = 0;
e2->e_shstrndx = 0;
curload += sizeof (e);
+ e.e_shnum * e.e_shentsize);
s = (Elf_Shdr *) ((char *) s + e.e_shentsize))
{
if (s == symsh)
else if (s == strsh)
+ sizeof (e) + e.e_shnum * e.e_shentsize;
else
curload += e.e_shentsize;
}
return grub_errno;
{
if (! grub_errno)
return grub_errno;
}
return grub_errno;
{
if (! grub_errno)
return grub_errno;
}
&symtab,
sizeof (symtab));
if (err)
return err;
return GRUB_ERR_NONE;
}
void *kern_chunk_src,
struct grub_openbsd_ramdisk_descriptor *desc)
{
{
Elf_Ehdr e;
Elf_Shdr *s;
if (err)
return err;
+ e.e_shnum * e.e_shentsize);
s = (Elf_Shdr *) ((char *) s + e.e_shentsize))
if (s->sh_type == SHT_SYMTAB)
break;
{
return GRUB_ERR_NONE;
}
symentsize = s->sh_entsize;
}
{
unsigned i;
char *strs;
if (!syms)
return grub_errno;
{
return grub_errno;
}
{
if (! grub_errno)
return grub_errno;
}
if (!strs)
{
return grub_errno;
}
return grub_errno;
{
if (! grub_errno)
return grub_errno;
}
{
continue;
continue;
break;
}
{
return GRUB_ERR_NONE;
}
{
}
+ (grub_uint8_t *) kern_chunk_src;
+ (grub_uint8_t *) kern_chunk_src);
return GRUB_ERR_NONE;
}
}