Home
last modified time | relevance | path

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

12

/arch/powerpc/kernel/
Dmodule_32.c88 const Elf32_Shdr *sechdrs, in get_plt_size() argument
100 if ((strstr(secstrings + sechdrs[i].sh_name, ".init") != NULL) in get_plt_size()
105 if (strstr(secstrings + sechdrs[i].sh_name, ".debug")) in get_plt_size()
108 if (sechdrs[i].sh_type == SHT_RELA) { in get_plt_size()
111 (void *)hdr + sechdrs[i].sh_offset, in get_plt_size()
112 sechdrs[i].sh_size / sizeof(Elf32_Rela)); in get_plt_size()
119 sort((void *)hdr + sechdrs[i].sh_offset, in get_plt_size()
120 sechdrs[i].sh_size / sizeof(Elf32_Rela), in get_plt_size()
124 + sechdrs[i].sh_offset, in get_plt_size()
125 sechdrs[i].sh_size in get_plt_size()
[all …]
Dmodule_64.c246 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()
[all …]
Dmodule.c21 const Elf_Shdr *sechdrs, in find_section() argument
27 secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; in find_section()
29 if (strcmp(secstrings+sechdrs[i].sh_name, name) == 0) in find_section()
30 return &sechdrs[i]; in find_section()
35 const Elf_Shdr *sechdrs, struct module *me) in module_finalize() argument
40 rc = module_finalize_ftrace(me, sechdrs); in module_finalize()
45 sect = find_section(hdr, sechdrs, "__ftr_fixup"); in module_finalize()
51 sect = find_section(hdr, sechdrs, "__mmu_ftr_fixup"); in module_finalize()
58 sect = find_section(hdr, sechdrs, "__fw_ftr_fixup"); in module_finalize()
66 sect = find_section(hdr, sechdrs, ".opd"); in module_finalize()
[all …]
/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 …]
/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.c307 static int __apply_relocate(Elf_Shdr *sechdrs, const char *strtab, in __apply_relocate() argument
324 sechdrs[relsec].sh_info); in __apply_relocate()
326 r.rel = (void *)sechdrs[relsec].sh_addr; in __apply_relocate()
329 for (i = 0; i < sechdrs[relsec].sh_size / reloc_sz; i++) { in __apply_relocate()
331 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in __apply_relocate()
334 sym = (Elf_Sym *)sechdrs[symindex].sh_addr in __apply_relocate()
392 int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, in apply_relocate() argument
396 return __apply_relocate(sechdrs, strtab, symindex, relsec, me, false); in apply_relocate()
400 int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
404 return __apply_relocate(sechdrs, strtab, symindex, relsec, me, true); in apply_relocate_add()
[all …]
/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 …]
/arch/arc/kernel/
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 …]
/arch/hexagon/kernel/
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 …]
/arch/sh/kernel/
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()
100 const Elf_Shdr *sechdrs, in module_finalize() argument
105 ret |= module_dwarf_finalize(hdr, sechdrs, me); in module_finalize()
/arch/x86/kernel/
Dmodule.c89 int apply_relocate(Elf32_Shdr *sechdrs, in apply_relocate() argument
96 Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate()
101 relsec, sechdrs[relsec].sh_info); in apply_relocate()
102 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate()
104 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate()
108 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate()
129 int apply_relocate_add(Elf64_Shdr *sechdrs, in apply_relocate_add() argument
136 Elf64_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
142 relsec, sechdrs[relsec].sh_info); in apply_relocate_add()
143 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
[all …]
/arch/openrisc/kernel/
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()
/arch/microblaze/kernel/
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()
32 relsec, sechdrs[relsec].sh_info); in apply_relocate_add()
34 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) { in apply_relocate_add()
36 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr + in apply_relocate_add()
38 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr + in apply_relocate_add()
117 int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, in module_finalize() argument
/arch/arm64/kernel/
Dmodule-plts.c71 u64 module_emit_plt_entry(struct module *mod, Elf64_Shdr *sechdrs, in module_emit_plt_entry() argument
77 struct plt_entry *plt = (struct plt_entry *)sechdrs[pltsec->plt_shndx].sh_addr; in module_emit_plt_entry()
103 u64 module_emit_veneer_for_adrp(struct module *mod, Elf64_Shdr *sechdrs, in module_emit_veneer_for_adrp() argument
108 struct plt_entry *plt = (struct plt_entry *)sechdrs[pltsec->plt_shndx].sh_addr; in module_emit_veneer_for_adrp()
255 int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
269 if (!strcmp(secstrings + sechdrs[i].sh_name, ".plt")) in module_frob_arch_sections()
271 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".init.plt")) in module_frob_arch_sections()
274 !strcmp(secstrings + sechdrs[i].sh_name, in module_frob_arch_sections()
276 tramp = sechdrs + i; in module_frob_arch_sections()
277 else if (sechdrs[i].sh_type == SHT_SYMTAB) in module_frob_arch_sections()
[all …]
Dmodule.c228 static int reloc_insn_adrp(struct module *mod, Elf64_Shdr *sechdrs, in reloc_insn_adrp() argument
244 val = module_emit_veneer_for_adrp(mod, sechdrs, place, val & ~0xfff); in reloc_insn_adrp()
255 int apply_relocate_add(Elf64_Shdr *sechdrs, in apply_relocate_add() argument
267 Elf64_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
269 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
271 loc = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
275 sym = (Elf64_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
401 ovf = reloc_insn_adrp(me, sechdrs, loc, val); in apply_relocate_add()
446 val = module_emit_plt_entry(me, sechdrs, loc, &rel[i], sym); in apply_relocate_add()
474 const Elf_Shdr *sechdrs, in module_finalize() argument
[all …]
/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()
/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
/arch/riscv/kernel/
Dmodule-sections.c90 int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
101 if (!strcmp(secstrings + sechdrs[i].sh_name, ".plt")) in module_frob_arch_sections()
102 mod->arch.plt.shdr = sechdrs + i; in module_frob_arch_sections()
103 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".got")) in module_frob_arch_sections()
104 mod->arch.got.shdr = sechdrs + i; in module_frob_arch_sections()
105 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".got.plt")) in module_frob_arch_sections()
106 mod->arch.got_plt.shdr = sechdrs + i; in module_frob_arch_sections()
124 Elf_Rela *relas = (void *)ehdr + sechdrs[i].sh_offset; in module_frob_arch_sections()
125 int num_rela = sechdrs[i].sh_size / sizeof(Elf_Rela); in module_frob_arch_sections()
126 Elf_Shdr *dst_sec = sechdrs + sechdrs[i].sh_info; in module_frob_arch_sections()
[all …]
/arch/c6x/kernel/
Dmodule.c41 int apply_relocate_add(Elf32_Shdr *sechdrs, in apply_relocate_add() argument
47 Elf32_Rela *rel = (void *) sechdrs[relsec].sh_addr; in apply_relocate_add()
55 relsec, sechdrs[relsec].sh_info, offset); in apply_relocate_add()
57 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
59 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
64 sym = (Elf_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
/arch/parisc/kernel/
Dmodule.c299 CONST Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
312 const Elf_Rela *rels = (void *)sechdrs[i].sh_addr; in module_frob_arch_sections()
313 unsigned long nrels = sechdrs[i].sh_size / sizeof(*rels); in module_frob_arch_sections()
316 if (strncmp(secstrings + sechdrs[i].sh_name, in module_frob_arch_sections()
320 if (sechdrs[i].sh_type != SHT_RELA) in module_frob_arch_sections()
340 s = sechdrs[i].sh_info; in module_frob_arch_sections()
518 int apply_relocate_add(Elf_Shdr *sechdrs, in apply_relocate_add() argument
525 Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; in apply_relocate_add()
532 unsigned int targetsec = sechdrs[relsec].sh_info; in apply_relocate_add()
538 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
[all …]
/arch/csky/kernel/
Dmodule.c50 int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
54 Elf32_Rela *rel = (void *) sechdrs[relsec].sh_addr; in apply_relocate_add()
59 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocate_add()
61 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
63 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocate_add()
/arch/alpha/kernel/
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 …]
/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()
/arch/arm/kernel/
Dmodule.c66 apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, in apply_relocate() argument
69 Elf32_Shdr *symsec = sechdrs + symindex; in apply_relocate()
70 Elf32_Shdr *relsec = sechdrs + relindex; in apply_relocate()
71 Elf32_Shdr *dstsec = sechdrs + relsec->sh_info; in apply_relocate()
328 const Elf_Shdr *sechdrs, const char *name) in find_mod_section() argument
331 const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; in find_mod_section()
333 for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) in find_mod_section()
343 int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, in module_finalize() argument
348 const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; in module_finalize()
349 const Elf_Shdr *sechdrs_end = sechdrs + hdr->e_shnum; in module_finalize()
[all …]
/arch/s390/kernel/
Dmodule.c109 int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, in module_frob_arch_sections() argument
121 switch (sechdrs[i].sh_type) { in module_frob_arch_sections()
123 symtab = sechdrs + i; in module_frob_arch_sections()
138 strings = (void *) hdr + sechdrs[symtab->sh_link].sh_offset; in module_frob_arch_sections()
154 if (sechdrs[i].sh_type != SHT_RELA) in module_frob_arch_sections()
156 nrela = sechdrs[i].sh_size / sizeof(Elf_Rela); in module_frob_arch_sections()
157 rela = (void *) hdr + sechdrs[i].sh_offset; in module_frob_arch_sections()
415 int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, in apply_relocate_add() argument
426 relsec, sechdrs[relsec].sh_info); in apply_relocate_add()
427 base = sechdrs[sechdrs[relsec].sh_info].sh_addr; in apply_relocate_add()
[all …]

12