Lines Matching refs:sechdrs

183 			    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()
424 static int apply_relocations(Elf32_Shdr *sechdrs, in apply_relocations() argument
430 Elf32_Rel *rel = (void *) sechdrs[relsec].sh_addr; in apply_relocations()
437 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { in apply_relocations()
441 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocations()
444 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr in apply_relocations()
476 static void simplify_symbols(Elf_Shdr *sechdrs, in simplify_symbols() argument
482 Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr; in simplify_symbols()
484 unsigned int i, n = sechdrs[symindex].sh_size / sizeof(Elf_Sym); in simplify_symbols()
489 if (strncmp(secstrings + sechdrs[i].sh_name, ".bss", 4) == 0) { in simplify_symbols()
490 bssbase = sechdrs[i].sh_addr; in simplify_symbols()
523 secbase = sechdrs[sym[i].st_shndx].sh_addr; in simplify_symbols()
535 static void dump_elfsymbols(Elf_Shdr *sechdrs, unsigned int symindex, in dump_elfsymbols() argument
538 Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr; in dump_elfsymbols()
539 unsigned int i, n = sechdrs[symindex].sh_size / sizeof(Elf_Sym); in dump_elfsymbols()
549 static int find_vpe_symbols(struct vpe *v, Elf_Shdr *sechdrs, in find_vpe_symbols() argument
553 Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr; in find_vpe_symbols()
554 unsigned int i, n = sechdrs[symindex].sh_size / sizeof(Elf_Sym); in find_vpe_symbols()
578 Elf_Shdr *sechdrs; in vpe_elfload() local
595 || hdr->e_shentsize != sizeof(*sechdrs)) { in vpe_elfload()
611 sechdrs = (void *)hdr + hdr->e_shoff; in vpe_elfload()
612 secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; in vpe_elfload()
613 sechdrs[0].sh_addr = 0; in vpe_elfload()
620 if ((sechdrs[i].sh_type != SHT_NOBITS) && in vpe_elfload()
621 (len < sechdrs[i].sh_offset + sechdrs[i].sh_size)) { in vpe_elfload()
629 sechdrs[i].sh_addr = (size_t) hdr + in vpe_elfload()
630 sechdrs[i].sh_offset; in vpe_elfload()
633 if (sechdrs[i].sh_type == SHT_SYMTAB) { in vpe_elfload()
635 strindex = sechdrs[i].sh_link; in vpe_elfload()
637 sechdrs[strindex].sh_offset; in vpe_elfload()
640 layout_sections(&mod, hdr, sechdrs, secstrings); in vpe_elfload()
653 if (!(sechdrs[i].sh_flags & SHF_ALLOC)) in vpe_elfload()
656 dest = v->load_addr + sechdrs[i].sh_entsize; in vpe_elfload()
658 if (sechdrs[i].sh_type != SHT_NOBITS) in vpe_elfload()
659 memcpy(dest, (void *)sechdrs[i].sh_addr, in vpe_elfload()
660 sechdrs[i].sh_size); in vpe_elfload()
662 sechdrs[i].sh_addr = (unsigned long)dest; in vpe_elfload()
665 secstrings + sechdrs[i].sh_name, in vpe_elfload()
666 sechdrs[i].sh_addr); in vpe_elfload()
670 simplify_symbols(sechdrs, symindex, strtab, secstrings, in vpe_elfload()
675 const char *strtab = (char *)sechdrs[strindex].sh_addr; in vpe_elfload()
676 unsigned int info = sechdrs[i].sh_info; in vpe_elfload()
683 if (!(sechdrs[info].sh_flags & SHF_ALLOC)) in vpe_elfload()
686 if (sechdrs[i].sh_type == SHT_REL) in vpe_elfload()
687 err = apply_relocations(sechdrs, strtab, in vpe_elfload()
689 else if (sechdrs[i].sh_type == SHT_RELA) in vpe_elfload()
690 err = apply_relocate_add(sechdrs, strtab, in vpe_elfload()
713 if (sechdrs[i].sh_type == SHT_SYMTAB) { in vpe_elfload()
715 strindex = sechdrs[i].sh_link; in vpe_elfload()
717 sechdrs[strindex].sh_offset; in vpe_elfload()
723 sechdrs[i].sh_addr = (size_t) hdr + in vpe_elfload()
724 sechdrs[i].sh_offset; in vpe_elfload()
733 if ((find_vpe_symbols(v, sechdrs, symindex, strtab, &mod)) < 0) { in vpe_elfload()