Lines Matching refs:elf
42 #include "elf-knowledge.h"
123 __libelf_data_type (Elf *elf, int sh_type)
125 /* Some broken ELF ABI for 64-bit machines use the wrong hash table
126 entry size. See elf-knowledge.h for more information. */
127 if (sh_type == SHT_HASH && elf->class == ELFCLASS64)
130 GElf_Ehdr *ehdr = __gelf_getehdr_rdlock (elf, &ehdr_mem);
226 Elf *elf = scn->elf;
228 if (elf->class == ELFCLASS32)
272 GElf_Ehdr *ehdr = __gelf_getehdr_rdlock (elf, &ehdr_mem);
279 || (t == ELF_T_GNUHASH && elf->class == ELFCLASS64))
282 entsize = __libelf_type_sizes[LIBELF_EV_IDX][elf->class - 1][t];
297 if (elf->map_address != NULL)
302 if (unlikely (offset > elf->maximum_size
303 || elf->maximum_size - offset < size))
311 = (char *) elf->map_address + elf->start_offset + offset;
313 else if (likely (elf->fildes != -1))
325 ssize_t n = pread_retry (elf->fildes, scn->rawdata.d.d_buf, size,
326 elf->start_offset + offset);
352 scn->rawdata.d.d_type = __libelf_data_type (elf, type);
357 Unfortunately we cannot be too strict because there are ELF files
369 if (elf->class == ELFCLASS32
370 || (offsetof (struct Elf, state.elf32.ehdr)
371 == offsetof (struct Elf, state.elf64.ehdr)))
373 elf->state.elf32.ehdr->e_ident[EI_VERSION];
376 elf->state.elf64.ehdr->e_ident[EI_VERSION];
397 rwlock_wrlock (scn->elf->lock);
399 rwlock_unlock (scn->elf->lock);
410 Elf *elf = scn->elf;
416 rwlock_unlock (elf->lock);
417 rwlock_wrlock (elf->lock);
423 convert_data (scn, __libelf_version, elf->class,
424 (elf->class == ELFCLASS32
425 || (offsetof (struct Elf, state.elf32.ehdr)
426 == offsetof (struct Elf, state.elf64.ehdr))
427 ? elf->state.elf32.ehdr->e_ident[EI_DATA]
428 : elf->state.elf64.ehdr->e_ident[EI_DATA]),
447 Elf *elf;
453 if (unlikely (scn->elf->kind != ELF_K_ELF))
460 elf = scn->elf;
514 rwlock_unlock (elf->lock);
515 rwlock_wrlock (elf->lock);
547 rwlock_rdlock (scn->elf->lock);
549 rwlock_unlock (scn->elf->lock);