Home
last modified time | relevance | path

Searched refs:shdr (Results 1 – 25 of 102) sorted by relevance

12345

/external/google-breakpad/src/common/linux/
Dsynth_elf_unittest.cc240 const Shdr* shdr = in TYPED_TEST() local
242 EXPECT_EQ(0U, shdr[0].sh_name); in TYPED_TEST()
243 EXPECT_EQ(static_cast<unsigned int>(SHT_NULL), shdr[0].sh_type); in TYPED_TEST()
244 EXPECT_EQ(0U, shdr[0].sh_flags); in TYPED_TEST()
245 EXPECT_EQ(0U, shdr[0].sh_addr); in TYPED_TEST()
246 EXPECT_EQ(0U, shdr[0].sh_offset); in TYPED_TEST()
247 EXPECT_EQ(0U, shdr[0].sh_size); in TYPED_TEST()
248 EXPECT_EQ(0U, shdr[0].sh_link); in TYPED_TEST()
249 EXPECT_EQ(0U, shdr[0].sh_info); in TYPED_TEST()
250 EXPECT_EQ(0U, shdr[0].sh_addralign); in TYPED_TEST()
[all …]
/external/elfutils/src/tests/
Dupdate4.c43 Elf32_Shdr *shdr; in main() local
122 shdr = elf32_getshdr (scn); in main()
123 if (shdr == NULL) in main()
131 shdr->sh_type = SHT_PROGBITS; in main()
132 shdr->sh_flags = SHF_ALLOC | SHF_EXECINSTR; in main()
133 shdr->sh_addr = 0; in main()
134 shdr->sh_link = 0; in main()
135 shdr->sh_info = 0; in main()
136 shdr->sh_entsize = 1; in main()
158 shdr = elf32_getshdr (scn); in main()
[all …]
Dasm-tst1.c158 GElf_Shdr *shdr; in main() local
168 shdr = gelf_getshdr (scn, &shdr_mem); in main()
169 if (shdr == NULL) in main()
177 if (strcmp (elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name), in main()
181 elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name), in main()
186 if (shdr->sh_type != (cnt == 3 ? SHT_STRTAB : SHT_PROGBITS)) in main()
192 if ((cnt == 1 && shdr->sh_flags != (SHF_ALLOC | SHF_EXECINSTR)) in main()
193 || (cnt == 2 && shdr->sh_flags != (SHF_ALLOC | SHF_WRITE)) in main()
194 || (cnt == 3 && shdr->sh_flags != 0)) in main()
200 if (shdr->sh_addr != 0) in main()
[all …]
Dasm-tst2.c174 GElf_Shdr *shdr; in main() local
184 shdr = gelf_getshdr (scn, &shdr_mem); in main()
185 if (shdr == NULL) in main()
193 if (strcmp (elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name), in main()
197 elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name), in main()
202 if (shdr->sh_type != (cnt == 2 ? SHT_STRTAB : SHT_PROGBITS)) in main()
208 if ((cnt == 1 && shdr->sh_flags != (SHF_ALLOC | SHF_WRITE)) in main()
209 || (cnt == 2 && shdr->sh_flags != 0)) in main()
215 if (shdr->sh_addr != 0) in main()
221 if ((cnt == 1 && shdr->sh_offset != ((sizeof (Elf32_Ehdr) + 15) & ~15)) in main()
[all …]
Dasm-tst9.c208 GElf_Shdr *shdr; in main() local
218 shdr = gelf_getshdr (escn, &shdr_mem); in main()
219 if (shdr == NULL) in main()
227 if (strcmp (elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name), in main()
231 elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name), in main()
236 if (shdr->sh_type != (cnt == 2 ? SHT_STRTAB : SHT_PROGBITS)) in main()
242 if ((cnt == 1 && shdr->sh_flags != (SHF_ALLOC | SHF_WRITE)) in main()
243 || (cnt == 2 && shdr->sh_flags != 0)) in main()
249 if (shdr->sh_addr != 0) in main()
255 if ((cnt == 1 && shdr->sh_offset != ((sizeof (Elf32_Ehdr) + 15) & ~15)) in main()
[all …]
Dsectiondump.c82 GElf_Shdr *shdr; in handle_section() local
88 shdr = gelf_getshdr (scn, &shdr_mem); in handle_section()
89 if (ehdr == NULL || shdr == NULL) in handle_section()
103 elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name), in handle_section()
104 shdr->sh_type, in handle_section()
105 shdr->sh_flags, in handle_section()
106 shdr->sh_addr, in handle_section()
107 shdr->sh_offset, in handle_section()
108 shdr->sh_size, in handle_section()
109 shdr->sh_link, in handle_section()
[all …]
Dalldts.c130 Elf32_Shdr *shdr = elf32_getshdr (scn); in main() local
131 if (shdr == NULL) in main()
141 const Elf32_Off *const dynscn_offset = &shdr->sh_offset; in main()
142 shdr->sh_type = SHT_DYNAMIC; in main()
143 shdr->sh_flags = SHF_ALLOC | SHF_WRITE; in main()
144 shdr->sh_link = SHN_UNDEF; in main()
145 shdr->sh_info = SHN_UNDEF; in main()
147 shdr->sh_addr = 0x1a0; in main()
187 shdr = elf32_getshdr (scn); in main()
188 if (shdr == NULL) in main()
[all …]
/external/elfutils/src/libelf/
Delf32_getshdr.c58 result = scn->shdr.ELFW(e,LIBELFBITS); in ElfW2()
70 ElfW2(LIBELFBITS,Shdr) *shdr = elf->state.ELFW(elf,LIBELFBITS).shdr = in ElfW2()
72 if (elf->state.ELFW(elf,LIBELFBITS).shdr == NULL) in ElfW2()
110 memcpy (shdr, file_shdr, size); in ElfW2()
130 CONVERT_TO (shdr[cnt].sh_name, notcvt[cnt].sh_name); in ElfW2()
131 CONVERT_TO (shdr[cnt].sh_type, notcvt[cnt].sh_type); in ElfW2()
132 CONVERT_TO (shdr[cnt].sh_flags, notcvt[cnt].sh_flags); in ElfW2()
133 CONVERT_TO (shdr[cnt].sh_addr, notcvt[cnt].sh_addr); in ElfW2()
134 CONVERT_TO (shdr[cnt].sh_offset, notcvt[cnt].sh_offset); in ElfW2()
135 CONVERT_TO (shdr[cnt].sh_size, notcvt[cnt].sh_size); in ElfW2()
[all …]
Delf32_updatenull.c182 update_if_changed (scn0->shdr.ELFW(e,LIBELFBITS)->sh_size, in __elfw2()
191 if (list->data[1].shdr.ELFW(e,LIBELFBITS) == NULL) in __elfw2()
199 ElfW2(LIBELFBITS,Shdr) *shdr = scn->shdr.ELFW(e,LIBELFBITS); in __elfw2()
202 assert (shdr != NULL); in __elfw2()
203 ElfW2(LIBELFBITS,Word) sh_entsize = shdr->sh_entsize; in __elfw2()
204 ElfW2(LIBELFBITS,Word) sh_align = shdr->sh_addralign ?: 1; in __elfw2()
207 switch (shdr->sh_type) in __elfw2()
250 update_if_changed (shdr->sh_entsize, sh_entsize, in __elfw2()
292 > shdr->sh_size)) in __elfw2()
321 shdr->sh_offset in __elfw2()
[all …]
Dgelf_getshdr.c61 Elf32_Shdr *shdr local
62 = scn->shdr.e32 ?: __elf32_getshdr_rdlock (scn);
64 if (shdr == NULL)
71 dst->name = shdr->name
87 Elf64_Shdr *shdr local
88 = scn->shdr.e64 ?: __elf64_getshdr_rdlock (scn);
90 if (shdr == NULL)
97 result = memcpy (dst, shdr, sizeof (GElf_Shdr));
Dgelf_update_shdr.c54 Elf32_Shdr *shdr in gelf_update_shdr() local
55 = scn->shdr.e32 ?: __elf32_getshdr_wrlock (scn); in gelf_update_shdr()
57 if (shdr == NULL) in gelf_update_shdr()
75 shdr->name = src->name in gelf_update_shdr()
89 Elf64_Shdr *shdr in gelf_update_shdr() local
90 = scn->shdr.e64 ?: __elf64_getshdr_wrlock (scn); in gelf_update_shdr()
92 if (shdr == NULL) in gelf_update_shdr()
99 (void) memcpy (shdr, src, sizeof (GElf_Shdr)); in gelf_update_shdr()
/external/elfutils/src/libasm/
Dasm_end.c79 GElf_Shdr *shdr; in binary_end() local
145 shdr = gelf_getshdr (strscn, &shdr_mem); in binary_end()
146 if (strtabdata == NULL || shdr == NULL) in binary_end()
155 shdr->sh_type = SHT_STRTAB; in binary_end()
156 assert (shdr->sh_entsize == 0); in binary_end()
158 (void) gelf_update_shdr (strscn, shdr); in binary_end()
163 shdr = gelf_getshdr (symscn, &shdr_mem); in binary_end()
164 if (data == NULL || shdr == NULL) in binary_end()
228 shdr = gelf_getshdr (xndxscn, &shdr_mem); in binary_end()
229 if (xndxdata == NULL || shdr == NULL) in binary_end()
[all …]
/external/elfutils/src/src/
Dunstrip.c324 section_can_shrink (const GElf_Shdr *shdr) in section_can_shrink() argument
326 switch (shdr->sh_type) in section_can_shrink()
355 GElf_Shdr *shdr = gelf_getshdr (elf_getscn (elf, i), &shdr_mem); in symtab_count_leading_section_symbols() local
356 ELF_CHECK (shdr != NULL, _("cannot get section header: %s")); in symtab_count_leading_section_symbols()
364 sym->st_value = shdr->sh_addr; in symtab_count_leading_section_symbols()
396 adjust_relocs (Elf_Scn *outscn, Elf_Scn *inscn, const GElf_Shdr *shdr, in adjust_relocs() argument
408 switch (shdr->sh_type) in adjust_relocs()
411 for (size_t i = 0; i < shdr->sh_size / shdr->sh_entsize; ++i) in adjust_relocs()
422 for (size_t i = 0; i < shdr->sh_size / shdr->sh_entsize; ++i) in adjust_relocs()
449 const size_t onent = shdr->sh_size / shdr->sh_entsize; in adjust_relocs()
[all …]
Delflint.c97 GElf_Shdr *shdr, int idx);
317 GElf_Shdr *shdr; in section_name() local
323 shdr = gelf_getshdr (elf_getscn (ebl->elf, idx), &shdr_mem); in section_name()
324 if (shdr == NULL) in section_name()
327 ret = elf_strptr (ebl->elf, shstrndx, shdr->sh_name); in section_name()
445 GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem); in check_elf_header() local
446 if (shdr != NULL) in check_elf_header()
449 if (shdr->sh_size == 0) in check_elf_header()
453 shnum = shdr->sh_size; in check_elf_header()
462 GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem); in check_elf_header() local
[all …]
Dstrip.c409 GElf_Shdr shdr; in handle_elf() member
604 if (gelf_getshdr (scn, &shdr_info[cnt].shdr) == NULL) in handle_elf()
609 shdr_info[cnt].shdr.sh_name); in handle_elf()
621 shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link; in handle_elf()
629 || (shdr_info[cnt].shdr.sh_flags & SHF_ALLOC) == 0) in handle_elf()
630 shdr_info[cnt].shdr.sh_offset = 0; in handle_elf()
634 if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX)) in handle_elf()
636 elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0); in handle_elf()
637 shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt; in handle_elf()
639 else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP)) in handle_elf()
[all …]
Dldgeneric.c529 assert (SCNINFO_SHDR (fileinfo->scninfo[newgrpid].shdr).sh_type in matching_group_comdat_scn()
531 assert (SCNINFO_SHDR (oldp->file->scninfo[oldgrpid].shdr).sh_type in matching_group_comdat_scn()
658 SCNINFO_SHDR (fileinfo->scninfo[shndx].shdr).sh_name); in check_definition()
683 SCNINFO_SHDR (oldfile->scninfo[shndx].shdr).sh_name); in check_definition()
834 SCNINFO_SHDR (fileinfo->scninfo[shndx].shdr).sh_name)); in find_section_group()
872 XElf_Shdr *shdr = &SCNINFO_SHDR (fileinfo->scninfo[idx].shdr); in mark_section_group() local
878 elf_strptr (fileinfo->elf, fileinfo->shstrndx, shdr->sh_name)); in mark_section_group()
884 shdr->sh_name)) in mark_section_group()
886 && ((shdr->sh_type != SHT_RELA && shdr->sh_type != SHT_REL) in mark_section_group()
890 SCNINFO_SHDR (fileinfo->scninfo[shdr->sh_info].shdr).sh_name))))) in mark_section_group()
[all …]
Dobjdump.c361 show_relocs_x (Ebl *ebl, GElf_Shdr *shdr, Elf_Data *symdata, in show_relocs_x() argument
392 if (shdr == NULL || destshdr == NULL) in show_relocs_x()
417 show_relocs_rel (Ebl *ebl, GElf_Shdr *shdr, Elf_Data *data, in show_relocs_rel() argument
422 int nentries = shdr->sh_size / sh_entsize; in show_relocs_rel()
431 show_relocs_x (ebl, shdr, symdata, xndxdata, symstrndx, shstrndx, in show_relocs_rel()
438 show_relocs_rela (Ebl *ebl, GElf_Shdr *shdr, Elf_Data *data, in show_relocs_rela() argument
443 int nentries = shdr->sh_size / sh_entsize; in show_relocs_rela()
452 show_relocs_x (ebl, shdr, symdata, xndxdata, symstrndx, shstrndx, in show_relocs_rela()
459 section_match (Elf *elf, uint32_t scnndx, GElf_Shdr *shdr, size_t shstrndx) in section_match() argument
465 const char *name = elf_strptr (elf, shstrndx, shdr->sh_name); in section_match()
[all …]
/external/libunwind/src/
Delfxx.c141 Elf_W(Shdr) shdr; in elf_w()
142 GET_SHDR_FIELD(ei, str_soff, &shdr, sh_offset); in elf_w()
143 GET_SHDR_FIELD(ei, str_soff, &shdr, sh_size); in elf_w()
144 if (shdr.sh_offset + shdr.sh_size > size) { in elf_w()
146 (unsigned long) (shdr.sh_offset + shdr.sh_size), in elf_w()
151 Debug (16, "strtab=0x%lx\n", (long) shdr.sh_offset); in elf_w()
152 *offset = shdr.sh_offset; in elf_w()
168 Elf_W(Shdr) shdr; in elf_w()
169 GET_SHDR_FIELD(ei, shdr_offset, &shdr, sh_type); in elf_w()
170 switch (shdr.sh_type) { in elf_w()
[all …]
/external/valgrind/VEX/unused/
Dlinker.c331 Elf_Shdr* shdr = (Elf_Shdr*)(ehdrC + ehdr->e_shoff); in findElfSection() local
332 char* sh_strtab = ehdrC + shdr[ehdr->e_shstrndx].sh_offset; in findElfSection()
337 if (shdr[i].sh_type == sh_type in findElfSection()
342 && 0 != memcmp(".stabstr", sh_strtab + shdr[i].sh_name, 8) in findElfSection()
344 ptr = ehdrC + shdr[i].sh_offset; in findElfSection()
420 Elf_Shdr* shdr, int shnum, in do_Elf_Rel_relocations() argument
426 Elf_Rel* rtab = (Elf_Rel*) (ehdrC + shdr[shnum].sh_offset); in do_Elf_Rel_relocations()
427 int nent = shdr[shnum].sh_size / sizeof(Elf_Rel); in do_Elf_Rel_relocations()
428 int target_shndx = shdr[shnum].sh_info; in do_Elf_Rel_relocations()
429 int symtab_shndx = shdr[shnum].sh_link; in do_Elf_Rel_relocations()
[all …]
/external/ltrace/
Dltrace-elf.c116 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
[all …]
/external/libvpx/libvpx/build/make/
Dobj_int_extract.c342 Elf32_Shdr shdr; in parse_elf_string_table() local
344 if (parse_elf_section(elf, s_idx, &shdr, NULL)) { in parse_elf_string_table()
350 return (char *)(elf->buf + shdr.sh_offset + idx); in parse_elf_string_table()
352 Elf64_Shdr shdr; in parse_elf_string_table() local
354 if (parse_elf_section(elf, s_idx, NULL, &shdr)) { in parse_elf_string_table()
360 return (char *)(elf->buf + shdr.sh_offset + idx); in parse_elf_string_table()
403 Elf32_Shdr shdr; in parse_elf() local
405 parse_elf_section(&elf, i, &shdr, NULL); in parse_elf()
407 if (shdr.sh_type == SHT_STRTAB) { in parse_elf()
410 strcpy(strtsb_name, (char *)(elf.buf + shdr.sh_offset + shdr.sh_name)); in parse_elf()
[all …]
/external/valgrind/VEX/switchback/
Dlinker.c399 Elf_Shdr* shdr = (Elf_Shdr*)(ehdrC + ehdr->e_shoff);
400 char* sh_strtab = ehdrC + shdr[ehdr->e_shstrndx].sh_offset;
405 if (shdr[i].sh_type == sh_type
410 && 0 != memcmp(".stabstr", sh_strtab + shdr[i].sh_name, 8)
412 ptr = ehdrC + shdr[i].sh_offset;
516 Elf_Shdr* shdr, int shnum,
522 Elf_Rel* rtab = (Elf_Rel*) (ehdrC + shdr[shnum].sh_offset);
523 int nent = shdr[shnum].sh_size / sizeof(Elf_Rel);
524 int target_shndx = shdr[shnum].sh_info;
525 int symtab_shndx = shdr[shnum].sh_link;
[all …]
/external/elfutils/src/libdwfl/
Dderelocate.c91 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in cache_sections() local
92 if (shdr == NULL) in cache_sections()
95 if ((shdr->sh_flags & SHF_ALLOC) && shdr->sh_addr == 0 in cache_sections()
101 &shdr->sh_addr) != DWFL_E_NOERROR) in cache_sections()
103 shdr = gelf_getshdr (scn, &shdr_mem); in cache_sections()
104 if (unlikely (shdr == NULL)) in cache_sections()
108 if (shdr->sh_flags & SHF_ALLOC) in cache_sections()
111 shdr->sh_name); in cache_sections()
119 newref->start = dwfl_adjusted_address (mod, shdr->sh_addr); in cache_sections()
120 newref->end = newref->start + shdr->sh_size; in cache_sections()
[all …]
Ddwfl_report_elf.c74 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in __libdwfl_elf_address_range() local
75 if (unlikely (shdr == NULL)) in __libdwfl_elf_address_range()
78 if (shdr->sh_flags & SHF_ALLOC) in __libdwfl_elf_address_range()
80 const GElf_Xword align = shdr->sh_addralign ?: 1; in __libdwfl_elf_address_range()
82 if (shdr->sh_addr == 0 in __libdwfl_elf_address_range()
88 shdr->sh_addr = next; in __libdwfl_elf_address_range()
92 start = base = shdr->sh_addr; in __libdwfl_elf_address_range()
129 end = shdr->sh_addr + shdr->sh_size; in __libdwfl_elf_address_range()
130 if (likely (shdr->sh_addr != 0) in __libdwfl_elf_address_range()
131 && unlikely (! gelf_update_shdr (scn, shdr))) in __libdwfl_elf_address_range()
[all …]
/external/linux-tools-perf/src/tools/perf/util/
Dsymbol-elf.c88 static inline const char *elf_sec__name(const GElf_Shdr *shdr, in elf_sec__name() argument
91 return secstrs->d_buf + shdr->sh_name; in elf_sec__name()
94 static inline int elf_sec__is_text(const GElf_Shdr *shdr, in elf_sec__is_text() argument
97 return strstr(elf_sec__name(shdr, secstrs), "text") != NULL; in elf_sec__is_text()
100 static inline bool elf_sec__is_data(const GElf_Shdr *shdr, in elf_sec__is_data() argument
103 return strstr(elf_sec__name(shdr, secstrs), "data") != NULL; in elf_sec__is_data()
106 static bool elf_sec__is_a(GElf_Shdr *shdr, Elf_Data *secstrs, in elf_sec__is_a() argument
111 return elf_sec__is_text(shdr, secstrs); in elf_sec__is_a()
113 return elf_sec__is_data(shdr, secstrs); in elf_sec__is_a()
122 GElf_Shdr shdr; in elf_addr_to_index() local
[all …]

12345