Lines Matching refs:sechdrs

246 				    const Elf64_Shdr *sechdrs)  in get_stubs_size()  argument
254 if (sechdrs[i].sh_type == SHT_RELA) { in get_stubs_size()
257 (void *)sechdrs[i].sh_addr, in get_stubs_size()
258 sechdrs[i].sh_size / sizeof(Elf64_Rela)); in get_stubs_size()
265 sort((void *)sechdrs[i].sh_addr, in get_stubs_size()
266 sechdrs[i].sh_size / sizeof(Elf64_Rela), in get_stubs_size()
269 relocs += count_relocs((void *)sechdrs[i].sh_addr, in get_stubs_size()
270 sechdrs[i].sh_size in get_stubs_size()
320 static Elf64_Sym *find_dot_toc(Elf64_Shdr *sechdrs, in find_dot_toc() argument
327 syms = (Elf64_Sym *)sechdrs[symindex].sh_addr; in find_dot_toc()
328 numsyms = sechdrs[symindex].sh_size / sizeof(Elf64_Sym); in find_dot_toc()
339 Elf64_Shdr *sechdrs, in module_frob_arch_sections() argument
348 if (strcmp(secstrings + sechdrs[i].sh_name, ".stubs") == 0) in module_frob_arch_sections()
350 else if (strcmp(secstrings + sechdrs[i].sh_name, ".toc") == 0) { in module_frob_arch_sections()
352 if (sechdrs[i].sh_addralign < 8) in module_frob_arch_sections()
353 sechdrs[i].sh_addralign = 8; in module_frob_arch_sections()
355 else if (strcmp(secstrings+sechdrs[i].sh_name,"__versions")==0) in module_frob_arch_sections()
356 dedotify_versions((void *)hdr + sechdrs[i].sh_offset, in module_frob_arch_sections()
357 sechdrs[i].sh_size); in module_frob_arch_sections()
360 while ((p = strstr(secstrings + sechdrs[i].sh_name, ".init"))) in module_frob_arch_sections()
363 if (sechdrs[i].sh_type == SHT_SYMTAB) in module_frob_arch_sections()
364 dedotify((void *)hdr + sechdrs[i].sh_offset, in module_frob_arch_sections()
365 sechdrs[i].sh_size / sizeof(Elf64_Sym), in module_frob_arch_sections()
367 + sechdrs[sechdrs[i].sh_link].sh_offset); in module_frob_arch_sections()
383 sechdrs[me->arch.stubs_section].sh_size = get_stubs_size(hdr, sechdrs); in module_frob_arch_sections()
393 static inline unsigned long my_r2(const Elf64_Shdr *sechdrs, struct module *me) in my_r2() argument
395 return (sechdrs[me->arch.toc_section].sh_addr & ~0xfful) + 0x8000; in my_r2()
399 static inline int create_stub(const Elf64_Shdr *sechdrs, in create_stub() argument
409 reladdr = (unsigned long)entry - my_r2(sechdrs, me); in create_stub()
427 static unsigned long stub_for_addr(const Elf64_Shdr *sechdrs, in stub_for_addr() argument
434 num_stubs = sechdrs[me->arch.stubs_section].sh_size / sizeof(*stubs); in stub_for_addr()
437 stubs = (void *)sechdrs[me->arch.stubs_section].sh_addr; in stub_for_addr()
446 if (!create_stub(sechdrs, &stubs[i], addr, me)) in stub_for_addr()
522 int apply_relocate_add(Elf64_Shdr *sechdrs, in apply_relocate_add() argument
529 Elf64_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
535 sechdrs[relsec].sh_info); in apply_relocate_add()
539 sym = find_dot_toc(sechdrs, strtab, symindex); in apply_relocate_add()
543 sym->st_value = my_r2(sechdrs, me); in apply_relocate_add()
547 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) { in apply_relocate_add()
549 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
552 sym = (Elf64_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
575 *(unsigned long *)location = my_r2(sechdrs, me); in apply_relocate_add()
580 value -= my_r2(sechdrs, me); in apply_relocate_add()
593 value -= my_r2(sechdrs, me); in apply_relocate_add()
601 value -= my_r2(sechdrs, me); in apply_relocate_add()
614 value -= my_r2(sechdrs, me); in apply_relocate_add()
627 value -= my_r2(sechdrs, me); in apply_relocate_add()
639 value = stub_for_addr(sechdrs, value, me); in apply_relocate_add()
694 value = my_r2(sechdrs, me) - (unsigned long)location; in apply_relocate_add()
765 static unsigned long create_ftrace_stub(const Elf64_Shdr *sechdrs, in create_ftrace_stub() argument
786 num_stubs = sechdrs[me->arch.stubs_section].sh_size / sizeof(*entry); in create_ftrace_stub()
789 entry = (void *)sechdrs[me->arch.stubs_section].sh_addr; in create_ftrace_stub()
817 static unsigned long create_ftrace_stub(const Elf64_Shdr *sechdrs, in create_ftrace_stub() argument
820 return stub_for_addr(sechdrs, addr, me); in create_ftrace_stub()
824 int module_finalize_ftrace(struct module *mod, const Elf_Shdr *sechdrs) in module_finalize_ftrace() argument
826 mod->arch.tramp = create_ftrace_stub(sechdrs, mod, in module_finalize_ftrace()
829 mod->arch.tramp_regs = create_ftrace_stub(sechdrs, mod, in module_finalize_ftrace()