Lines Matching refs:hdr
17 for ( i = 1; i < elf->hdr->e_shnum; i++ ) in livepatch_elf_sec_by_name()
55 sec = xzalloc_array(struct livepatch_elf_sec, elf->hdr->e_shnum); in elf_resolve_sections()
66 delta = elf->hdr->e_shoff + elf->hdr->e_shnum * elf->hdr->e_shentsize; in elf_resolve_sections()
69 for ( i = 1; i < elf->hdr->e_shnum; i++ ) in elf_resolve_sections()
71 delta = elf->hdr->e_shoff + i * elf->hdr->e_shentsize; in elf_resolve_sections()
127 if ( elf->symtab->sec->sh_link >= elf->hdr->e_shnum ) in elf_resolve_sections()
132 elf->hdr->e_shnum); in elf_resolve_sections()
183 sec = &elf->sec[elf->hdr->e_shstrndx]; in elf_resolve_section_names()
199 for ( i = 1; i < elf->hdr->e_shnum; i++ ) in elf_resolve_section_names()
326 else if ( idx >= elf->hdr->e_shnum ) in livepatch_elf_resolve_symbols()
364 for ( i = 1; i < elf->hdr->e_shnum; i++ ) in livepatch_elf_perform_relocs()
373 if ( r->sec->sh_info >= elf->hdr->e_shnum ) in livepatch_elf_perform_relocs()
420 const Elf_Ehdr *hdr = elf->hdr; in livepatch_header_check() local
423 if ( sizeof(*elf->hdr) > elf->len ) in livepatch_header_check()
430 if ( !IS_ELF(*hdr) ) in livepatch_header_check()
437 if ( hdr->e_version != EV_CURRENT || in livepatch_header_check()
438 hdr->e_ident[EI_VERSION] != EV_CURRENT || in livepatch_header_check()
439 hdr->e_ident[EI_ABIVERSION] != 0 || in livepatch_header_check()
440 (hdr->e_ident[EI_OSABI] != ELFOSABI_NONE && in livepatch_header_check()
441 hdr->e_ident[EI_OSABI] != ELFOSABI_FREEBSD) || in livepatch_header_check()
442 hdr->e_type != ET_REL || in livepatch_header_check()
443 hdr->e_phnum != 0 ) in livepatch_header_check()
453 if ( elf->hdr->e_shstrndx == SHN_UNDEF ) in livepatch_header_check()
461 if ( elf->hdr->e_shnum >= 1024 ) in livepatch_header_check()
464 elf->name, elf->hdr->e_shnum); in livepatch_header_check()
469 if ( elf->hdr->e_shstrndx >= elf->hdr->e_shnum ) in livepatch_header_check()
472 elf->name, elf->hdr->e_shstrndx, elf->hdr->e_shnum); in livepatch_header_check()
476 if ( elf->hdr->e_shoff >= elf->len ) in livepatch_header_check()
482 if ( elf->hdr->e_shentsize < sizeof(Elf_Shdr) ) in livepatch_header_check()
485 elf->name, elf->hdr->e_shentsize, sizeof(Elf_Shdr)); in livepatch_header_check()
489 if ( ((elf->len - elf->hdr->e_shoff) / elf->hdr->e_shentsize) < in livepatch_header_check()
490 elf->hdr->e_shnum ) in livepatch_header_check()
504 elf->hdr = data; in livepatch_elf_load()