Lines Matching full:elf
46 elf_getshdrstrndx (elf, dst) in elf_getshdrstrndx() argument
47 Elf *elf; in elf_getshdrstrndx()
52 if (elf == NULL)
55 if (unlikely (elf->kind != ELF_K_ELF))
61 rwlock_rdlock (elf->lock);
63 /* We rely here on the fact that the `elf' element is a common prefix
65 assert (offsetof (struct Elf, state.elf.ehdr)
66 == offsetof (struct Elf, state.elf32.ehdr));
67 assert (sizeof (elf->state.elf.ehdr)
68 == sizeof (elf->state.elf32.ehdr));
69 assert (offsetof (struct Elf, state.elf.ehdr)
70 == offsetof (struct Elf, state.elf64.ehdr));
71 assert (sizeof (elf->state.elf.ehdr)
72 == sizeof (elf->state.elf64.ehdr));
74 if (unlikely (elf->state.elf.ehdr == NULL))
83 num = (elf->class == ELFCLASS32
84 ? elf->state.elf32.ehdr->e_shstrndx
85 : elf->state.elf64.ehdr->e_shstrndx);
87 /* Determine whether the index is too big to fit in the ELF
92 if (elf->class == ELFCLASS32)
95 if (unlikely (elf->state.elf32.scns.cnt == 0))
103 if (elf->state.elf32.scns.data[0].shdr.e32 != NULL)
105 num = elf->state.elf32.scns.data[0].shdr.e32->sh_link;
109 offset = elf->state.elf32.ehdr->e_shoff;
111 if (elf->map_address != NULL
112 && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
114 || (((size_t) ((char *) elf->map_address
115 + elf->start_offset + offset))
118 /* First see whether the information in the ELF header is
120 if (unlikely (elf->maximum_size - offset
130 num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset
139 if (unlikely (pread_retry (elf->fildes, &shdr_mem,
143 /* We must be able to read this ELF section header. */
149 if (elf->state.elf32.ehdr->e_ident[EI_DATA] != MY_ELFDATA)
156 if (unlikely (elf->state.elf64.scns.cnt == 0))
164 if (elf->state.elf64.scns.data[0].shdr.e64 != NULL)
166 num = elf->state.elf64.scns.data[0].shdr.e64->sh_link;
170 size_t offset = elf->state.elf64.ehdr->e_shoff;
172 if (elf->map_address != NULL
173 && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
175 || (((size_t) ((char *) elf->map_address
176 + elf->start_offset + offset))
179 /* First see whether the information in the ELF header is
181 if (unlikely (elf->maximum_size - offset
191 num = ((Elf64_Shdr *) (elf->map_address + elf->start_offset
200 if (unlikely (pread_retry (elf->fildes, &shdr_mem,
204 /* We must be able to read this ELF section header. */
210 if (elf->state.elf64.ehdr->e_ident[EI_DATA] != MY_ELFDATA)
223 rwlock_unlock (elf->lock);