Home
last modified time | relevance | path

Searched refs:sechdrs (Results 1 – 25 of 45) sorted by relevance

12

/linux/arch/powerpc/kernel/
H A Dmodule_64.c208 const Elf64_Shdr *sechdrs, in get_stubs_size() argument
217 if (sechdrs[i].sh_type == SHT_RELA) { in get_stubs_size()
220 (void *)sechdrs[i].sh_addr, in get_stubs_size()
221 sechdrs[i].sh_size / sizeof(Elf64_Rela)); in get_stubs_size()
228 sort((void *)sechdrs[i].sh_addr, in get_stubs_size()
229 sechdrs[i].sh_size / sizeof(Elf64_Rela), in get_stubs_size()
232 relocs += count_relocs((void *)sechdrs[i].sh_addr, in get_stubs_size()
233 sechdrs[i].sh_size in get_stubs_size()
237 relocs += count_relocs((void *)sechdrs[i].sh_addr, in get_stubs_size()
238 sechdrs[i].sh_size in get_stubs_size()
[all …]
H A Dmodule.c20 const Elf_Shdr *sechdrs, in find_section() argument
26 secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; in find_section()
28 if (strcmp(secstrings+sechdrs[i].sh_name, name) == 0) in find_section()
29 return &sechdrs[i]; in find_section()
34 const Elf_Shdr *sechdrs, struct module *me) in module_finalize() argument
39 rc = module_finalize_ftrace(me, sechdrs); in module_finalize()
44 sect = find_section(hdr, sechdrs, "__ftr_fixup"); in module_finalize()
50 sect = find_section(hdr, sechdrs, "__mmu_ftr_fixup"); in module_finalize()
57 sect = find_section(hdr, sechdrs, "__fw_ftr_fixup"); in module_finalize()
65 sect = find_section(hdr, sechdrs, ".opd"); in module_finalize()
[all …]
/linux/arch/mips/kernel/
H A Dvpe.c184 Elf_Shdr *sechdrs, const char *secstrings) in layout_sections() argument
198 sechdrs[i].sh_entsize = ~0UL; in layout_sections()
202 Elf_Shdr *s = &sechdrs[i]; in layout_sections()
425 static int apply_relocations(Elf32_Shdr *sechdrs, in apply_relocations() argument
431 Elf32_Rel *rel = (void *) sechdrs[relsec].sh_addr; in apply_relocations()
438 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocations()
442 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocations()
445 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocations()
477 static void simplify_symbols(Elf_Shdr *sechdrs, in simplify_symbols() argument
483 Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr; in simplify_symbols()
[all …]
H A Dmodule.c303 static int __apply_relocate(Elf_Shdr *sechdrs, const char *strtab, in __apply_relocate() argument
319 sechdrs[relsec].sh_info); in __apply_relocate()
321 r.rel = (void *)sechdrs[relsec].sh_addr; in __apply_relocate()
324 for (i = 0; i < sechdrs[relsec].sh_size / reloc_sz; i++) { in __apply_relocate()
326 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in __apply_relocate()
329 sym = (Elf_Sym *)sechdrs[symindex].sh_addr in __apply_relocate()
376 int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, in apply_relocate() argument
380 return __apply_relocate(sechdrs, strtab, symindex, relsec, me, false); in apply_relocate()
384 int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
388 return __apply_relocate(sechdrs, strtab, symindex, relsec, me, true); in apply_relocate_add()
[all …]
/linux/arch/loongarch/kernel/
H A Dmodule-sections.c13 Elf_Addr module_emit_got_entry(struct module *mod, Elf_Shdr *sechdrs, Elf_Addr val) in module_emit_got_entry() argument
17 struct got_entry *got = get_got_entry(val, sechdrs, got_sec); in module_emit_got_entry()
23 got = (struct got_entry *)sechdrs[got_sec->shndx].sh_addr; in module_emit_got_entry()
39 Elf_Addr module_emit_plt_entry(struct module *mod, Elf_Shdr *sechdrs, Elf_Addr val) in module_emit_plt_entry() argument
44 struct plt_entry *plt = get_plt_entry(val, sechdrs, plt_sec, plt_idx_sec); in module_emit_plt_entry()
53 plt = (struct plt_entry *)sechdrs[plt_sec->shndx].sh_addr; in module_emit_plt_entry()
55 plt_idx = (struct plt_idx_entry *)sechdrs[plt_idx_sec->shndx].sh_addr; in module_emit_plt_entry()
105 int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
115 if (!strcmp(secstrings + sechdrs[i].sh_name, ".got")) in module_frob_arch_sections()
117 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".plt")) in module_frob_arch_sections()
[all …]
H A Dmodule.c123 Elf_Shdr *sechdrs, u32 *location, Elf_Addr v, in apply_r_larch_sop_push_plt_pcrel() argument
129 v = module_emit_plt_entry(mod, sechdrs, v); in apply_r_larch_sop_push_plt_pcrel()
132 v = module_emit_plt_entry(mod, sechdrs, v); in apply_r_larch_sop_push_plt_pcrel()
299 Elf_Shdr *sechdrs, u32 *location, Elf_Addr v, in apply_r_larch_b26() argument
306 v = module_emit_plt_entry(mod, sechdrs, v); in apply_r_larch_b26()
309 v = module_emit_plt_entry(mod, sechdrs, v); in apply_r_larch_b26()
394 Elf_Shdr *sechdrs, u32 *location, Elf_Addr v, in apply_r_larch_got_pc() argument
400 v = module_emit_got_entry(mod, sechdrs, v); in apply_r_larch_got_pc()
473 int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
486 Elf_Rela *rel = (void *) sechdrs[relsec].sh_addr; in apply_relocate_add()
[all …]
/linux/arch/m68k/kernel/
H A Dmodule.c22 int apply_relocate(Elf32_Shdr *sechdrs, in apply_relocate() argument
29 Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate()
34 sechdrs[relsec].sh_info); in apply_relocate()
35 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate()
37 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate()
41 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate()
62 int apply_relocate_add(Elf32_Shdr *sechdrs, in apply_relocate_add() argument
69 Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
74 sechdrs[relsec].sh_info); in apply_relocate_add()
75 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
[all …]
/linux/arch/arc/kernel/
H A Dmodule.c26 int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
45 int apply_relocate_add(Elf32_Shdr *sechdrs, in apply_relocate_add() argument
52 Elf32_Rela *rel_entry = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
61 tgtsec = sechdrs[relsec].sh_info; in apply_relocate_add()
62 tgt_addr = sechdrs[tgtsec].sh_addr; in apply_relocate_add()
63 sym_sec = (Elf32_Sym *) sechdrs[symindex].sh_addr; in apply_relocate_add()
64 n = sechdrs[relsec].sh_size / sizeof(*rel_entry); in apply_relocate_add()
67 module->arch.secstr + sechdrs[tgtsec].sh_name, tgt_addr); in apply_relocate_add()
86 s = module->arch.secstr + sechdrs[sym_entry->st_shndx].sh_name; in apply_relocate_add()
114 if (strcmp(module->arch.secstr+sechdrs[tgtsec].sh_name, ".eh_frame") == 0) in apply_relocate_add()
[all …]
/linux/kernel/
H A Dkexec_file.c123 vfree(pi->sechdrs); in kimage_file_post_load_cleanup()
124 pi->sechdrs = NULL; in kimage_file_post_load_cleanup()
898 const Elf_Shdr *sechdrs; in kexec_purgatory_setup_kbuf() local
904 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; in kexec_purgatory_setup_kbuf()
909 if (!(sechdrs[i].sh_flags & SHF_ALLOC)) in kexec_purgatory_setup_kbuf()
912 align = sechdrs[i].sh_addralign; in kexec_purgatory_setup_kbuf()
913 if (sechdrs[i].sh_type != SHT_NOBITS) { in kexec_purgatory_setup_kbuf()
917 kbuf->bufsz += sechdrs[i].sh_size; in kexec_purgatory_setup_kbuf()
922 bss_sz += sechdrs[i].sh_size; in kexec_purgatory_setup_kbuf()
962 Elf_Shdr *sechdrs; in kexec_purgatory_setup_sechdrs() local
[all …]
/linux/arch/arm64/kernel/
H A Dmodule-plts.c69 u64 module_emit_plt_entry(struct module *mod, Elf64_Shdr *sechdrs, in module_emit_plt_entry() argument
75 struct plt_entry *plt = (struct plt_entry *)sechdrs[pltsec->plt_shndx].sh_addr; in module_emit_plt_entry()
101 u64 module_emit_veneer_for_adrp(struct module *mod, Elf64_Shdr *sechdrs, in module_emit_veneer_for_adrp() argument
106 struct plt_entry *plt = (struct plt_entry *)sechdrs[pltsec->plt_shndx].sh_addr; in module_emit_veneer_for_adrp()
280 int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
294 if (!strcmp(secstrings + sechdrs[i].sh_name, ".plt")) in module_frob_arch_sections()
296 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".init.plt")) in module_frob_arch_sections()
298 else if (!strcmp(secstrings + sechdrs[i].sh_name, in module_frob_arch_sections()
300 tramp = sechdrs + i; in module_frob_arch_sections()
301 else if (!strcmp(secstrings + sechdrs[i].sh_name, in module_frob_arch_sections()
[all …]
H A Dmodule.c204 static int reloc_insn_adrp(struct module *mod, Elf64_Shdr *sechdrs, in reloc_insn_adrp() argument
220 val = module_emit_veneer_for_adrp(mod, sechdrs, place, val & ~0xfff); in reloc_insn_adrp()
231 int apply_relocate_add(Elf64_Shdr *sechdrs, in apply_relocate_add() argument
243 Elf64_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
245 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
247 loc = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
251 sym = (Elf64_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
377 ovf = reloc_insn_adrp(me, sechdrs, loc, val, me); in apply_relocate_add()
420 val = module_emit_plt_entry(me, sechdrs, loc, &rel[i], sym); in apply_relocate_add()
453 const Elf_Shdr *sechdrs, in module_init_ftrace_plt() argument
[all …]
/linux/arch/hexagon/kernel/
H A Dmodule.c27 int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
37 secstrings + sechdrs[i].sh_name); in module_frob_arch_sections()
38 if (strcmp(secstrings + sechdrs[i].sh_name, ".plt") == 0) in module_frob_arch_sections()
40 if (strcmp(secstrings + sechdrs[i].sh_name, ".got.plt") == 0) in module_frob_arch_sections()
42 if (strcmp(secstrings + sechdrs[i].sh_name, ".rela.plt") == 0) in module_frob_arch_sections()
67 int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
75 unsigned int nrelocs = sechdrs[relsec].sh_size / sizeof(Elf32_Rela); in apply_relocate_add()
76 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
77 Elf32_Word sym_info = sechdrs[relsec].sh_info; in apply_relocate_add()
78 Elf32_Sym *sym_base = (Elf32_Sym *) sechdrs[symindex].sh_addr; in apply_relocate_add()
[all …]
/linux/arch/sh/kernel/
H A Dmodule.c24 int apply_relocate_add(Elf32_Shdr *sechdrs, in apply_relocate_add() argument
31 Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
38 sechdrs[relsec].sh_info); in apply_relocate_add()
39 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
41 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
45 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
91 const Elf_Shdr *sechdrs, in module_finalize() argument
96 ret |= module_dwarf_finalize(hdr, sechdrs, me); in module_finalize()
/linux/arch/microblaze/kernel/
H A Dmodule.c18 int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
23 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
29 relsec, sechdrs[relsec].sh_info); in apply_relocate_add()
31 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) { in apply_relocate_add()
33 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr + in apply_relocate_add()
35 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr + in apply_relocate_add()
91 int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, in module_finalize() argument
/linux/kernel/module/
H A Dlivepatch.c33 size = sizeof(*info->sechdrs) * info->hdr->e_shnum; in copy_module_elf()
34 mod->klp_info->sechdrs = kmemdup(info->sechdrs, size, GFP_KERNEL); in copy_module_elf()
35 if (!mod->klp_info->sechdrs) { in copy_module_elf()
41 size = info->sechdrs[info->hdr->e_shstrndx].sh_size; in copy_module_elf()
58 mod->klp_info->sechdrs[symndx].sh_addr = (unsigned long)mod->core_kallsyms.symtab; in copy_module_elf()
63 kfree(mod->klp_info->sechdrs); in copy_module_elf()
71 kfree(mod->klp_info->sechdrs); in free_module_elf()
H A Dversion.c18 Elf_Shdr *sechdrs = info->sechdrs; in check_version() local
48 versions = (void *)sechdrs[versindex].sh_addr; in check_version()
49 num_versions = sechdrs[versindex].sh_size in check_version()
112 Elf_Shdr *sechdrs = info->sechdrs; in modversion_ext_start() local
123 start->crc = (const u32 *)sechdrs[crc_idx].sh_addr; in modversion_ext_start()
124 start->name = (const char *)sechdrs[name_idx].sh_addr; in modversion_ext_start()
125 start->remaining = sechdrs[crc_idx].sh_size / sizeof(*start->crc); in modversion_ext_start()
H A Dkallsyms.c40 const Elf_Shdr *sechdrs = info->sechdrs; in elf_type() local
54 if (sechdrs[sym->st_shndx].sh_flags & SHF_EXECINSTR) in elf_type()
56 if (sechdrs[sym->st_shndx].sh_flags & SHF_ALLOC && in elf_type()
57 sechdrs[sym->st_shndx].sh_type != SHT_NOBITS) { in elf_type()
58 if (!(sechdrs[sym->st_shndx].sh_flags & SHF_WRITE)) in elf_type()
60 else if (sechdrs[sym->st_shndx].sh_flags & ARCH_SHF_SMALL) in elf_type()
65 if (sechdrs[sym->st_shndx].sh_type == SHT_NOBITS) { in elf_type()
66 if (sechdrs[sym->st_shndx].sh_flags & ARCH_SHF_SMALL) in elf_type()
71 if (strstarts(info->secstrings + sechdrs[sy in elf_type()
78 is_core_symbol(const Elf_Sym * src,const Elf_Shdr * sechdrs,unsigned int shnum,unsigned int pcpundx) is_core_symbol() argument
[all...]
/linux/arch/parisc/kernel/
H A Dmodule.c268 CONST Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
282 const Elf_Rela *rels = (void *)sechdrs[i].sh_addr; in module_frob_arch_sections()
283 unsigned long nrels = sechdrs[i].sh_size / sizeof(*rels); in module_frob_arch_sections()
286 if (strncmp(secstrings + sechdrs[i].sh_name, in module_frob_arch_sections()
290 if (sechdrs[i].sh_type != SHT_RELA) in module_frob_arch_sections()
310 s = sechdrs[i].sh_info; in module_frob_arch_sections()
489 int apply_relocate_add(Elf_Shdr *sechdrs, in apply_relocate_add() argument
496 Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
503 unsigned int targetsec = sechdrs[relsec].sh_info; in apply_relocate_add()
509 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
[all …]
/linux/arch/loongarch/include/asm/
H A Dmodule.h52 Elf_Addr module_emit_got_entry(struct module *mod, Elf_Shdr *sechdrs, Elf_Addr val);
53 Elf_Addr module_emit_plt_entry(struct module *mod, Elf_Shdr *sechdrs, Elf_Addr val);
86 static inline int get_plt_idx(unsigned long val, Elf_Shdr *sechdrs, const struct mod_section *sec) in get_plt_idx() argument
89 struct plt_idx_entry *plt_idx = (struct plt_idx_entry *)sechdrs[sec->shndx].sh_addr; in get_plt_idx()
100 Elf_Shdr *sechdrs, in get_plt_entry() argument
104 int plt_idx = get_plt_idx(val, sechdrs, sec_plt_idx); in get_plt_entry()
105 struct plt_entry *plt = (struct plt_entry *)sechdrs[sec_plt->shndx].sh_addr; in get_plt_entry()
114 Elf_Shdr *sechdrs, in get_got_entry() argument
118 struct got_entry *got = (struct got_entry *)sechdrs[sec->shndx].sh_addr; in get_got_entry()
/linux/arch/nios2/kernel/
H A Dmodule.c23 int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
28 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
31 sechdrs[relsec].sh_info); in apply_relocate_add()
33 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) { in apply_relocate_add()
37 = ((void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
42 = ((Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
112 int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, in module_finalize() argument
/linux/arch/openrisc/kernel/
H A Dmodule.c16 int apply_relocate_add(Elf32_Shdr *sechdrs, in apply_relocate_add() argument
23 Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
29 sechdrs[relsec].sh_info); in apply_relocate_add()
30 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
32 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
37 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
/linux/arch/alpha/kernel/
H A Dmodule.c64 module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs, in module_frob_arch_sections() argument
72 esechdrs = sechdrs + hdr->e_shnum; in module_frob_arch_sections()
78 for (s = sechdrs; s < esechdrs; ++s) in module_frob_arch_sections()
83 me->arch.gotsecindex = s - sechdrs; in module_frob_arch_sections()
110 for (s = sechdrs; s < esechdrs; ++s) in module_frob_arch_sections()
133 apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
137 Elf64_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
138 unsigned long i, n = sechdrs[relsec].sh_size / sizeof(*rela); in apply_relocate_add()
144 sechdrs[relsec].sh_info); in apply_relocate_add()
146 base = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr; in apply_relocate_add()
[all …]
/linux/arch/riscv/kernel/
H A Dmodule-sections.c115 int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
130 if (!strcmp(secstrings + sechdrs[i].sh_name, ".plt")) in module_frob_arch_sections()
131 mod->arch.plt.shdr = sechdrs + i; in module_frob_arch_sections()
132 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".got")) in module_frob_arch_sections()
133 mod->arch.got.shdr = sechdrs + i; in module_frob_arch_sections()
134 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".got.plt")) in module_frob_arch_sections()
135 mod->arch.got_plt.shdr = sechdrs + i; in module_frob_arch_sections()
153 size_t num_relas = sechdrs[i].sh_size / sizeof(Elf_Rela); in module_frob_arch_sections()
154 Elf_Rela *relas = (void *)ehdr + sechdrs[i].sh_offset; in module_frob_arch_sections()
155 Elf_Shdr *dst_sec = sechdrs + sechdrs[i].sh_info; in module_frob_arch_sections()
[all …]
/linux/arch/arm64/include/asm/
H A Dmodule.h25 u64 module_emit_plt_entry(struct module *mod, Elf64_Shdr *sechdrs,
29 u64 module_emit_veneer_for_adrp(struct module *mod, Elf64_Shdr *sechdrs,
55 const Elf_Shdr *sechdrs, in find_section() argument
59 const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; in find_section()
61 for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) { in find_section()
/linux/arch/xtensa/kernel/
H A Dmodule.c47 int apply_relocate_add(Elf32_Shdr *sechdrs, in apply_relocate_add() argument
54 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
60 sechdrs[relsec].sh_info); in apply_relocate_add()
62 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) { in apply_relocate_add()
63 location = (char *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
65 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()

12