Lines Matching refs:shdr
116 elf_loaddata(Elf_Scn *scn, GElf_Shdr *shdr) in elf_loaddata() argument
120 || data->d_off || data->d_size != shdr->sh_size) in elf_loaddata()
133 GElf_Shdr shdr; in elf_get_section_if() local
136 if (scn == NULL || gelf_getshdr(scn, &shdr) == NULL) { in elf_get_section_if()
140 if (predicate(scn, &shdr, data)) { in elf_get_section_if()
142 *tgt_shdr = shdr; in elf_get_section_if()
152 inside_p(Elf_Scn *scn, GElf_Shdr *shdr, void *data) in inside_p() argument
155 return addr >= shdr->sh_addr in inside_p()
156 && addr < shdr->sh_addr + shdr->sh_size; in inside_p()
168 type_p(Elf_Scn *scn, GElf_Shdr *shdr, void *data) in type_p() argument
171 return shdr->sh_type == type; in type_p()
188 name_p(Elf_Scn *scn, GElf_Shdr *shdr, void *d) in name_p() argument
193 shdr->sh_name); in name_p()
431 Elf_Scn *scn, GElf_Shdr *shdr, const char *name, in read_symbol_table() argument
435 *countp = shdr->sh_size / shdr->sh_entsize; in read_symbol_table()
444 scn = elf_getscn(lte->elf, shdr->sh_link); in read_symbol_table()
449 shdr->sh_link, filename, elf_errmsg(-1)); in read_symbol_table()
472 GElf_Shdr shdr; in rel_to_rela() local
473 if (elf_get_section_covering(lte, rel->r_offset, &sec, &shdr) < 0 in rel_to_rela()
477 Elf_Data *data = elf_loaddata(sec, &shdr); in rel_to_rela()
481 GElf_Xword offset = rel->r_offset - shdr.sh_addr - data->d_off; in rel_to_rela()
497 elf_read_relocs(struct ltelf *lte, Elf_Scn *scn, GElf_Shdr *shdr, in elf_read_relocs() argument
503 Elf_Data *relplt = elf_loaddata(scn, shdr); in elf_read_relocs()
509 if ((shdr->sh_size % shdr->sh_entsize) != 0) { in elf_read_relocs()
512 shdr->sh_size, shdr->sh_entsize); in elf_read_relocs()
516 GElf_Xword relplt_count = shdr->sh_size / shdr->sh_entsize; in elf_read_relocs()
541 GElf_Shdr shdr; in elf_load_dynamic_entry() local
542 if (elf_get_section_type(lte, SHT_DYNAMIC, &scn, &shdr) < 0 in elf_load_dynamic_entry()
550 Elf_Data *data = elf_loaddata(scn, &shdr); in elf_load_dynamic_entry()
555 for (j = 0; j < shdr.sh_size / shdr.sh_entsize; ++j) { in elf_load_dynamic_entry()
582 GElf_Shdr shdr; in ltelf_read_elf() local
586 if (scn == NULL || gelf_getshdr(scn, &shdr) == NULL) { in ltelf_read_elf()
592 name = elf_strptr(lte->elf, lte->ehdr.e_shstrndx, shdr.sh_name); in ltelf_read_elf()
599 if (shdr.sh_type == SHT_SYMTAB) { in ltelf_read_elf()
601 scn, &shdr, name, <e->symtab, in ltelf_read_elf()
604 } else if (shdr.sh_type == SHT_DYNSYM) { in ltelf_read_elf()
606 scn, &shdr, name, <e->dynsym, in ltelf_read_elf()
609 } else if (shdr.sh_type == SHT_DYNAMIC) { in ltelf_read_elf()
613 lte->dyn_addr = shdr.sh_addr + lte->bias; in ltelf_read_elf()
614 lte->dyn_sz = shdr.sh_size; in ltelf_read_elf()
624 for (j = 0; j < shdr.sh_size / shdr.sh_entsize; ++j) { in ltelf_read_elf()
640 } else if (shdr.sh_type == SHT_PROGBITS in ltelf_read_elf()
641 || shdr.sh_type == SHT_NOBITS) { in ltelf_read_elf()
643 lte->plt_addr = shdr.sh_addr; in ltelf_read_elf()
644 lte->plt_size = shdr.sh_size; in ltelf_read_elf()
645 lte->plt_data = elf_loaddata(scn, &shdr); in ltelf_read_elf()
649 lte->plt_flags = shdr.sh_flags; in ltelf_read_elf()
653 lte->opd_addr = (GElf_Addr *) (long) shdr.sh_addr; in ltelf_read_elf()
654 lte->opd_size = shdr.sh_size; in ltelf_read_elf()
674 GElf_Shdr shdr; in ltelf_read_elf() local
677 if (scn == NULL || gelf_getshdr(scn, &shdr) == NULL) { in ltelf_read_elf()
683 if (shdr.sh_addr == relplt_addr in ltelf_read_elf()
684 && shdr.sh_size == relplt_size) { in ltelf_read_elf()
685 if (elf_read_relocs(lte, scn, &shdr, in ltelf_read_elf()
926 GElf_Shdr shdr; in populate_this_symtab() local
927 if (scn == NULL || gelf_getshdr(scn, &shdr) == NULL) in populate_this_symtab()
930 secflags[i] = shdr.sh_flags; in populate_this_symtab()