Lines Matching refs:shdr
189 Elf_Shdr *shdr = &info->sechdrs[i]; in find_sec() local
191 if ((shdr->sh_flags & SHF_ALLOC) in find_sec()
192 && strcmp(info->secstrings + shdr->sh_name, name) == 0) in find_sec()
224 Elf_Shdr *shdr = &info->sechdrs[i]; in find_any_sec() local
225 if (strcmp(info->secstrings + shdr->sh_name, name) == 0) in find_any_sec()
1648 static int validate_section_offset(struct load_info *info, Elf_Shdr *shdr) in validate_section_offset() argument
1660 secend = shdr->sh_offset + shdr->sh_size; in validate_section_offset()
1661 if (secend < shdr->sh_offset || secend > info->len) in validate_section_offset()
1690 Elf_Shdr *shdr, *strhdr; in elf_validity_cache_copy() local
1785 shdr = &info->sechdrs[i]; in elf_validity_cache_copy()
1786 switch (shdr->sh_type) { in elf_validity_cache_copy()
1791 if (shdr->sh_link == SHN_UNDEF in elf_validity_cache_copy()
1792 || shdr->sh_link >= info->hdr->e_shnum) { in elf_validity_cache_copy()
1794 shdr->sh_link, shdr->sh_link, in elf_validity_cache_copy()
1802 err = validate_section_offset(info, shdr); in elf_validity_cache_copy()
1805 i, shdr->sh_type); in elf_validity_cache_copy()
1808 if (strcmp(info->secstrings + shdr->sh_name, in elf_validity_cache_copy()
1812 } else if (strcmp(info->secstrings + shdr->sh_name, in elf_validity_cache_copy()
1818 if (shdr->sh_flags & SHF_ALLOC) { in elf_validity_cache_copy()
1819 if (shdr->sh_name >= strhdr->sh_size) { in elf_validity_cache_copy()
1821 i, shdr->sh_type); in elf_validity_cache_copy()
1846 shdr = &info->sechdrs[sym_idx]; in elf_validity_cache_copy()
1847 info->index.str = shdr->sh_link; in elf_validity_cache_copy()
1871 shdr = &info->sechdrs[mod_idx]; in elf_validity_cache_copy()
1877 if (shdr->sh_type == SHT_NOBITS) { in elf_validity_cache_copy()
1883 if (!(shdr->sh_flags & SHF_ALLOC)) { in elf_validity_cache_copy()
1889 if (shdr->sh_size != sizeof(struct module)) { in elf_validity_cache_copy()
1898 info->mod = (void *)info->hdr + shdr->sh_offset; in elf_validity_cache_copy()
2009 Elf_Shdr *shdr = &info->sechdrs[i]; in rewrite_section_headers() local
2015 shdr->sh_addr = (size_t)info->hdr + shdr->sh_offset; in rewrite_section_headers()
2268 Elf_Shdr *shdr = &info->sechdrs[i]; in move_module() local
2269 enum mod_mem_type type = shdr->sh_entsize >> SH_ENTSIZE_TYPE_SHIFT; in move_module()
2271 if (!(shdr->sh_flags & SHF_ALLOC)) in move_module()
2274 dest = mod->mem[type].base + (shdr->sh_entsize & SH_ENTSIZE_OFFSET_MASK); in move_module()
2276 if (shdr->sh_type != SHT_NOBITS) { in move_module()
2284 (WARN_ON_ONCE(shdr->sh_size != sizeof(struct module)))) { in move_module()
2288 memcpy(dest, (void *)shdr->sh_addr, shdr->sh_size); in move_module()
2296 shdr->sh_addr = (unsigned long)dest; in move_module()
2297 pr_debug("\t0x%lx 0x%.8lx %s\n", (long)shdr->sh_addr, in move_module()
2298 (long)shdr->sh_size, info->secstrings + shdr->sh_name); in move_module()