Lines Matching refs:shdr

187 		Elf_Shdr *shdr = &info->sechdrs[i];  in find_sec()  local
189 if ((shdr->sh_flags & SHF_ALLOC) in find_sec()
190 && strcmp(info->secstrings + shdr->sh_name, name) == 0) in find_sec()
222 Elf_Shdr *shdr = &info->sechdrs[i]; in find_any_sec() local
223 if (strcmp(info->secstrings + shdr->sh_name, name) == 0) in find_any_sec()
1630 static int validate_section_offset(struct load_info *info, Elf_Shdr *shdr) in validate_section_offset() argument
1642 secend = shdr->sh_offset + shdr->sh_size; in validate_section_offset()
1643 if (secend < shdr->sh_offset || secend > info->len) in validate_section_offset()
1672 Elf_Shdr *shdr, *strhdr; in elf_validity_cache_copy() local
1767 shdr = &info->sechdrs[i]; in elf_validity_cache_copy()
1768 switch (shdr->sh_type) { in elf_validity_cache_copy()
1773 if (shdr->sh_link == SHN_UNDEF in elf_validity_cache_copy()
1774 || shdr->sh_link >= info->hdr->e_shnum) { in elf_validity_cache_copy()
1776 shdr->sh_link, shdr->sh_link, in elf_validity_cache_copy()
1784 err = validate_section_offset(info, shdr); in elf_validity_cache_copy()
1787 i, shdr->sh_type); in elf_validity_cache_copy()
1790 if (strcmp(info->secstrings + shdr->sh_name, in elf_validity_cache_copy()
1794 } else if (strcmp(info->secstrings + shdr->sh_name, in elf_validity_cache_copy()
1800 if (shdr->sh_flags & SHF_ALLOC) { in elf_validity_cache_copy()
1801 if (shdr->sh_name >= strhdr->sh_size) { in elf_validity_cache_copy()
1803 i, shdr->sh_type); in elf_validity_cache_copy()
1828 shdr = &info->sechdrs[sym_idx]; in elf_validity_cache_copy()
1829 info->index.str = shdr->sh_link; in elf_validity_cache_copy()
1853 shdr = &info->sechdrs[mod_idx]; in elf_validity_cache_copy()
1859 if (shdr->sh_type == SHT_NOBITS) { in elf_validity_cache_copy()
1865 if (!(shdr->sh_flags & SHF_ALLOC)) { in elf_validity_cache_copy()
1871 if (shdr->sh_size != sizeof(struct module)) { in elf_validity_cache_copy()
1880 info->mod = (void *)info->hdr + shdr->sh_offset; in elf_validity_cache_copy()
1991 Elf_Shdr *shdr = &info->sechdrs[i]; in rewrite_section_headers() local
1997 shdr->sh_addr = (size_t)info->hdr + shdr->sh_offset; in rewrite_section_headers()
2260 Elf_Shdr *shdr = &info->sechdrs[i]; in move_module() local
2261 enum mod_mem_type type = shdr->sh_entsize >> SH_ENTSIZE_TYPE_SHIFT; in move_module()
2263 if (!(shdr->sh_flags & SHF_ALLOC)) in move_module()
2266 dest = mod->mem[type].base + (shdr->sh_entsize & SH_ENTSIZE_OFFSET_MASK); in move_module()
2268 if (shdr->sh_type != SHT_NOBITS) { in move_module()
2276 (WARN_ON_ONCE(shdr->sh_size != sizeof(struct module)))) { in move_module()
2280 memcpy(dest, (void *)shdr->sh_addr, shdr->sh_size); in move_module()
2288 shdr->sh_addr = (unsigned long)dest; in move_module()
2289 pr_debug("\t0x%lx 0x%.8lx %s\n", (long)shdr->sh_addr, in move_module()
2290 (long)shdr->sh_size, info->secstrings + shdr->sh_name); in move_module()