Lines Matching defs:shdr

156 static inline const char *elf_sec__name(const GElf_Shdr *shdr,
159 return secstrs->d_buf + shdr->sh_name;
162 static inline int elf_sec__is_text(const GElf_Shdr *shdr,
165 return strstr(elf_sec__name(shdr, secstrs), "text") != NULL;
168 static inline bool elf_sec__is_data(const GElf_Shdr *shdr,
171 return strstr(elf_sec__name(shdr, secstrs), "data") != NULL;
174 static bool elf_sec__filter(GElf_Shdr *shdr, Elf_Data *secstrs)
176 return elf_sec__is_text(shdr, secstrs) ||
177 elf_sec__is_data(shdr, secstrs);
183 GElf_Shdr shdr;
187 gelf_getshdr(sec, &shdr);
189 if ((addr >= shdr.sh_addr) &&
190 (addr < (shdr.sh_addr + shdr.sh_size)))
230 GElf_Shdr shdr;
244 found = !!elf_section_by_name(elf, &ehdr, &shdr, sec, NULL);
541 GElf_Shdr shdr;
553 if (!scn || !gelf_getshdr(scn, &shdr) || !shdr.sh_link)
557 di->dynstr_data = elf_getdata(elf_getscn(elf, shdr.sh_link), NULL);
590 static bool get_plt_got_name(GElf_Shdr *shdr, size_t i,
609 vi.offset = shdr->sh_offset + di->plt_got_data->d_off + i + disp;
638 GElf_Shdr shdr;
643 scn = elf_section_by_name(elf, ehdr, &shdr, ".plt.got", NULL);
644 if (!scn || !shdr.sh_entsize)
650 for (i = 0; i < shdr.sh_size; i += shdr.sh_entsize) {
651 if (!get_plt_got_name(&shdr, i, &di, buf, buf_sz))
652 snprintf(buf, buf_sz, "offset_%#" PRIx64 "@plt", (u64)shdr.sh_offset + i);
653 sym = symbol__new(shdr.sh_offset + i, shdr.sh_entsize, STB_GLOBAL, STT_FUNC, buf);
860 GElf_Shdr shdr;
885 sec = elf_section_by_name(elf, &ehdr, &shdr,
890 sec = elf_section_by_name(elf, &ehdr, &shdr,
895 sec = elf_section_by_name(elf, &ehdr, &shdr,
1125 GElf_Shdr shdr;
1149 sec = elf_section_by_name(elf, &ehdr, &shdr,
1367 GElf_Sym *sym, GElf_Shdr *shdr,
1379 sym->st_value -= shdr->sh_addr - shdr->sh_offset;
1392 map__set_start(map, shdr->sh_addr + ref_reloc(kmap));
1393 map__set_end(map, map__start(map) + shdr->sh_size);
1394 map__set_pgoff(map, shdr->sh_offset);
1417 map__set_pgoff(map, shdr->sh_offset);
1435 start += map__start(map) + shdr->sh_offset;
1454 map__set_start(curr_map, shdr->sh_addr + ref_reloc(kmap));
1455 map__set_end(curr_map, map__start(curr_map) + shdr->sh_size);
1456 map__set_pgoff(curr_map, shdr->sh_offset);
1494 GElf_Shdr shdr;
1510 shdr = syms_ss->dynshdr;
1513 shdr = syms_ss->symshdr;
1527 sec = elf_getscn(elf, shdr.sh_link);
1551 nr_syms = shdr.sh_size / shdr.sh_entsize;
1632 gelf_getshdr(sec, &shdr);
1642 if (!(shdr.sh_flags & SHF_ALLOC))
1653 if (shdr.sh_type == SHT_NOBITS) {
1658 gelf_getshdr(sec, &shdr);
1662 if (is_label && !elf_sec__filter(&shdr, secstrs))
1665 section_name = elf_sec__name(&shdr, secstrs);
1675 if (dso__process_kernel_symbol(dso, map, &sym, &shdr, kmaps, kmap, &curr_dso, &curr_map,
1689 __func__, (u64)sym.st_value, (u64)shdr.sh_addr,
1690 (u64)shdr.sh_offset);
1693 * to use shdr.sh_addr and shdr.sh_offset to
1699 sym.st_value -= shdr.sh_addr - shdr.sh_offset;
2660 GElf_Shdr shdr;
2755 if (elf_section_by_name(*elf, &ehdr, &shdr, SDT_BASE_SCN, NULL))
2756 sdt_adjust_loc(tmp, shdr.sh_offset);
2759 if (elf_section_by_name(*elf, &ehdr, &shdr, SDT_PROBES_SCN, NULL))
2760 sdt_adjust_refctr(tmp, shdr.sh_addr, shdr.sh_offset);
2791 GElf_Shdr shdr;
2807 scn = elf_section_by_name(elf, &ehdr, &shdr, SDT_NOTE_SCN, NULL);
2813 if ((shdr.sh_type != SHT_NOTE) || (shdr.sh_flags & SHF_ALLOC)) {