Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/elftoolchain/libelf/libelf_ehdr.c
Show All 40 Lines | |||||
_libelf_load_extended(Elf *e, int ec, uint64_t shoff, uint16_t phnum, | _libelf_load_extended(Elf *e, int ec, uint64_t shoff, uint16_t phnum, | ||||
uint16_t strndx) | uint16_t strndx) | ||||
{ | { | ||||
size_t fsz; | size_t fsz; | ||||
Elf_Scn *scn; | Elf_Scn *scn; | ||||
uint32_t shtype; | uint32_t shtype; | ||||
_libelf_translator_function *xlator; | _libelf_translator_function *xlator; | ||||
assert(STAILQ_EMPTY(&e->e_u.e_elf.e_scn)); | assert(RB_EMPTY(&e->e_u.e_elf.e_scn)); | ||||
fsz = _libelf_fsize(ELF_T_SHDR, ec, e->e_version, 1); | fsz = _libelf_fsize(ELF_T_SHDR, ec, e->e_version, 1); | ||||
assert(fsz > 0); | assert(fsz > 0); | ||||
if (e->e_rawsize < shoff + fsz) { /* raw file too small */ | if (e->e_rawsize < shoff + fsz) { /* raw file too small */ | ||||
LIBELF_SET_ERROR(HEADER, 0); | LIBELF_SET_ERROR(HEADER, 0); | ||||
return (0); | return (0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |