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