Lines Matching refs:sechdrs
188 const Elf64_Shdr *sechdrs) in get_stubs_size() argument
196 if (sechdrs[i].sh_type == SHT_RELA) { in get_stubs_size()
199 (void *)sechdrs[i].sh_addr, in get_stubs_size()
200 sechdrs[i].sh_size / sizeof(Elf64_Rela)); in get_stubs_size()
207 sort((void *)sechdrs[i].sh_addr, in get_stubs_size()
208 sechdrs[i].sh_size / sizeof(Elf64_Rela), in get_stubs_size()
211 relocs += count_relocs((void *)sechdrs[i].sh_addr, in get_stubs_size()
212 sechdrs[i].sh_size in get_stubs_size()
262 static Elf64_Sym *find_dot_toc(Elf64_Shdr *sechdrs, in find_dot_toc() argument
269 syms = (Elf64_Sym *)sechdrs[symindex].sh_addr; in find_dot_toc()
270 numsyms = sechdrs[symindex].sh_size / sizeof(Elf64_Sym); in find_dot_toc()
281 Elf64_Shdr *sechdrs, in module_frob_arch_sections() argument
290 if (strcmp(secstrings + sechdrs[i].sh_name, ".stubs") == 0) in module_frob_arch_sections()
292 else if (strcmp(secstrings + sechdrs[i].sh_name, ".toc") == 0) { in module_frob_arch_sections()
294 if (sechdrs[i].sh_addralign < 8) in module_frob_arch_sections()
295 sechdrs[i].sh_addralign = 8; in module_frob_arch_sections()
297 else if (strcmp(secstrings+sechdrs[i].sh_name,"__versions")==0) in module_frob_arch_sections()
298 dedotify_versions((void *)hdr + sechdrs[i].sh_offset, in module_frob_arch_sections()
299 sechdrs[i].sh_size); in module_frob_arch_sections()
302 while ((p = strstr(secstrings + sechdrs[i].sh_name, ".init"))) in module_frob_arch_sections()
305 if (sechdrs[i].sh_type == SHT_SYMTAB) in module_frob_arch_sections()
306 dedotify((void *)hdr + sechdrs[i].sh_offset, in module_frob_arch_sections()
307 sechdrs[i].sh_size / sizeof(Elf64_Sym), in module_frob_arch_sections()
309 + sechdrs[sechdrs[i].sh_link].sh_offset); in module_frob_arch_sections()
325 sechdrs[me->arch.stubs_section].sh_size = get_stubs_size(hdr, sechdrs); in module_frob_arch_sections()
412 static inline unsigned long my_r2(const Elf64_Shdr *sechdrs, struct module *me) in my_r2() argument
414 return (sechdrs[me->arch.toc_section].sh_addr & ~0xfful) + 0x8000; in my_r2()
418 static inline int create_stub(const Elf64_Shdr *sechdrs, in create_stub() argument
438 reladdr = (unsigned long)entry - my_r2(sechdrs, me); in create_stub()
470 static unsigned long stub_for_addr(const Elf64_Shdr *sechdrs, in stub_for_addr() argument
478 num_stubs = sechdrs[me->arch.stubs_section].sh_size / sizeof(*stubs); in stub_for_addr()
481 stubs = (void *)sechdrs[me->arch.stubs_section].sh_addr; in stub_for_addr()
490 if (!create_stub(sechdrs, &stubs[i], addr, me, name)) in stub_for_addr()
526 int apply_relocate_add(Elf64_Shdr *sechdrs, in apply_relocate_add() argument
533 Elf64_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
539 sechdrs[relsec].sh_info); in apply_relocate_add()
543 sym = find_dot_toc(sechdrs, strtab, symindex); in apply_relocate_add()
547 sym->st_value = my_r2(sechdrs, me); in apply_relocate_add()
551 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) { in apply_relocate_add()
553 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
556 sym = (Elf64_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
579 *(unsigned long *)location = my_r2(sechdrs, me); in apply_relocate_add()
584 value -= my_r2(sechdrs, me); in apply_relocate_add()
597 value -= my_r2(sechdrs, me); in apply_relocate_add()
605 value -= my_r2(sechdrs, me); in apply_relocate_add()
618 value -= my_r2(sechdrs, me); in apply_relocate_add()
631 value -= my_r2(sechdrs, me); in apply_relocate_add()
643 value = stub_for_addr(sechdrs, value, me, in apply_relocate_add()
700 value = my_r2(sechdrs, me) - (unsigned long)location; in apply_relocate_add()
786 int module_finalize_ftrace(struct module *mod, const Elf_Shdr *sechdrs) in module_finalize_ftrace() argument
788 mod->arch.tramp = stub_for_addr(sechdrs, in module_finalize_ftrace()
793 mod->arch.tramp_regs = stub_for_addr(sechdrs, in module_finalize_ftrace()