| /src/stand/common/ |
| H A D | load_elf_obj.c | 221 Elf_Shdr *shdr, *cshdr, *lshdr; in obj_loadimage() local 232 shdr = alloc_pread(VECTX_HANDLE(ef), (off_t)hdr->e_shoff, shdrbytes); in obj_loadimage() 233 if (shdr == NULL) { in obj_loadimage() 238 ef->e_shdr = shdr; in obj_loadimage() 246 shdr[i].sh_addr = 0; in obj_loadimage() 248 if (shdr[i].sh_size == 0) in obj_loadimage() 250 switch (shdr[i].sh_type) { in obj_loadimage() 258 if ((shdr[i].sh_flags & SHF_ALLOC) == 0) in obj_loadimage() 260 lastaddr = roundup(lastaddr, shdr[i].sh_addralign); in obj_loadimage() 261 shdr[i].sh_addr = (Elf_Addr)lastaddr; in obj_loadimage() [all …]
|
| H A D | load_elf.c | 176 static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr) in elf_section_header_convert() argument 190 CONVERT_SWITCH(ehdr, shdr, SECTION_HEADER_FIELDS); in elf_section_header_convert() 209 static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr) in elf_section_header_convert() argument 530 Elf_Shdr *shdr; local 550 shdr = NULL; 704 shdr = alloc_pread(VECTX_HANDLE(ef), ehdr->e_shoff, chunk); 705 if (shdr == NULL) { 712 elf_section_header_convert(ehdr, &shdr[i]); 714 file_addmetadata(fp, MODINFOMD_SHDR, chunk, shdr); 721 chunk = shdr[ehdr->e_shstrndx].sh_size; [all …]
|
| /src/cddl/contrib/opensolaris/tools/ctf/cvt/ |
| H A D | output.c | 340 GElf_Shdr shdr; in sort_iidescs() local 354 gelf_getshdr(scn, &shdr); in sort_iidescs() 355 nent = shdr.sh_size / shdr.sh_entsize; in sort_iidescs() 357 scn = elf_getscn(elf, shdr.sh_link); in sort_iidescs() 461 GElf_Shdr shdr; in write_file() local 540 gelf_getshdr(sscn, &shdr); in write_file() 557 pad = new_offset % shdr.sh_addralign; in write_file() 560 new_offset += shdr.sh_addralign - pad; in write_file() 561 shdr.sh_offset = new_offset; in write_file() 564 shdr.sh_link = secxlate[shdr.sh_link]; in write_file() [all …]
|
| H A D | util.c | 69 GElf_Shdr shdr; in findelfsecidx() local 77 if (gelf_getshdr(scn, &shdr) == NULL) { in findelfsecidx() 84 (size_t)shdr.sh_name)) == NULL) { in findelfsecidx()
|
| /src/sys/kern/ |
| H A D | link_elf_obj.c | 348 Elf_Shdr *shdr; in link_elf_link_preload() local 367 shdr = (Elf_Shdr *)preload_search_info(modptr, MODINFO_METADATA | in link_elf_link_preload() 372 shdr == NULL) in link_elf_link_preload() 394 ef->e_shdr = shdr; in link_elf_link_preload() 400 switch (shdr[i].sh_type) { in link_elf_link_preload() 409 if (shdr[i].sh_addr == 0) in link_elf_link_preload() 415 symstrindex = shdr[i].sh_link; in link_elf_link_preload() 422 if (shdr[shdr[i].sh_info].sh_addr == 0) in link_elf_link_preload() 427 if (shdr[shdr[i].sh_info].sh_addr == 0) in link_elf_link_preload() 437 shdr[symstrindex].sh_type != SHT_STRTAB || shstrindex == 0 || in link_elf_link_preload() [all …]
|
| H A D | kern_ctf.c | 48 Elf_Shdr *shdr = NULL; in link_elf_ctf_get() local 133 shdr = malloc(nbytes, M_LINKER, M_WAITOK); in link_elf_ctf_get() 136 if ((error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)shdr, nbytes, in link_elf_ctf_get() 146 if (hdr->e_shstrndx == 0 || shdr[hdr->e_shstrndx].sh_type != SHT_STRTAB) { in link_elf_ctf_get() 151 shdr[hdr->e_shstrndx].sh_type); in link_elf_ctf_get() 158 shstrtab = malloc(shdr[hdr->e_shstrndx].sh_size, M_LINKER, M_WAITOK); in link_elf_ctf_get() 162 shdr[hdr->e_shstrndx].sh_size, shdr[hdr->e_shstrndx].sh_offset, in link_elf_ctf_get() 168 if (strcmp(".SUNW_ctf", shstrtab + shdr[i].sh_name) == 0) in link_elf_ctf_get() 183 shdr[i].sh_offset, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, in link_elf_ctf_get() 223 raw = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); in link_elf_ctf_get() [all …]
|
| H A D | link_elf.c | 859 link_elf_locate_exidx(linker_file_t lf, Elf_Shdr *shdr, int nhdr) in link_elf_locate_exidx() argument 864 if (shdr[i].sh_type == SHT_ARM_EXIDX) { in link_elf_locate_exidx() 865 lf->exidx_addr = shdr[i].sh_addr + lf->address; in link_elf_locate_exidx() 866 lf->exidx_size = shdr[i].sh_size; in link_elf_locate_exidx() 882 Elf_Shdr *shdr; in link_elf_locate_exidx_preload() local 888 shdr = (Elf_Shdr *)modinfo; in link_elf_locate_exidx_preload() 890 link_elf_locate_exidx(lf, shdr, nhdr); in link_elf_locate_exidx_preload() 1011 Elf_Shdr *shdr; in link_elf_load_file() local 1019 shdr = NULL; in link_elf_load_file() 1282 shdr = malloc(nbytes, M_LINKER, M_WAITOK | M_ZERO); in link_elf_load_file() [all …]
|
| /src/lib/libc/gen/ |
| H A D | nlist.c | 133 Elf_Shdr *shdr = NULL; in __elf_fdnlist() local 159 shdr = (Elf_Shdr *)base; in __elf_fdnlist() 168 if (shdr[i].sh_type == SHT_SYMTAB) { in __elf_fdnlist() 169 symoff = shdr[i].sh_offset; in __elf_fdnlist() 170 symsize = shdr[i].sh_size; in __elf_fdnlist() 171 symstroff = shdr[shdr[i].sh_link].sh_offset; in __elf_fdnlist() 172 symstrsize = shdr[shdr[i].sh_link].sh_size; in __elf_fdnlist() 238 elf_sym_to_nlist(p, s, shdr, in __elf_fdnlist() 250 if (shdr != NULL) in __elf_fdnlist() 251 munmap(shdr, shdr_size); in __elf_fdnlist() [all …]
|
| /src/usr.sbin/crunch/crunchide/ |
| H A D | exec_elf32.c | 91 Elf_Shdr *shdr; member 306 layoutp[shnum].shdr = &shdrshdr; in hide() 315 xewtoh(layoutp[m].shdr->sh_offset)) in hide() 326 layoutp[r].shdr = &shdrp[i]; in hide() 349 if (layoutp[i].shdr == &shdrshdr) { in hide() 354 if (layoutp[i].shdr == shstrtabshdr) { in hide() 360 if (layoutp[i].shdr == strtabshdr) in hide() 362 if (layoutp[i].shdr == symtabshdr || i >= strtabidx) { in hide() 363 off = xewtoh(layoutp[i].shdr->sh_offset); in hide() 364 if ((size = xewtoh(layoutp[i].shdr->sh_size)) == 0) in hide() [all …]
|
| /src/lib/libkldelf/ |
| H A D | elf.c | 313 GElf_Shdr *shdr; in elf_read_shdrs() local 321 shdr = calloc(nshdr, sizeof(*shdr)); in elf_read_shdrs() 322 if (shdr == NULL) in elf_read_shdrs() 331 if (gelf_getshdr(scn, &shdr[i]) == NULL) { in elf_read_shdrs() 338 *shdrp = shdr; in elf_read_shdrs() 341 free(shdr); in elf_read_shdrs() 349 GElf_Shdr shdr; in elf_read_dynamic() local 358 if (gelf_getshdr(scn, &shdr) == NULL) in elf_read_dynamic() 364 ndyn = elf_object_count(efile, ELF_T_DYN, shdr.sh_size); in elf_read_dynamic() 385 GElf_Shdr shdr; in elf_read_symbols() local [all …]
|
| H A D | ef_obj.c | 273 GElf_Shdr *shdr; in ef_obj_open() local 296 error = elf_read_shdrs(efile, &nshdr, &shdr); in ef_obj_open() 298 shdr = NULL; in ef_obj_open() 307 switch (shdr[i].sh_type) { in ef_obj_open() 315 symstrindex = shdr[i].sh_link; in ef_obj_open() 337 shdr[symstrindex].sh_type != SHT_STRTAB) { in ef_obj_open() 363 if (elf_read_string_table(efile, &shdr[symstrindex], &ef->ddbstrcnt, in ef_obj_open() 371 shdr[hdr->e_shstrndx].sh_type == SHT_STRTAB) { in ef_obj_open() 372 if (elf_read_string_table(efile, &shdr[hdr->e_shstrndx], in ef_obj_open() 388 switch (shdr[i].sh_type) { in ef_obj_open() [all …]
|
| H A D | ef.c | 227 GElf_Shdr *shdr; in ef_parse_dynamic() local 246 error = elf_read_shdrs(ef->ef_efile, &nshdr, &shdr); in ef_parse_dynamic() 254 if (shdr[i].sh_type == SHT_DYNAMIC) { in ef_parse_dynamic() 261 if (shdr[i].sh_offset != phdyn->p_offset || in ef_parse_dynamic() 264 shdr[i].sh_size > phdyn->p_filesz : in ef_parse_dynamic() 265 shdr[i].sh_size != phdyn->p_filesz)) { in ef_parse_dynamic() 374 switch (shdr[i].sh_type) { in ef_parse_dynamic() 376 if (shdr[i].sh_offset != hash_off) { in ef_parse_dynamic() 386 if (shdr[i].sh_size < sizeof(*ef->ef_hashtab) * 2) { in ef_parse_dynamic() 392 shdr[i].sh_offset, shdr[i].sh_size, in ef_parse_dynamic() [all …]
|
| /src/contrib/elftoolchain/size/ |
| H A D | size.c | 618 GElf_Shdr shdr; in handle_elf() local 655 if (gelf_getshdr(scn, &shdr) != NULL) in handle_elf() 656 berkeley_calc(&shdr); in handle_elf() 662 if (gelf_getshdr(scn, &shdr) != NULL) in handle_elf() 663 sysv_calc(elf, &elfhdr, &shdr); in handle_elf() 705 sysv_calc(Elf *elf, GElf_Ehdr *elfhdr, GElf_Shdr *shdr) in sysv_calc() argument 710 (size_t) shdr->sh_name); in sysv_calc() 711 if ((shdr->sh_type == SHT_SYMTAB || in sysv_calc() 712 shdr->sh_type == SHT_STRTAB || shdr->sh_type == SHT_RELA || in sysv_calc() 713 shdr->sh_type == SHT_REL) && shdr->sh_addr == 0) in sysv_calc() [all …]
|
| /src/sys/compat/linux/ |
| H A D | linux_vdso.c | 104 const Elf_Shdr *shdr; in linux_vdso_fixup() local 120 shdr = (const Elf_Shdr *)(base + ehdr->e_shoff); in linux_vdso_fixup() 124 if (shdr[i].sh_size == 0) in linux_vdso_fixup() 126 if (shdr[i].sh_type == SHT_DYNSYM) { in linux_vdso_fixup() 127 dsym = (Elf_Sym *)(base + shdr[i].sh_offset); in linux_vdso_fixup() 128 strtab = base + shdr[shdr[i].sh_link].sh_offset; in linux_vdso_fixup() 129 symcnt = shdr[i].sh_size / sizeof(*dsym); in linux_vdso_fixup()
|
| /src/contrib/elftoolchain/libelf/ |
| H A D | libelf_checksum.c | 53 GElf_Shdr shdr; in _libelf_checksum() local 81 if (gelf_getshdr(scn, &shdr) == NULL) in _libelf_checksum() 83 if ((shdr.sh_flags & SHF_ALLOC) == 0 || in _libelf_checksum() 84 shdr.sh_type == SHT_DYNAMIC || in _libelf_checksum() 85 shdr.sh_type == SHT_DYNSYM) in _libelf_checksum()
|
| H A D | elf_strptr.c | 45 GElf_Shdr shdr; in elf_strptr() local 54 gelf_getshdr(s, &shdr) == NULL) in elf_strptr() 57 if (shdr.sh_type != SHT_STRTAB || in elf_strptr() 58 offset >= shdr.sh_size) { in elf_strptr()
|
| /src/crypto/openssl/ssl/quic/ |
| H A D | quic_txp.c | 2095 OSSL_QUIC_FRAME_STREAM *shdr, in determine_stream_len() argument 2103 if (shdr->len > SIZE_MAX) in determine_stream_len() 2106 orig_len = (size_t)shdr->len; in determine_stream_len() 2108 shdr->len = 0; in determine_stream_len() 2109 base_hdr_len = ossl_quic_wire_get_encoded_frame_len_stream_hdr(shdr); in determine_stream_len() 2110 shdr->len = orig_len; in determine_stream_len() 2114 if (shdr->has_explicit_len) in determine_stream_len() 2129 OSSL_QUIC_FRAME_STREAM shdr = { 0 }; in txp_generate_crypto_frames() local 2146 i, &shdr, iov, in txp_generate_crypto_frames() 2151 chdr.offset = shdr.offset; in txp_generate_crypto_frames() [all …]
|
| /src/sys/x86/xen/ |
| H A D | pv.c | 220 Elf_Shdr *shdr; in xen_pvh_parse_symtab() local 232 shdr = (Elf_Shdr *)((uint8_t *)ehdr + ehdr->e_shoff); in xen_pvh_parse_symtab() 235 if (shdr[i].sh_type != SHT_SYMTAB) in xen_pvh_parse_symtab() 237 if (shdr[i].sh_offset == 0) in xen_pvh_parse_symtab() 239 ksymtab = (uintptr_t)((uint8_t *)ehdr + shdr[i].sh_offset); in xen_pvh_parse_symtab() 240 ksymtab_size = shdr[i].sh_size; in xen_pvh_parse_symtab() 241 j = shdr[i].sh_link; in xen_pvh_parse_symtab() 242 if (shdr[j].sh_offset == 0) in xen_pvh_parse_symtab() 244 kstrtab = (uintptr_t)((uint8_t *)ehdr + shdr[j].sh_offset); in xen_pvh_parse_symtab()
|
| /src/contrib/libexecinfo/ |
| H A D | symtab.c | 117 GElf_Shdr shdr; in symtab_create() local 122 gelf_getshdr(scn, &shdr); in symtab_create() 123 if(shdr.sh_type != SHT_SYMTAB) in symtab_create() 127 ns = shdr.sh_size / shdr.sh_entsize; in symtab_create() 141 elf_strptr(elf, shdr.sh_link, sym.st_name), in symtab_create() 157 elf_strptr(elf, shdr.sh_link, sym.st_name)); in symtab_create()
|
| /src/sys/powerpc/powerpc/ |
| H A D | machdep.c | 533 Elf_Shdr *shdr; in load_external_symtab() local 588 shdr = (Elf_Shdr *)(kernelimg + ehdr->e_shoff); in load_external_symtab() 597 if (shdr[i].sh_type == SHT_SYMTAB) { in load_external_symtab() 599 shdr[i].sh_offset); in load_external_symtab() 601 (kernelimg_final + shdr[i].sh_offset); in load_external_symtab() 602 ksym_sz = (vm_offset_t)(shdr[i].sh_size); in load_external_symtab() 604 shdr[shdr[i].sh_link].sh_offset); in load_external_symtab() 607 shdr[shdr[i].sh_link].sh_offset); in load_external_symtab() 610 (shdr[shdr[i].sh_link].sh_size); in load_external_symtab()
|
| /src/cddl/contrib/opensolaris/cmd/lockstat/ |
| H A D | sym.c | 197 GElf_Shdr shdr; in symtab_init() local 198 (void) gelf_getshdr(scn, &shdr); in symtab_init() 199 if (shdr.sh_type == SHT_SYMTAB) { in symtab_init() 201 nsyms = shdr.sh_size / shdr.sh_entsize; in symtab_init() 202 strindex = shdr.sh_link; in symtab_init()
|
| /src/contrib/elftoolchain/strings/ |
| H A D | strings.c | 265 GElf_Shdr shdr; in handle_elf() local 298 if (gelf_getshdr(scn, &shdr) == NULL) in handle_elf() 300 if (shdr.sh_type != SHT_NOBITS && in handle_elf() 301 (shdr.sh_flags & SHF_ALLOC) != 0) { in handle_elf() 302 rc = find_strings(name, pfile, shdr.sh_offset, in handle_elf() 303 shdr.sh_size); in handle_elf()
|
| /src/lib/libproc/ |
| H A D | proc_sym.c | 158 GElf_Shdr shdr; in load_symtab() local 168 (void)gelf_getshdr(scn, &shdr); in load_symtab() 169 if (shdr.sh_type == sh_type) in load_symtab() 175 nsyms = shdr.sh_size / shdr.sh_entsize; in load_symtab() 188 symtab->stridx = shdr.sh_link; in load_symtab() 239 GElf_Shdr shdr; in open_object() local 272 if (gelf_getshdr(scn, &shdr) != &shdr) { in open_object() 277 if (shdr.sh_type != SHT_PROGBITS) in open_object() 284 if ((scnname = elf_strptr(e, ndx, shdr.sh_name)) == NULL) in open_object()
|
| /src/contrib/elftoolchain/elfcopy/ |
| H A D | archive.c | 250 GElf_Shdr shdr; in extract_arsym() local 269 if (gelf_getshdr(scn, &shdr) != &shdr) { in extract_arsym() 273 if ((name = elf_strptr(ecp->eout, shstrndx, shdr.sh_name)) == in extract_arsym() 293 if (gelf_getshdr(scn, &shdr) != &shdr) { in extract_arsym() 297 if (shdr.sh_type != SHT_SYMTAB) in extract_arsym() 302 while (n < shdr.sh_size && in extract_arsym() 304 len = data->d_size / shdr.sh_entsize; in extract_arsym()
|
| /src/sys/dev/ipw/ |
| H A D | if_ipw.c | 491 struct ipw_soft_hdr *shdr; in ipw_dma_alloc() local 620 shdr = &sc->shdr_list[i]; in ipw_dma_alloc() 621 error = bus_dmamap_create(sc->hdr_dmat, 0, &shdr->map); in ipw_dma_alloc() 627 SLIST_INSERT_HEAD(&sc->free_shdr, shdr, next); in ipw_dma_alloc() 1304 struct ipw_soft_hdr *shdr; in ipw_release_sbd() local 1315 shdr = sbd->priv; in ipw_release_sbd() 1316 bus_dmamap_sync(sc->hdr_dmat, shdr->map, BUS_DMASYNC_POSTWRITE); in ipw_release_sbd() 1317 bus_dmamap_unload(sc->hdr_dmat, shdr->map); in ipw_release_sbd() 1318 SLIST_INSERT_HEAD(&sc->free_shdr, shdr, next); in ipw_release_sbd() 1552 struct ipw_soft_hdr *shdr; in ipw_tx_start() local [all …]
|