Lines Matching refs:elf
44 set_address (Elf *elf, size_t offset) in set_address() argument
46 if (elf->kind == ELF_K_AR) in set_address()
48 Elf *child = elf->state.ar.children; in set_address()
54 child->map_address = elf->map_address; in set_address()
70 __libelf_readall (Elf *elf) in __libelf_readall() argument
73 rwlock_wrlock (elf->lock); in __libelf_readall()
75 if (elf->map_address == NULL && unlikely (elf->fildes == -1)) in __libelf_readall()
78 rwlock_unlock (elf->lock); in __libelf_readall()
83 if (elf->map_address == NULL) in __libelf_readall()
89 libelf_acquire_all (elf); in __libelf_readall()
91 if (elf->maximum_size == ~((size_t) 0)) in __libelf_readall()
96 if (fstat (elf->fildes, &st) < 0) in __libelf_readall()
101 elf->maximum_size = (size_t) st.st_size; in __libelf_readall()
110 mem = (char *) malloc (elf->maximum_size); in __libelf_readall()
114 if (unlikely ((size_t) pread_retry (elf->fildes, mem, in __libelf_readall()
115 elf->maximum_size, in __libelf_readall()
116 elf->start_offset) in __libelf_readall()
117 != elf->maximum_size)) in __libelf_readall()
127 elf->map_address = mem; in __libelf_readall()
130 elf->flags |= ELF_F_MALLOCED; in __libelf_readall()
134 set_address (elf, elf->start_offset); in __libelf_readall()
137 if (elf->kind == ELF_K_AR) in __libelf_readall()
138 elf->state.ar.offset -= elf->start_offset; in __libelf_readall()
139 elf->start_offset = 0; in __libelf_readall()
146 libelf_release_all (elf); in __libelf_readall()
149 rwlock_unlock (elf->lock); in __libelf_readall()
151 return (char *) elf->map_address; in __libelf_readall()