/linux-master/arch/alpha/kernel/ |
H A D | module.c | 64 module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs, argument 72 esechdrs = sechdrs + hdr->e_shnum; 78 for (s = sechdrs; s < esechdrs; ++s) 83 me->arch.gotsecindex = s - sechdrs; 110 for (s = sechdrs; s < esechdrs; ++s) 133 apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab, argument 137 Elf64_Rela *rela = (void *)sechdrs[relsec].sh_addr; 138 unsigned long i, n = sechdrs[relsec].sh_size / sizeof(*rela); 144 sechdrs[relsec].sh_info); 146 base = (void *)sechdrs[sechdr [all...] |
/linux-master/arch/riscv/kernel/ |
H A D | module-sections.c | 90 int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, argument 101 if (!strcmp(secstrings + sechdrs[i].sh_name, ".plt")) 102 mod->arch.plt.shdr = sechdrs + i; 103 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".got")) 104 mod->arch.got.shdr = sechdrs + i; 105 else if (!strcmp(secstrings + sechdrs[i].sh_name, ".got.plt")) 106 mod->arch.got_plt.shdr = sechdrs + i; 124 Elf_Rela *relas = (void *)ehdr + sechdrs[i].sh_offset; 125 int num_rela = sechdrs[i].sh_size / sizeof(Elf_Rela); 126 Elf_Shdr *dst_sec = sechdrs [all...] |
H A D | elf_kexec.c | 377 const Elf_Shdr *sechdrs; local 382 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; 383 strtab = (char *)pi->ehdr + sechdrs[symtab->sh_link].sh_offset; 384 shstrtab = (char *)pi->ehdr + sechdrs[pi->ehdr->e_shstrndx].sh_offset; 401 name = shstrtab + sechdrs[sym->st_shndx].sh_name; 414 sec_base = pi->sechdrs[sym->st_shndx].sh_addr;
|
H A D | module.c | 777 int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, argument 781 Elf_Rela *rel = (void *) sechdrs[relsec].sh_addr; 789 unsigned int num_relocations = sechdrs[relsec].sh_size / sizeof(*rel); 803 sechdrs[relsec].sh_info); 807 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr 810 sym = (Elf_Sym *)sechdrs[symindex].sh_addr 842 sechdrs[sechdrs[relsec].sh_info].sh_addr 852 (Elf_Sym *)sechdrs[syminde 919 module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) argument [all...] |
/linux-master/kernel/ |
H A D | kexec_file.c | 108 vfree(pi->sechdrs); 109 pi->sechdrs = NULL; 832 const Elf_Shdr *sechdrs; local 838 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; 843 if (!(sechdrs[i].sh_flags & SHF_ALLOC)) 846 align = sechdrs[i].sh_addralign; 847 if (sechdrs[i].sh_type != SHT_NOBITS) { 851 kbuf->bufsz += sechdrs[i].sh_size; 856 bss_sz += sechdrs[i].sh_size; 881 * kexec_purgatory_setup_sechdrs - prepares the pi->sechdrs buffe 896 Elf_Shdr *sechdrs; local 966 const Elf_Shdr *sechdrs; local 1075 const Elf_Shdr *sechdrs; local [all...] |
/linux-master/arch/xtensa/kernel/ |
H A D | module.c | 47 int apply_relocate_add(Elf32_Shdr *sechdrs, argument 54 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; 60 sechdrs[relsec].sh_info); 62 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) { 63 location = (char *)sechdrs[sechdrs[relsec].sh_info].sh_addr 65 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
|
/linux-master/kernel/module/ |
H A D | kallsyms.c | 40 const Elf_Shdr *sechdrs = info->sechdrs; local 54 if (sechdrs[sym->st_shndx].sh_flags & SHF_EXECINSTR) 56 if (sechdrs[sym->st_shndx].sh_flags & SHF_ALLOC && 57 sechdrs[sym->st_shndx].sh_type != SHT_NOBITS) { 58 if (!(sechdrs[sym->st_shndx].sh_flags & SHF_WRITE)) 60 else if (sechdrs[sym->st_shndx].sh_flags & ARCH_SHF_SMALL) 65 if (sechdrs[sym->st_shndx].sh_type == SHT_NOBITS) { 66 if (sechdrs[sym->st_shndx].sh_flags & ARCH_SHF_SMALL) 71 if (strstarts(info->secstrings + sechdrs[sy 78 is_core_symbol(const Elf_Sym *src, const Elf_Shdr *sechdrs, unsigned int shnum, unsigned int pcpundx) argument [all...] |
H A D | strict_rwx.c | 81 int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, argument 91 if ((sechdrs[i].sh_flags & shf_wx) == shf_wx) { 93 mod->name, secstrings + sechdrs[i].sh_name, i);
|
H A D | main.c | 187 Elf_Shdr *shdr = &info->sechdrs[i]; 200 return (void *)info->sechdrs[find_sec(info, name)].sh_addr; 212 *num = info->sechdrs[sec].sh_size / object_size; 213 return (void *)info->sechdrs[sec].sh_addr; 222 Elf_Shdr *shdr = &info->sechdrs[i]; 241 *num = info->sechdrs[sec].sh_size / object_size; 242 return (void *)info->sechdrs[sec].sh_addr; 377 Elf_Shdr *pcpusec = &info->sechdrs[info->index.pcpu]; 473 if (info->sechdrs[info->index.pcpu].sh_size != 0) 1036 Elf_Shdr *infosec = &info->sechdrs[inf 2337 module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod) argument 2432 module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) argument [all...] |
H A D | sysfs.c | 81 if (!sect_empty(&info->sechdrs[i])) 98 Elf_Shdr *sec = &info->sechdrs[i]; 185 if (!sect_empty(&info->sechdrs[i]) && 186 info->sechdrs[i].sh_type == SHT_NOTE) 200 if (sect_empty(&info->sechdrs[i])) 202 if (info->sechdrs[i].sh_type == SHT_NOTE) { 206 nattr->size = info->sechdrs[i].sh_size; 207 nattr->private = (void *)info->sechdrs[i].sh_addr;
|
/linux-master/arch/loongarch/kernel/ |
H A D | module.c | 106 Elf_Shdr *sechdrs, u32 *location, Elf_Addr v, 112 v = module_emit_plt_entry(mod, sechdrs, v); 115 v = module_emit_plt_entry(mod, sechdrs, v); 280 Elf_Shdr *sechdrs, u32 *location, Elf_Addr v, 287 v = module_emit_plt_entry(mod, sechdrs, v); 290 v = module_emit_plt_entry(mod, sechdrs, v); 348 Elf_Shdr *sechdrs, u32 *location, Elf_Addr v, 351 Elf_Addr got = module_emit_got_entry(mod, sechdrs, v); 422 int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, argument 434 Elf_Rela *rel = (void *) sechdrs[relse 105 apply_r_larch_sop_push_plt_pcrel(struct module *mod, Elf_Shdr *sechdrs, u32 *location, Elf_Addr v, s64 *rela_stack, size_t *rela_stack_top, unsigned int type) argument 279 apply_r_larch_b26(struct module *mod, Elf_Shdr *sechdrs, u32 *location, Elf_Addr v, s64 *rela_stack, size_t *rela_stack_top, unsigned int type) argument 347 apply_r_larch_got_pc(struct module *mod, Elf_Shdr *sechdrs, u32 *location, Elf_Addr v, s64 *rela_stack, size_t *rela_stack_top, unsigned int type) argument 499 module_init_ftrace_plt(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod) argument 516 module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod) argument [all...] |
/linux-master/arch/parisc/kernel/ |
H A D | module.c | 280 CONST Elf_Shdr *sechdrs, 294 const Elf_Rela *rels = (void *)sechdrs[i].sh_addr; 295 unsigned long nrels = sechdrs[i].sh_size / sizeof(*rels); 298 if (strncmp(secstrings + sechdrs[i].sh_name, 302 if (sechdrs[i].sh_type != SHT_RELA) 322 s = sechdrs[i].sh_info; 501 int apply_relocate_add(Elf_Shdr *sechdrs, argument 508 Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; 515 unsigned int targetsec = sechdrs[relsec].sh_info; 521 for (i = 0; i < sechdrs[relse 279 module_frob_arch_sections(CONST Elf_Ehdr *hdr, CONST Elf_Shdr *sechdrs, CONST char *secstrings, struct module *me) argument 646 apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, unsigned int symindex, unsigned int relsec, struct module *me) argument 814 register_unwind_table(struct module *me, const Elf_Shdr *sechdrs) argument 839 module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) argument [all...] |
/linux-master/arch/riscv/include/asm/ |
H A D | module.h | 116 const Elf_Shdr *sechdrs, 120 const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 122 for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) { 115 find_section(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, const char *name) argument
|
/linux-master/arch/arm64/kernel/ |
H A D | module.c | 317 static int reloc_insn_adrp(struct module *mod, Elf64_Shdr *sechdrs, argument 333 val = module_emit_veneer_for_adrp(mod, sechdrs, place, val & ~0xfff); 344 int apply_relocate_add(Elf64_Shdr *sechdrs, argument 356 Elf64_Rela *rel = (void *)sechdrs[relsec].sh_addr; 358 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { 360 loc = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr 364 sym = (Elf64_Sym *)sechdrs[symindex].sh_addr 490 ovf = reloc_insn_adrp(me, sechdrs, loc, val); 533 val = module_emit_plt_entry(me, sechdrs, lo 565 module_init_ftrace_plt(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod) argument 586 module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) argument [all...] |
/linux-master/arch/arm/kernel/ |
H A D | module.c | 110 apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, argument 113 Elf32_Shdr *symsec = sechdrs + symindex; 114 Elf32_Shdr *relsec = sechdrs + relindex; 115 Elf32_Shdr *dstsec = sechdrs + relsec->sh_info; 438 const Elf_Shdr *sechdrs, const char *name) 441 const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 443 for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) 453 int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, argument 458 const char *secstrs = (void *)hdr + sechdrs[hd 437 find_mod_section(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, const char *name) argument [all...] |
H A D | vdso.c | 103 Elf32_Shdr *sechdrs; local 108 sechdrs = (void *)ehdr + ehdr->e_shoff; 109 secnames = (void *)ehdr + sechdrs[ehdr->e_shstrndx].sh_offset; 113 if (strcmp(secnames + sechdrs[i].sh_name, name) == 0) { 115 *size = sechdrs[i].sh_size; 116 return (void *)ehdr + sechdrs[i].sh_offset;
|
H A D | module-plts.c | 209 int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, argument 214 Elf32_Shdr *s, *sechdrs_end = sechdrs + ehdr->e_shnum; 221 for (s = sechdrs; s < sechdrs_end; ++s) { 239 for (s = sechdrs + 1; s < sechdrs_end; ++s) { 242 Elf32_Shdr *dstsec = sechdrs + s->sh_info;
|
/linux-master/arch/mips/kernel/ |
H A D | module.c | 313 static int __apply_relocate(Elf_Shdr *sechdrs, const char *strtab, argument 329 sechdrs[relsec].sh_info); 331 r.rel = (void *)sechdrs[relsec].sh_addr; 334 for (i = 0; i < sechdrs[relsec].sh_size / reloc_sz; i++) { 336 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr 339 sym = (Elf_Sym *)sechdrs[symindex].sh_addr 386 int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, argument 390 return __apply_relocate(sechdrs, strtab, symindex, relsec, me, false); 394 int apply_relocate_add(Elf_Shdr *sechdrs, cons argument 424 module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) argument [all...] |
/linux-master/lib/ |
H A D | bug.c | 88 void module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, argument 98 secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 100 if (strcmp(secstrings+sechdrs[i].sh_name, "__bug_table")) 102 mod->bug_table = (void *) sechdrs[i].sh_addr; 103 mod->num_bugs = sechdrs[i].sh_size / sizeof(struct bug_entry);
|
/linux-master/arch/s390/kernel/ |
H A D | module.c | 142 int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, argument 155 switch (sechdrs[i].sh_type) { 157 symtab = sechdrs + i; 172 strings = (void *) hdr + sechdrs[symtab->sh_link].sh_offset; 188 if (sechdrs[i].sh_type != SHT_RELA) 190 nrela = sechdrs[i].sh_size / sizeof(Elf_Rela); 191 rela = (void *) hdr + sechdrs[i].sh_offset; 463 static int __apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, argument 475 relsec, sechdrs[relsec].sh_info); 476 base = sechdrs[sechdr 489 apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, unsigned int symindex, unsigned int relsec, struct module *me) argument 527 module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) argument [all...] |
H A D | machine_kexec_file.c | 315 const Elf_Shdr *sechdrs; local 321 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; 322 strtab = (char *)pi->ehdr + sechdrs[symtab->sh_link].sh_offset; 323 shstrtab = (char *)pi->ehdr + sechdrs[pi->ehdr->e_shstrndx].sh_offset; 339 name = shstrtab + sechdrs[sym->st_shndx].sh_name; 364 val += pi->sechdrs[sym->st_shndx].sh_addr;
|
/linux-master/scripts/mod/ |
H A D | modpost.c | 329 Elf_Shdr *sechdr = &info->sechdrs[secindex]; 351 * Return "" if the index is out of range of info->sechdrs[] array. 356 return sech_name(info, &info->sechdrs[secindex]); 419 Elf_Shdr *sechdrs; local 461 sechdrs = (void *)hdr + hdr->e_shoff; 462 info->sechdrs = sechdrs; 478 info->num_sections = TO_NATIVE(sechdrs[0].sh_size); 484 info->secindex_strings = TO_NATIVE(sechdrs[0].sh_link); 492 sechdrs[ [all...] |
/linux-master/arch/x86/kernel/ |
H A D | machine_kexec_64.c | 394 const Elf_Shdr *sechdrs; local 397 sechdrs = (void *)pi->ehdr + pi->ehdr->e_shoff; 398 strtab = (char *)pi->ehdr + sechdrs[symtabsec->sh_link].sh_offset; 399 shstrtab = (char *)pi->ehdr + sechdrs[pi->ehdr->e_shstrndx].sh_offset; 437 name = shstrtab + sechdrs[sym->st_shndx].sh_name; 460 sec_base = pi->sechdrs[sym->st_shndx].sh_addr;
|
/linux-master/include/linux/ |
H A D | livepatch.h | 233 int klp_apply_section_relocs(struct module *pmod, Elf_Shdr *sechdrs, 247 int klp_apply_section_relocs(struct module *pmod, Elf_Shdr *sechdrs, argument
|
/linux-master/kernel/livepatch/ |
H A D | core.c | 192 static int klp_resolve_symbols(Elf_Shdr *sechdrs, const char *strtab, argument 220 sym = (Elf_Sym *)sechdrs[symndx].sh_addr + ELF_R_SYM(relas[i].r_info); 263 void __weak clear_relocate_add(Elf_Shdr *sechdrs, argument 294 static int klp_write_section_relocs(struct module *pmod, Elf_Shdr *sechdrs, argument 301 Elf_Shdr *sec = sechdrs + secndx; 320 ret = klp_resolve_symbols(sechdrs, strtab, symndx, 325 return apply_relocate_add(sechdrs, strtab, symndx, secndx, pmod); 328 clear_relocate_add(sechdrs, strtab, symndx, secndx, pmod); 332 int klp_apply_section_relocs(struct module *pmod, Elf_Shdr *sechdrs, argument 337 return klp_write_section_relocs(pmod, sechdrs, shstrta [all...] |