Lines Matching refs:elf

42 __elf_getphdrnum_rdlock (Elf *elf, size_t *dst)  in __elf_getphdrnum_rdlock()  argument
44 if (unlikely (elf->state.elf64.ehdr == NULL)) in __elf_getphdrnum_rdlock()
51 *dst = (elf->class == ELFCLASS32 in __elf_getphdrnum_rdlock()
52 ? elf->state.elf32.ehdr->e_phnum in __elf_getphdrnum_rdlock()
53 : elf->state.elf64.ehdr->e_phnum); in __elf_getphdrnum_rdlock()
57 const Elf_ScnList *const scns = (elf->class == ELFCLASS32 in __elf_getphdrnum_rdlock()
58 ? &elf->state.elf32.scns in __elf_getphdrnum_rdlock()
59 : &elf->state.elf64.scns); in __elf_getphdrnum_rdlock()
64 if (elf->class == ELFCLASS32) in __elf_getphdrnum_rdlock()
67 && elf->state.elf32.scns.data[0].shdr.e32 != NULL)) in __elf_getphdrnum_rdlock()
73 && elf->state.elf64.scns.data[0].shdr.e64 != NULL)) in __elf_getphdrnum_rdlock()
83 __elf_getphdrnum_chk_rdlock (Elf *elf, size_t *dst) in __elf_getphdrnum_chk_rdlock() argument
85 int result = __elf_getphdrnum_rdlock (elf, dst); in __elf_getphdrnum_chk_rdlock()
88 Elf64_Off off = (elf->class == ELFCLASS32 in __elf_getphdrnum_chk_rdlock()
89 ? elf->state.elf32.ehdr->e_phoff in __elf_getphdrnum_chk_rdlock()
90 : elf->state.elf64.ehdr->e_phoff); in __elf_getphdrnum_chk_rdlock()
97 if (unlikely (off >= elf->maximum_size)) in __elf_getphdrnum_chk_rdlock()
104 size_t phdr_size = (elf->class == ELFCLASS32 in __elf_getphdrnum_chk_rdlock()
113 if (unlikely (elf->maximum_size - off < *dst * phdr_size)) in __elf_getphdrnum_chk_rdlock()
114 *dst = (elf->maximum_size - off) / phdr_size; in __elf_getphdrnum_chk_rdlock()
120 elf_getphdrnum (Elf *elf, size_t *dst) in elf_getphdrnum() argument
124 if (elf == NULL) in elf_getphdrnum()
127 if (unlikely (elf->kind != ELF_K_ELF)) in elf_getphdrnum()
133 rwlock_rdlock (elf->lock); in elf_getphdrnum()
134 result = __elf_getphdrnum_chk_rdlock (elf, dst); in elf_getphdrnum()
135 rwlock_unlock (elf->lock); in elf_getphdrnum()