Home
last modified time | relevance | path

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

12

/Linux-v4.19/arch/powerpc/kernel/
Dmodule_64.c251 const Elf64_Shdr *sechdrs) in get_stubs_size() argument
259 if (sechdrs[i].sh_type == SHT_RELA) { in get_stubs_size()
262 (void *)sechdrs[i].sh_addr, in get_stubs_size()
263 sechdrs[i].sh_size / sizeof(Elf64_Rela)); in get_stubs_size()
270 sort((void *)sechdrs[i].sh_addr, in get_stubs_size()
271 sechdrs[i].sh_size / sizeof(Elf64_Rela), in get_stubs_size()
274 relocs += count_relocs((void *)sechdrs[i].sh_addr, in get_stubs_size()
275 sechdrs[i].sh_size in get_stubs_size()
325 static Elf64_Sym *find_dot_toc(Elf64_Shdr *sechdrs, in find_dot_toc() argument
332 syms = (Elf64_Sym *)sechdrs[symindex].sh_addr; in find_dot_toc()
[all …]
Dmodule_32.c100 const Elf32_Shdr *sechdrs, in get_plt_size() argument
112 if ((strstr(secstrings + sechdrs[i].sh_name, ".init") != NULL) in get_plt_size()
117 if (strstr(secstrings + sechdrs[i].sh_name, ".debug")) in get_plt_size()
120 if (sechdrs[i].sh_type == SHT_RELA) { in get_plt_size()
123 (void *)hdr + sechdrs[i].sh_offset, in get_plt_size()
124 sechdrs[i].sh_size / sizeof(Elf32_Rela)); in get_plt_size()
131 sort((void *)hdr + sechdrs[i].sh_offset, in get_plt_size()
132 sechdrs[i].sh_size / sizeof(Elf32_Rela), in get_plt_size()
136 + sechdrs[i].sh_offset, in get_plt_size()
137 sechdrs[i].sh_size in get_plt_size()
[all …]
Dmodule.c33 const Elf_Shdr *sechdrs, in find_section() argument
39 secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; in find_section()
41 if (strcmp(secstrings+sechdrs[i].sh_name, name) == 0) in find_section()
42 return &sechdrs[i]; in find_section()
47 const Elf_Shdr *sechdrs, struct module *me) in module_finalize() argument
52 rc = module_finalize_ftrace(me, sechdrs); in module_finalize()
57 sect = find_section(hdr, sechdrs, "__ftr_fixup"); in module_finalize()
63 sect = find_section(hdr, sechdrs, "__mmu_ftr_fixup"); in module_finalize()
70 sect = find_section(hdr, sechdrs, "__fw_ftr_fixup"); in module_finalize()
78 sect = find_section(hdr, sechdrs, "__spec_barrier_fixup"); in module_finalize()
[all …]
/Linux-v4.19/arch/mips/kernel/
Dvpe.c183 Elf_Shdr *sechdrs, const char *secstrings) in layout_sections() argument
197 sechdrs[i].sh_entsize = ~0UL; in layout_sections()
201 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 …]
Dmodule.c319 static int __apply_relocate(Elf_Shdr *sechdrs, const char *strtab, in __apply_relocate() argument
336 sechdrs[relsec].sh_info); in __apply_relocate()
338 r.rel = (void *)sechdrs[relsec].sh_addr; in __apply_relocate()
341 for (i = 0; i < sechdrs[relsec].sh_size / reloc_sz; i++) { in __apply_relocate()
343 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in __apply_relocate()
346 sym = (Elf_Sym *)sechdrs[symindex].sh_addr in __apply_relocate()
404 int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, in apply_relocate() argument
408 return __apply_relocate(sechdrs, strtab, symindex, relsec, me, false); in apply_relocate()
412 int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
416 return __apply_relocate(sechdrs, strtab, symindex, relsec, me, true); in apply_relocate_add()
[all …]
/Linux-v4.19/arch/m68k/kernel/
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-v4.19/arch/sparc/kernel/
Dmodule.c56 Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
65 for (symidx = 0; sechdrs[symidx].sh_type != SHT_SYMTAB; symidx++) { in module_frob_arch_sections()
71 sym = (Elf_Sym *)sechdrs[symidx].sh_addr; in module_frob_arch_sections()
72 strtab = (char *)sechdrs[sechdrs[symidx].sh_link].sh_addr; in module_frob_arch_sections()
74 for (i = 1; i < sechdrs[symidx].sh_size / sizeof(Elf_Sym); i++) { in module_frob_arch_sections()
83 int apply_relocate_add(Elf_Shdr *sechdrs, in apply_relocate_add() argument
90 Elf_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
95 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
99 location = (u8 *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
109 sym = (Elf_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
[all …]
/Linux-v4.19/arch/arc/kernel/
Dmodule.c29 int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
48 int apply_relocate_add(Elf32_Shdr *sechdrs, in apply_relocate_add() argument
55 Elf32_Rela *rel_entry = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
64 tgtsec = sechdrs[relsec].sh_info; in apply_relocate_add()
65 tgt_addr = sechdrs[tgtsec].sh_addr; in apply_relocate_add()
66 sym_sec = (Elf32_Sym *) sechdrs[symindex].sh_addr; in apply_relocate_add()
67 n = sechdrs[relsec].sh_size / sizeof(*rel_entry); in apply_relocate_add()
70 module->arch.secstr + sechdrs[tgtsec].sh_name, tgt_addr); in apply_relocate_add()
89 s = module->arch.secstr + sechdrs[sym_entry->st_shndx].sh_name; in apply_relocate_add()
117 if (strcmp(module->arch.secstr+sechdrs[tgtsec].sh_name, ".eh_frame") == 0) in apply_relocate_add()
[all …]
/Linux-v4.19/arch/x86/kernel/
Dmodule.c101 int apply_relocate(Elf32_Shdr *sechdrs, in apply_relocate() argument
108 Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate()
113 relsec, sechdrs[relsec].sh_info); in apply_relocate()
114 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate()
116 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate()
120 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate()
141 int apply_relocate_add(Elf64_Shdr *sechdrs, in apply_relocate_add() argument
148 Elf64_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
154 relsec, sechdrs[relsec].sh_info); in apply_relocate_add()
155 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
[all …]
/Linux-v4.19/arch/hexagon/kernel/
Dmodule.c40 int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
50 secstrings + sechdrs[i].sh_name); in module_frob_arch_sections()
51 if (strcmp(secstrings + sechdrs[i].sh_name, ".plt") == 0) in module_frob_arch_sections()
53 if (strcmp(secstrings + sechdrs[i].sh_name, ".got.plt") == 0) in module_frob_arch_sections()
55 if (strcmp(secstrings + sechdrs[i].sh_name, ".rela.plt") == 0) in module_frob_arch_sections()
80 int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
88 unsigned int nrelocs = sechdrs[relsec].sh_size / sizeof(Elf32_Rela); in apply_relocate_add()
89 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
90 Elf32_Word sym_info = sechdrs[relsec].sh_info; in apply_relocate_add()
91 Elf32_Sym *sym_base = (Elf32_Sym *) sechdrs[symindex].sh_addr; in apply_relocate_add()
[all …]
/Linux-v4.19/arch/sh/kernel/
Dmodule.c37 int apply_relocate_add(Elf32_Shdr *sechdrs, in apply_relocate_add() argument
44 Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
51 sechdrs[relsec].sh_info); in apply_relocate_add()
52 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
54 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
58 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
113 const Elf_Shdr *sechdrs, in module_finalize() argument
118 ret |= module_dwarf_finalize(hdr, sechdrs, me); in module_finalize()
/Linux-v4.19/kernel/
Dkexec_file.c168 vfree(pi->sechdrs); in kimage_file_post_load_cleanup()
169 pi->sechdrs = NULL; in kimage_file_post_load_cleanup()
726 const Elf_Shdr *sechdrs; in kexec_purgatory_setup_kbuf() local
732 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; in kexec_purgatory_setup_kbuf()
737 if (!(sechdrs[i].sh_flags & SHF_ALLOC)) in kexec_purgatory_setup_kbuf()
740 align = sechdrs[i].sh_addralign; in kexec_purgatory_setup_kbuf()
741 if (sechdrs[i].sh_type != SHT_NOBITS) { in kexec_purgatory_setup_kbuf()
745 kbuf->bufsz += sechdrs[i].sh_size; in kexec_purgatory_setup_kbuf()
750 bss_sz += sechdrs[i].sh_size; in kexec_purgatory_setup_kbuf()
789 Elf_Shdr *sechdrs; in kexec_purgatory_setup_sechdrs() local
[all …]
/Linux-v4.19/arch/microblaze/kernel/
Dmodule.c21 int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
26 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
35 relsec, sechdrs[relsec].sh_info); in apply_relocate_add()
37 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) { in apply_relocate_add()
39 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr + in apply_relocate_add()
41 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr + in apply_relocate_add()
120 int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, in module_finalize() argument
/Linux-v4.19/arch/openrisc/kernel/
Dmodule.c20 int apply_relocate_add(Elf32_Shdr *sechdrs, in apply_relocate_add() argument
27 Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
33 sechdrs[relsec].sh_info); in apply_relocate_add()
34 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
36 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
41 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
/Linux-v4.19/arch/arm64/kernel/
Dmodule-plts.c199 int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
213 if (!strcmp(secstrings + sechdrs[i].sh_name, ".plt")) in module_frob_arch_sections()
214 mod->arch.core.plt = sechdrs + i; in module_frob_arch_sections()
215 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".init.plt")) in module_frob_arch_sections()
216 mod->arch.init.plt = sechdrs + i; in module_frob_arch_sections()
218 !strcmp(secstrings + sechdrs[i].sh_name, in module_frob_arch_sections()
220 tramp = sechdrs + i; in module_frob_arch_sections()
221 else if (sechdrs[i].sh_type == SHT_SYMTAB) in module_frob_arch_sections()
222 syms = (Elf64_Sym *)sechdrs[i].sh_addr; in module_frob_arch_sections()
235 Elf64_Rela *rels = (void *)ehdr + sechdrs[i].sh_offset; in module_frob_arch_sections()
[all …]
/Linux-v4.19/arch/nios2/kernel/
Dmodule.c44 int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
49 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
52 sechdrs[relsec].sh_info); in apply_relocate_add()
54 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) { in apply_relocate_add()
58 = ((void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
63 = ((Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
133 int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, in module_finalize() argument
/Linux-v4.19/arch/h8300/kernel/
Dmodule.c9 int apply_relocate_add(Elf32_Shdr *sechdrs, in apply_relocate_add() argument
16 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
19 sechdrs[relsec].sh_info); in apply_relocate_add()
20 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) { in apply_relocate_add()
23 (uint32_t *)(sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
27 Elf32_Sym *sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
/Linux-v4.19/arch/riscv/kernel/
Dmodule-sections.c87 int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
98 if (!strcmp(secstrings + sechdrs[i].sh_name, ".plt")) in module_frob_arch_sections()
99 mod->arch.plt.shdr = sechdrs + i; in module_frob_arch_sections()
100 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".got")) in module_frob_arch_sections()
101 mod->arch.got.shdr = sechdrs + i; in module_frob_arch_sections()
102 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".got.plt")) in module_frob_arch_sections()
103 mod->arch.got_plt.shdr = sechdrs + i; in module_frob_arch_sections()
121 Elf64_Rela *relas = (void *)ehdr + sechdrs[i].sh_offset; in module_frob_arch_sections()
122 int num_rela = sechdrs[i].sh_size / sizeof(Elf64_Rela); in module_frob_arch_sections()
123 Elf64_Shdr *dst_sec = sechdrs + sechdrs[i].sh_info; in module_frob_arch_sections()
[all …]
/Linux-v4.19/include/linux/
Dmoduleloader.h18 Elf_Shdr *sechdrs,
37 int apply_relocate(Elf_Shdr *sechdrs,
43 static inline int apply_relocate(Elf_Shdr *sechdrs, in apply_relocate() argument
60 int apply_relocate_add(Elf_Shdr *sechdrs,
66 static inline int apply_relocate_add(Elf_Shdr *sechdrs, in apply_relocate_add() argument
80 const Elf_Shdr *sechdrs,
/Linux-v4.19/arch/alpha/kernel/
Dmodule.c76 module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs, in module_frob_arch_sections() argument
84 esechdrs = sechdrs + hdr->e_shnum; in module_frob_arch_sections()
90 for (s = sechdrs; s < esechdrs; ++s) in module_frob_arch_sections()
95 me->arch.gotsecindex = s - sechdrs; in module_frob_arch_sections()
122 for (s = sechdrs; s < esechdrs; ++s) in module_frob_arch_sections()
145 apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
149 Elf64_Rela *rela = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
150 unsigned long i, n = sechdrs[relsec].sh_size / sizeof(*rela); in apply_relocate_add()
156 sechdrs[relsec].sh_info); in apply_relocate_add()
158 base = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr; in apply_relocate_add()
[all …]
/Linux-v4.19/arch/parisc/kernel/
Dmodule.c320 CONST Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
333 const Elf_Rela *rels = (void *)sechdrs[i].sh_addr; in module_frob_arch_sections()
334 unsigned long nrels = sechdrs[i].sh_size / sizeof(*rels); in module_frob_arch_sections()
337 if (strncmp(secstrings + sechdrs[i].sh_name, in module_frob_arch_sections()
341 if (sechdrs[i].sh_type != SHT_RELA) in module_frob_arch_sections()
361 s = sechdrs[i].sh_info; in module_frob_arch_sections()
539 int apply_relocate_add(Elf_Shdr *sechdrs, in apply_relocate_add() argument
546 Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
553 unsigned int targetsec = sechdrs[relsec].sh_info; in apply_relocate_add()
559 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
[all …]
/Linux-v4.19/arch/c6x/kernel/
Dmodule.c45 int apply_relocate_add(Elf32_Shdr *sechdrs, in apply_relocate_add() argument
51 Elf32_Rela *rel = (void *) sechdrs[relsec].sh_addr; in apply_relocate_add()
59 relsec, sechdrs[relsec].sh_info, offset); in apply_relocate_add()
61 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
63 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
68 sym = (Elf_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
/Linux-v4.19/arch/xtensa/kernel/
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()
/Linux-v4.19/arch/arm/kernel/
Dmodule.c62 apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, in apply_relocate() argument
65 Elf32_Shdr *symsec = sechdrs + symindex; in apply_relocate()
66 Elf32_Shdr *relsec = sechdrs + relindex; in apply_relocate()
67 Elf32_Shdr *dstsec = sechdrs + relsec->sh_info; in apply_relocate()
324 const Elf_Shdr *sechdrs, const char *name) in find_mod_section() argument
327 const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; in find_mod_section()
329 for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) in find_mod_section()
339 int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, in module_finalize() argument
344 const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; in module_finalize()
345 const Elf_Shdr *sechdrs_end = sechdrs + hdr->e_shnum; in module_finalize()
[all …]
/Linux-v4.19/arch/s390/kernel/
Dmodule.c102 int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
114 switch (sechdrs[i].sh_type) { in module_frob_arch_sections()
116 symtab = sechdrs + i; in module_frob_arch_sections()
131 strings = (void *) hdr + sechdrs[symtab->sh_link].sh_offset; in module_frob_arch_sections()
147 if (sechdrs[i].sh_type != SHT_RELA) in module_frob_arch_sections()
149 nrela = sechdrs[i].sh_size / sizeof(Elf_Rela); in module_frob_arch_sections()
150 rela = (void *) hdr + sechdrs[i].sh_offset; in module_frob_arch_sections()
408 int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
419 relsec, sechdrs[relsec].sh_info); in apply_relocate_add()
420 base = sechdrs[sechdrs[relsec].sh_info].sh_addr; in apply_relocate_add()
[all …]

12