Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
e576eb0cbc
183 changed files with 5507 additions and 2653 deletions
|
@ -342,8 +342,11 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e)
|
|||
if (s->sh_type == SHT_SYMTAB)
|
||||
break;
|
||||
|
||||
/* Module without symbol table may still be used to pull in dependencies.
|
||||
We verify at build time that such modules do not contain any relocations
|
||||
that may reference symbol table. */
|
||||
if (i == e->e_shnum)
|
||||
return grub_error (GRUB_ERR_BAD_MODULE, N_("no symbol table"));
|
||||
return GRUB_ERR_NONE;
|
||||
|
||||
#ifdef GRUB_MODULES_MACHINE_READONLY
|
||||
mod->symtab = grub_malloc (s->sh_size);
|
||||
|
@ -585,6 +588,9 @@ grub_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
|
|||
|
||||
if (seg)
|
||||
{
|
||||
if (!mod->symtab)
|
||||
return grub_error (GRUB_ERR_BAD_MODULE, "relocation without symbol table");
|
||||
|
||||
err = grub_arch_dl_relocate_symbols (mod, ehdr, s, seg);
|
||||
if (err)
|
||||
return err;
|
||||
|
@ -614,7 +620,7 @@ grub_dl_load_core_noinit (void *addr, grub_size_t size)
|
|||
}
|
||||
|
||||
/* Make sure that every section is within the core. */
|
||||
if (size < e->e_shoff + e->e_shentsize * e->e_shnum)
|
||||
if (size < e->e_shoff + (grub_uint32_t) e->e_shentsize * e->e_shnum)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_OS, "ELF sections outside core");
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue