Home
last modified time | relevance | path

Searched refs:phnum (Results 1 – 25 of 50) sorted by relevance

12

/third_party/elfutils/libdwfl/
Delf-from-memory.c123 uint_fast16_t phnum; in elf_from_remote_memory() local
138 phnum = ehdr.e32.e_phnum; in elf_from_remote_memory()
140 if (phentsize != sizeof (Elf32_Phdr) || phnum == 0) in elf_from_remote_memory()
155 phnum = ehdr.e64.e_phnum; in elf_from_remote_memory()
157 if (phentsize != sizeof (Elf64_Phdr) || phnum == 0) in elf_from_remote_memory()
172 xlatefrom.d_size = phnum * phentsize; in elf_from_remote_memory()
174 if ((size_t) nread >= phoff + phnum * phentsize) in elf_from_remote_memory()
181 if (initial_bufsize < (size_t)phnum * phentsize) in elf_from_remote_memory()
183 unsigned char *newbuf = realloc (buffer, phnum * phentsize); in elf_from_remote_memory()
193 phnum * phentsize, phnum * phentsize); in elf_from_remote_memory()
[all …]
Dlink_map.c563 size_t phnum; in consider_executable() local
564 if (elf_getphdrnum (mod->main.elf, &phnum) != 0) in consider_executable()
567 for (size_t i = 0; i < phnum; ++i) in consider_executable()
732 GElf_Xword phnum = 0; in dwfl_link_map_report() local
752 phnum = val; \ in dwfl_link_map_report()
786 if (phdr != 0 && phnum != 0 in dwfl_link_map_report()
796 .d_size = phnum * phent, in dwfl_link_map_report()
800 &in.d_size, phdr, phnum * phent, in dwfl_link_map_report()
839 if (e_phnum != phnum || ehdr->e_phentsize != phent) in dwfl_link_map_report()
851 if (unlikely (phnum > SIZE_MAX / phent)) in dwfl_link_map_report()
[all …]
Ddwfl_module_getdwarf.c127 size_t phnum; in open_elf() local
128 if (unlikely (elf_getphdrnum (file->elf, &phnum) != 0)) in open_elf()
132 for (size_t i = 0; i < phnum; ++i) in open_elf()
334 uint_fast16_t phnum; in find_prelink_address_sync() local
341 phnum = ehdr.e32.e_phnum; in find_prelink_address_sync()
349 phnum = ehdr.e64.e_phnum; in find_prelink_address_sync()
357 + phnum * phentsize in find_prelink_address_sync()
391 src.d_size = phnum * phentsize; in find_prelink_address_sync()
397 if (unlikely (phnum > SIZE_MAX / phdr_size)) in find_prelink_address_sync()
399 const size_t phdrs_bytes = phnum * phdr_size; in find_prelink_address_sync()
[all …]
Dcore-file.c126 dwfl_report_core_segments (Dwfl *dwfl, Elf *elf, size_t phnum, GElf_Phdr *notes) in dwfl_report_core_segments() argument
136 for (size_t ndx = 0; result >= 0 && ndx < phnum; ++ndx) in dwfl_report_core_segments()
429 size_t phnum; in __libdwfl_dynamic_vaddr_get() local
430 if (unlikely (elf_getphdrnum (elf, &phnum) != 0)) in __libdwfl_dynamic_vaddr_get()
432 for (size_t i = 0; i < phnum; ++i) in __libdwfl_dynamic_vaddr_get()
451 size_t phnum; in dwfl_core_file_report() local
452 if (unlikely (elf_getphdrnum (elf, &phnum) != 0)) in dwfl_core_file_report()
494 int ndx = dwfl_report_core_segments (dwfl, elf, phnum, &notes_phdr); in dwfl_core_file_report()
582 while (ndx < (int) phnum); in dwfl_core_file_report()
Ddwfl_segment_report_module.c356 uint_fast16_t phnum; in dwfl_segment_report_module() local
397 phnum = ehdr.e32.e_phnum; in dwfl_segment_report_module()
415 phnum = ehdr.e64.e_phnum; in dwfl_segment_report_module()
431 if (phnum == 0) in dwfl_segment_report_module()
435 xlatefrom.d_size = phnum * phentsize; in dwfl_segment_report_module()
449 phnum = ph_buffer_size / phentsize; in dwfl_segment_report_module()
450 if (phnum == 0) in dwfl_segment_report_module()
459 if (unlikely (phnum > SIZE_MAX / phdr_size)) in dwfl_segment_report_module()
461 const size_t phdrsp_bytes = phnum * phdr_size; in dwfl_segment_report_module()
512 for (uint_fast16_t i = 0; i < phnum; ++i) in dwfl_segment_report_module()
[all …]
Dlinux-core-attach.c61 static size_t phnum; in core_memory_read() local
62 if (elf_getphdrnum (core, &phnum) < 0) in core_memory_read()
67 for (size_t cnt = 0; cnt < phnum; ++cnt) in core_memory_read()
346 size_t phnum; in dwfl_core_file_attach() local
347 if (elf_getphdrnum (core, &phnum) < 0) in dwfl_core_file_attach()
354 for (size_t cnt = 0; cnt < phnum; ++cnt) in dwfl_core_file_attach()
Ddwfl_report_elf.c178 size_t phnum; in __libdwfl_elf_address_range() local
179 if (unlikely (elf_getphdrnum (elf, &phnum) != 0)) in __libdwfl_elf_address_range()
181 for (size_t i = 0; i < phnum; ++i) in __libdwfl_elf_address_range()
204 for (size_t i = phnum; i-- > 0;) in __libdwfl_elf_address_range()
/third_party/elfutils/libelf/
Dgelf_getphdr.c79 size_t phnum; in gelf_getphdr() local
80 if (__elf_getphdrnum_chk_rdlock (elf, &phnum) != 0 in gelf_getphdr()
81 || (size_t) ndx >= phnum) in gelf_getphdr()
119 size_t phnum; in gelf_getphdr() local
120 if (__elf_getphdrnum_chk_rdlock (elf, &phnum) != 0 in gelf_getphdr()
121 || (size_t) ndx >= phnum) in gelf_getphdr()
Dgelf_update_phdr.c83 size_t phnum; in gelf_update_phdr() local
86 || __elf_getphdrnum_rdlock (elf, &phnum) != 0 in gelf_update_phdr()
87 || (size_t) ndx >= phnum)) in gelf_update_phdr()
120 size_t phnum; in gelf_update_phdr() local
123 || __elf_getphdrnum_rdlock (elf, &phnum) != 0 in gelf_update_phdr()
124 || (size_t) ndx >= phnum)) in gelf_update_phdr()
Delf32_getphdr.c73 size_t phnum; in ElfW2() local
74 if (__elf_getphdrnum_rdlock (elf, &phnum) != 0) in ElfW2()
76 if (phnum == 0 || ehdr->e_phoff == 0) in ElfW2()
83 size_t size = phnum * sizeof (ElfW2(LIBELFBITS,Phdr)); in ElfW2()
85 if (phnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr)) in ElfW2()
158 for (size_t cnt = 0; cnt < phnum; ++cnt) in ElfW2()
208 for (size_t cnt = 0; cnt < phnum; ++cnt) in ElfW2()
Dgelf_newphdr.c41 gelf_newphdr ( Elf *elf, size_t phnum) in gelf_newphdr() argument
44 ? (void *) INTUSE(elf32_newphdr) (elf, phnum) in gelf_newphdr()
45 : (void *) INTUSE(elf64_newphdr) (elf, phnum)); in gelf_newphdr()
Delf32_updatefile.c161 size_t phnum; in __elfw2() local
162 if (unlikely (__elf_getphdrnum_rdlock (elf, &phnum) != 0)) in __elfw2()
190 sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum, 1); in __elfw2()
195 sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum); in __elfw2()
209 + elf_typesize (LIBELFBITS, ELF_T_PHDR, phnum)); in __elfw2()
586 size_t phnum; in __elfw2() local
587 if (unlikely (__elf_getphdrnum_rdlock (elf, &phnum) != 0)) in __elfw2()
614 malloc (sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum); in __elfw2()
623 sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum, 1); in __elfw2()
630 size_t phdr_size = sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum; in __elfw2()
[all …]
Delf32_updatenull.c149 size_t phnum; in __elfw2() local
150 if (unlikely (__elf_getphdrnum_rdlock (elf, &phnum) != 0)) in __elfw2()
159 + elf_typesize (LIBELFBITS, ELF_T_PHDR, phnum)); in __elfw2()
168 size += elf_typesize (LIBELFBITS, ELF_T_PHDR, phnum); in __elfw2()
/third_party/elfutils/tests/
Delfshphehdr.c79 size_t phnum; in test() local
80 check_elf ("elf_getphdrnum", elf_getphdrnum (elf, &phnum) == 0); in test()
81 check ("phnum == 0", phnum == 0); in test()
105 check_elf ("elf_getphdrnum", elf_getphdrnum (elf, &phnum) == 0); in test()
106 check ("phnum == 0", phnum == 0); in test()
129 check_elf ("elf_getphdrnum", elf_getphdrnum (elf, &phnum) == 0); in test()
130 check ("phnum == 1", phnum == 1); in test()
Delfcopy.c154 size_t phnum; in copy_elf() local
155 if (elf_getphdrnum (elfa, &phnum) != 0) in copy_elf()
161 if (phnum > 0) in copy_elf()
163 if (gelf_newphdr (elfb, phnum) == 0) in copy_elf()
169 for (size_t cnt = 0; cnt < phnum; ++cnt) in copy_elf()
229 && (phnum == 0 in copy_elf()
304 if (phnum > 0 || reverse_offs) in copy_elf()
Dgetphdrnum.c15 size_t phnum; in main() local
36 if (elf_getphdrnum (elf, &phnum)) in main()
42 printf("%zu\n", phnum); in main()
Delfrdwrnop.c71 size_t phnum; in main() local
72 if (elf_getphdrnum (elf, &phnum) != 0) in main()
78 if (phnum > 0) in main()
Dvendorelf.c143 size_t phnum; in check_elf() local
144 if (elf_getphdrnum (elf, &phnum) != 0) in check_elf()
150 if (phnum != 1) in check_elf()
152 printf ("Expected just 1 phdr, got: %zd\n", phnum); in check_elf()
Delfstrmerge.c277 size_t phnum; in main() local
278 if (elf_getphdrnum (elf, &phnum) != 0) in main()
283 bool layout = phnum != 0; in main()
305 + gelf_fsize (elf, ELF_T_PHDR, phnum, EV_CURRENT)); in main()
433 if (phnum != 0) in main()
435 if (gelf_newphdr (elfnew, phnum) == 0) in main()
438 for (size_t cnt = 0; cnt < phnum; ++cnt) in main()
/third_party/rust/crates/rustix/src/backend/linux_raw/param/
Dauxv.rs89 let mut phnum = PHNUM.load(Relaxed); in exe_phdrs() localVariable
91 if phdr.is_null() || phnum == 0 { in exe_phdrs()
94 phnum = PHNUM.load(Relaxed); in exe_phdrs()
97 (phdr.cast(), phnum) in exe_phdrs()
103 let (phdr, phnum) = exe_phdrs(); in exe_phdrs_slice()
107 unsafe { slice::from_raw_parts(phdr.cast(), phnum) } in exe_phdrs_slice()
198 let mut phnum = 0; in init_from_auxp() localVariable
212 AT_PHNUM => phnum = a_val as usize, in init_from_auxp()
232 PHNUM.store(phnum, Relaxed); in init_from_auxp()
Dlibc_auxv.rs62 let (phdr, phnum) = exe_phdrs(); in exe_phdrs_slice()
66 unsafe { slice::from_raw_parts(phdr.cast(), phnum) } in exe_phdrs_slice()
/third_party/musl/ldso/
Ddlstart.c58 size_t phnum = eh->e_phnum; in _dlstart_c() local
60 while (phnum-- && ph->p_type != PT_DYNAMIC) in _dlstart_c()
106 size_t phnum = aux[AT_PHNUM]; in _dlstart_c() local
109 for (i=phnum; i--; ph = (void *)((char *)ph + phentsize)) { in _dlstart_c()
/third_party/elfutils/backends/
Dppc_symbol.c100 size_t phnum; in find_dyn_got() local
101 if (elf_getphdrnum (elf, &phnum) != 0) in find_dyn_got()
104 for (size_t i = 0; i < phnum; ++i) in find_dyn_got()
/third_party/elfutils/libdwelf/
Ddwelf_elf_gnu_build_id.c76 size_t phnum; in find_elf_build_id() local
77 if (unlikely (elf_getphdrnum (elf, &phnum) != 0)) in find_elf_build_id()
83 for (size_t i = 0; result == 0 && i < phnum; ++i) in find_elf_build_id()
/third_party/toybox/toys/posix/
Dfile.c37 phentsize, phnum, shsize, shnum; local
107 phnum = elf_int(toybuf+44+12*bits, 2);
115 if (phnum && (phentsize != 32+24*bits)) {
128 if (phoff+phnum*phentsize>TT.len) goto bad;
129 for (i = 0; i<phnum; i++) {

12