/freebsd/stand/common/ |
H A D | load_elf_obj.c | 241 if (shdr == NULL) { in __elfN() 246 ef->e_shdr = shdr; in __elfN() 322 if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) in __elfN() 473 Elf_Shdr *shdr; in __elfN() local 479 shdr = ef->e_shdr; in __elfN() 490 *stopp = shdr[i].sh_addr + shdr[i].sh_size; in __elfN() 511 Elf_Shdr *shdr; in __elfN() local 519 shdr = ef->e_shdr; in __elfN() 522 if (shdr[i].sh_type != SHT_RELA && shdr[i].sh_type != SHT_REL) in __elfN() 524 base = shdr[shdr[i].sh_info].sh_addr; in __elfN() [all …]
|
H A D | load_elf.c | 537 Elf_Shdr *shdr; local 557 shdr = NULL; 712 if (shdr == NULL) { 761 (shdr[i].sh_offset + shdr[i].sh_size <= 768 if (shdr[i].sh_offset == 0 || shdr[i].sh_size == 0) 802 (uintmax_t)shdr[i].sh_size, (uintmax_t)shdr[i].sh_offset, 935 if (shdr) 936 free(shdr); 1017 if (shdr == NULL) { 1096 if (shdr != NULL) [all …]
|
/freebsd/cddl/contrib/opensolaris/tools/ctf/cvt/ |
H A D | output.c | 340 GElf_Shdr shdr; in sort_iidescs() local 355 nent = shdr.sh_size / shdr.sh_entsize; in sort_iidescs() 461 GElf_Shdr shdr; in write_file() local 564 shdr.sh_link = secxlate[shdr.sh_link]; in write_file() 566 if (shdr.sh_type == SHT_REL || shdr.sh_type == SHT_RELA) in write_file() 567 shdr.sh_info = secxlate[shdr.sh_info]; in write_file() 572 shdr.sh_name); in write_file() 616 if (shdr.sh_type == symtab_type && shdr.sh_entsize != 0) { in write_file() 617 int nsym = shdr.sh_size / shdr.sh_entsize; in write_file() 669 shdr.sh_size = ctfsize; 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()
|
/freebsd/sys/kern/ |
H A D | link_elf_obj.c | 424 if (shdr[shdr[i].sh_info].sh_addr == 0) in link_elf_link_preload() 429 if (shdr[shdr[i].sh_info].sh_addr == 0) in link_elf_link_preload() 472 shdr[i].sh_addr = shdr[i].sh_addr - off + in link_elf_link_preload() 590 if (shdr[shdr[i].sh_info].sh_addr == 0) in link_elf_link_preload() 598 if (shdr[shdr[i].sh_info].sh_addr == 0) in link_elf_link_preload() 739 shdr = NULL; in link_elf_load_file() 862 if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) in link_elf_load_file() 867 if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) in link_elf_load_file() 1135 shdr[i].sh_size, shdr[i].sh_offset, in link_elf_load_file() 1177 shdr[i].sh_size, shdr[i].sh_offset, in link_elf_load_file() [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() 151 shdr[hdr->e_shstrndx].sh_type); in link_elf_ctf_get() 162 shdr[hdr->e_shstrndx].sh_size, shdr[hdr->e_shstrndx].sh_offset, in link_elf_ctf_get() 223 raw = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); in link_elf_ctf_get() 229 sz = shdr[i].sh_size; in link_elf_ctf_get() 243 shdr[i].sh_size, shdr[i].sh_offset, UIO_SYSSPACE, IO_NODELOCKED, in link_elf_ctf_get() 260 raw + sizeof(cth), shdr[i].sh_size - sizeof(cth)); in link_elf_ctf_get() 273 ef->ctfcnt = shdr[i].sh_size; in link_elf_ctf_get() 295 if (shdr != NULL) in link_elf_ctf_get() [all …]
|
H A D | link_elf.c | 849 lf->exidx_size = shdr[i].sh_size; in link_elf_locate_exidx() 865 Elf_Shdr *shdr; in link_elf_locate_exidx_preload() local 871 shdr = (Elf_Shdr *)modinfo; in link_elf_locate_exidx_preload() 996 Elf_Shdr *shdr; in link_elf_load_file() local 1004 shdr = NULL; in link_elf_load_file() 1279 nbytes = shdr[shstrindex].sh_size; in link_elf_load_file() 1293 symstrindex = shdr[i].sh_link; in link_elf_load_file() 1298 lf->ctors_size = shdr[i].sh_size; in link_elf_load_file() 1304 symcnt = shdr[symtabindex].sh_size; in link_elf_load_file() 1306 strcnt = shdr[symstrindex].sh_size; in link_elf_load_file() [all …]
|
/freebsd/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 …]
|
/freebsd/usr.sbin/crunch/crunchide/ |
H A D | exec_elf32.c | 91 Elf_Shdr *shdr; member 306 layoutp[shnum].shdr = &shdrshdr; in ELFNAMEEND() 315 xewtoh(layoutp[m].shdr->sh_offset)) in ELFNAMEEND() 326 layoutp[r].shdr = &shdrp[i]; in ELFNAMEEND() 349 if (layoutp[i].shdr == &shdrshdr) { in ELFNAMEEND() 354 if (layoutp[i].shdr == shstrtabshdr) { in ELFNAMEEND() 360 if (layoutp[i].shdr == strtabshdr) in ELFNAMEEND() 375 if (layoutp[i].shdr == symtabshdr) { in ELFNAMEEND() 448 if (layoutp[i].shdr == strtabshdr) { in ELFNAMEEND() 454 if (layoutp[i].shdr == &shdrshdr || in ELFNAMEEND() [all …]
|
/freebsd/usr.sbin/kldxref/ |
H A D | ef_obj.c | 268 GElf_Shdr *shdr; in ef_obj_open() local 293 shdr = NULL; in ef_obj_open() 302 switch (shdr[i].sh_type) { in ef_obj_open() 310 symstrindex = shdr[i].sh_link; in ef_obj_open() 383 switch (shdr[i].sh_type) { in ef_obj_open() 388 if (shdr[i].sh_type == SHT_PROGBITS) { in ef_obj_open() 399 ef->shstrtab + shdr[i].sh_name; in ef_obj_open() 408 mapbase += shdr[i].sh_size; in ef_obj_open() 412 ef->reltab[rl].sec = shdr[i].sh_info; in ef_obj_open() 421 ef->relatab[ra].sec = shdr[i].sh_info; in ef_obj_open() [all …]
|
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() 338 *shdrp = shdr; in elf_read_shdrs() 341 free(shdr); in elf_read_shdrs() 349 GElf_Shdr shdr; in elf_read_dynamic() local 385 GElf_Shdr shdr; in elf_read_symbols() local 425 error = elf_read_raw_data_alloc(efile, shdr->sh_offset, shdr->sh_size, in elf_read_string_table() 429 *strcnt = shdr->sh_size; in elf_read_string_table() 437 GElf_Shdr shdr; in elf_read_rel() local [all …]
|
H A D | ef.c | 223 GElf_Shdr *shdr; in ef_parse_dynamic() local 250 if (shdr[i].sh_type == SHT_DYNAMIC) { in ef_parse_dynamic() 375 switch (shdr[i].sh_type) { in ef_parse_dynamic() 393 shdr[i].sh_offset, shdr[i].sh_size, in ef_parse_dynamic() 412 if (shdr[i].sh_offset != sym_off) { in ef_parse_dynamic() 427 if (shdr[i].sh_offset != str_off) in ef_parse_dynamic() 438 if (shdr[i].sh_offset != rel_off) in ef_parse_dynamic() 440 if (shdr[i].sh_size != rel_sz) { in ef_parse_dynamic() 455 if (shdr[i].sh_offset != rela_off) in ef_parse_dynamic() 457 if (shdr[i].sh_size != rela_sz) { in ef_parse_dynamic() [all …]
|
/freebsd/contrib/elftoolchain/size/ |
H A D | size.c | 618 GElf_Shdr shdr; in handle_elf() local 656 berkeley_calc(&shdr); in handle_elf() 710 (size_t) shdr->sh_name); 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() 719 text_size_total += shdr->sh_size; in sysv_calc() 758 berkeley_calc(GElf_Shdr *shdr) in berkeley_calc() argument 760 if (shdr != NULL) { in berkeley_calc() 766 text_size += shdr->sh_size; in berkeley_calc() 770 data_size += shdr->sh_size; in berkeley_calc() [all …]
|
/freebsd/sys/compat/linux/ |
H A D | linux_vdso.c | 104 const Elf_Shdr *shdr; in __elfN() local 120 shdr = (const Elf_Shdr *)(base + ehdr->e_shoff); in __elfN() 124 if (shdr[i].sh_size == 0) in __elfN() 126 if (shdr[i].sh_type == SHT_DYNSYM) { in __elfN() 127 dsym = (Elf_Sym *)(base + shdr[i].sh_offset); in __elfN() 128 strtab = base + shdr[shdr[i].sh_link].sh_offset; in __elfN() 129 symcnt = shdr[i].sh_size / sizeof(*dsym); in __elfN()
|
/freebsd/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()
|
/freebsd/sys/x86/xen/ |
H A D | pv.c | 275 Elf_Shdr *shdr; in xen_pvh_parse_symtab() local 287 shdr = (Elf_Shdr *)((uint8_t *)ehdr + ehdr->e_shoff); in xen_pvh_parse_symtab() 290 if (shdr[i].sh_type != SHT_SYMTAB) in xen_pvh_parse_symtab() 292 if (shdr[i].sh_offset == 0) in xen_pvh_parse_symtab() 294 ksymtab = (uintptr_t)((uint8_t *)ehdr + shdr[i].sh_offset); in xen_pvh_parse_symtab() 295 ksymtab_size = shdr[i].sh_size; in xen_pvh_parse_symtab() 296 j = shdr[i].sh_link; in xen_pvh_parse_symtab() 297 if (shdr[j].sh_offset == 0) in xen_pvh_parse_symtab() 299 kstrtab = (uintptr_t)((uint8_t *)ehdr + shdr[j].sh_offset); in xen_pvh_parse_symtab()
|
/freebsd/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()
|
/freebsd/sys/powerpc/powerpc/ |
H A D | machdep.c | 530 Elf_Shdr *shdr; in load_external_symtab() local 585 shdr = (Elf_Shdr *)(kernelimg + ehdr->e_shoff); in load_external_symtab() 594 if (shdr[i].sh_type == SHT_SYMTAB) { in load_external_symtab() 596 shdr[i].sh_offset); in load_external_symtab() 598 (kernelimg_final + shdr[i].sh_offset); in load_external_symtab() 599 ksym_sz = (vm_offset_t)(shdr[i].sh_size); in load_external_symtab() 601 shdr[shdr[i].sh_link].sh_offset); in load_external_symtab() 604 shdr[shdr[i].sh_link].sh_offset); in load_external_symtab() 607 (shdr[shdr[i].sh_link].sh_size); in load_external_symtab()
|
/freebsd/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()
|
/freebsd/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()
|
/freebsd/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()
|
/freebsd/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()
|
/freebsd/sys/dev/ipw/ |
H A D | if_ipw.c | 489 struct ipw_soft_hdr *shdr; in ipw_dma_alloc() local 618 shdr = &sc->shdr_list[i]; in ipw_dma_alloc() 1313 shdr = sbd->priv; in ipw_release_sbd() 1583 shdr->hdr.subtype = 0; in ipw_tx_start() 1585 shdr->hdr.encrypt = 0; in ipw_tx_start() 1586 shdr->hdr.keyidx = 0; in ipw_tx_start() 1587 shdr->hdr.keysz = 0; in ipw_tx_start() 1626 error = bus_dmamap_load(sc->hdr_dmat, shdr->map, &shdr->hdr, in ipw_tx_start() 1640 sbd->priv = shdr; in ipw_tx_start() 1648 shdr->hdr.type, shdr->hdr.subtype, shdr->hdr.encrypted, in ipw_tx_start() [all …]
|
/freebsd/contrib/llvm-project/lld/ELF/ |
H A D | OutputSections.cpp | 63 void OutputSection::writeHeaderTo(typename ELFT::Shdr *shdr) { in writeHeaderTo() argument 64 shdr->sh_entsize = entsize; in writeHeaderTo() 65 shdr->sh_addralign = addralign; in writeHeaderTo() 66 shdr->sh_type = type; in writeHeaderTo() 67 shdr->sh_offset = offset; in writeHeaderTo() 68 shdr->sh_flags = flags; in writeHeaderTo() 69 shdr->sh_info = info; in writeHeaderTo() 70 shdr->sh_link = link; in writeHeaderTo() 71 shdr->sh_addr = addr; in writeHeaderTo() 72 shdr->sh_size = size; in writeHeaderTo() [all …]
|