/freebsd/contrib/elftoolchain/libelf/ |
H A D | elf_shnum.c | 35 _libelf_getshdrnum(Elf *e, size_t *shnum) in _libelf_getshdrnum() argument 49 *shnum = e->e_u.e_elf.e_nscn; in _libelf_getshdrnum() 55 elf_getshdrnum(Elf *e, size_t *shnum) in elf_getshdrnum() argument 57 return (_libelf_getshdrnum(e, shnum)); in elf_getshdrnum() 62 elf_getshnum(Elf *e, size_t *shnum) in elf_getshnum() argument 64 return (_libelf_getshdrnum(e, shnum) >= 0); in elf_getshnum()
|
H A D | libelf_extended.c | 49 _libelf_setshnum(Elf *e, void *eh, int ec, size_t shnum) in _libelf_setshnum() argument 53 if (shnum >= SHN_LORESERVE) { in _libelf_setshnum() 60 scn->s_shdr.s_shdr32.sh_size = (Elf32_Word) shnum; in _libelf_setshnum() 62 scn->s_shdr.s_shdr64.sh_size = shnum; in _libelf_setshnum() 66 shnum = 0; in _libelf_setshnum() 70 ((Elf32_Ehdr *) eh)->e_shnum = shnum & 0xFFFFU; in _libelf_setshnum() 72 ((Elf64_Ehdr *) eh)->e_shnum = shnum & 0xFFFFU; in _libelf_setshnum()
|
H A D | libelf_ehdr.c | 110 uint16_t phnum, shnum, strndx; in _libelf_ehdr() local 180 shnum = ((Elf32_Ehdr *) ehdr)->e_shnum; in _libelf_ehdr() 185 shnum = ((Elf64_Ehdr *) ehdr)->e_shnum; in _libelf_ehdr() 190 if (shnum >= SHN_LORESERVE || in _libelf_ehdr() 191 (shoff == 0LL && (shnum != 0 || phnum == PN_XNUM || in _libelf_ehdr() 201 if ((shnum == 0 && shoff != 0) || phnum == PN_XNUM || strndx == SHN_XINDEX) { in _libelf_ehdr() 207 e->e_u.e_elf.e_nscn = shnum; in _libelf_ehdr()
|
H A D | elf_scn.c | 66 size_t fsz, i, shnum; in _libelf_load_section_headers() local 77 shnum > SIZE_MAX / fsz || \ in _libelf_load_section_headers() 78 fsz * shnum > rawsize - shoff) { \ in _libelf_load_section_headers() 88 shnum = e->e_u.e_elf.e_nscn; in _libelf_load_section_headers() 120 for (; i < shnum; i++, src += fsz) { in _libelf_load_section_headers()
|
H A D | elf_update.c | 515 size_t phnum, shnum; in _libelf_resync_elf() local 573 shnum = e->e_u.e_elf.e_nscn; in _libelf_resync_elf() 669 if (shnum) { in _libelf_resync_elf() 670 fsz = _libelf_fsize(ELF_T_SHDR, ec, eh_version, shnum); in _libelf_resync_elf() 695 _libelf_setshnum(e, ehdr, ec, shnum); in _libelf_resync_elf()
|
/freebsd/contrib/file/src/ |
H A D | elfclass.h | 55 shnum = elf_getu16(swap, elfhdr.e_shnum); 56 if (shnum > ms->elf_shnum_max) 57 return toomany(ms, "section", shnum); 61 fsize, shnum, &flags, ¬ecount) == -1) 65 shnum = elf_getu16(swap, elfhdr.e_shnum); 66 if (shnum > ms->elf_shnum_max) 67 return toomany(ms, "section headers", shnum); 69 CAST(off_t, elf_getu(swap, elfhdr.e_shoff)), shnum,
|
H A D | readelf.c | 1897 uint16_t type, phnum, shnum, notecount; in file_tryelf() local
|
/freebsd/crypto/openssl/util/perl/ |
H A D | checkhandshake.pm | 89 my $shnum = 0; 94 $shnum = 1; 98 $shnum++ if ($numsh == 1 && TLSProxy::Proxy::is_tls13()); 113 $shnum++ if $message->mt() == TLSProxy::Message::MT_SERVER_HELLO; 137 && $extshnum != $shnum; 151 $shnum = 0; 156 $shnum = 1; 160 $shnum++ if ($numsh == 1 && TLSProxy::Proxy::is_tls13()); 180 $shnum++ if $message->mt() == TLSProxy::Message::MT_SERVER_HELLO; 215 && $extshnum != $shnum;
|
/freebsd/usr.sbin/crunch/crunchide/ |
H A D | exec_elf32.c | 239 Elf_Half shnum; in ELFNAMEEND() local 246 shnum = xe16toh(ehdr.e_shnum); in ELFNAMEEND() 248 shdrsize = shnum * xe16toh(ehdr.e_shentsize); in ELFNAMEEND() 257 for (i = 0; i < shnum; i++) { in ELFNAMEEND() 297 layoutp = xmalloc((shnum + 1) * sizeof(struct shlayout), in ELFNAMEEND() 306 layoutp[shnum].shdr = &shdrshdr; in ELFNAMEEND() 309 for (i = shnum; i-- != 0;) { in ELFNAMEEND() 311 r = shnum; in ELFNAMEEND() 329 ++shnum; in ELFNAMEEND() 348 for (i = 0; i < shnum; i++) { in ELFNAMEEND() [all …]
|
/freebsd/cddl/contrib/opensolaris/lib/libctf/common/ |
H A D | ctf_lib.c | 220 size_t shstrndx, shnum; in ctf_fdopen() local 303 shnum = hdr.e64.e_shnum; in ctf_fdopen() 307 if ((shstrndx == SHN_XINDEX) || (shnum == 0)) { in ctf_fdopen() 316 shnum = x32.sh_size; in ctf_fdopen() 326 shnum = x64.sh_size; in ctf_fdopen() 331 if (shstrndx >= shnum) in ctf_fdopen() 334 nbytes = sizeof (GElf_Shdr) * shnum; in ctf_fdopen() 346 nbytes = sizeof (Elf32_Shdr) * shnum; in ctf_fdopen() 355 for (i = 0; i < shnum; i++) in ctf_fdopen() 387 for (i = 0; i < shnum; i++) { in ctf_fdopen() [all …]
|
/freebsd/usr.bin/elfdump/ |
H A D | elfdump.c | 483 uint64_t shnum; in elf_get_shnum() local 485 shnum = elf_get_quarter(e, e, E_SHNUM); in elf_get_shnum() 486 if (shnum == 0) in elf_get_shnum() 487 shnum = elf_get_word(e, (char *)sh, SH_SIZE); in elf_get_shnum() 488 return shnum; in elf_get_shnum() 511 u_int64_t shnum; in main() local 617 shnum = elf_get_shnum(e, sh); in main() 624 shnum = 0; in main() 628 for (i = 0; (u_int64_t)i < shnum; i++) { in main() 659 for (i = 0; (u_int64_t)i < shnum; i++) { in main() [all …]
|
/freebsd/contrib/elftoolchain/elfdump/ |
H A D | elfdump.c | 121 size_t shnum; /* #sections. */ member 380 if ((uint64_t)ndx < ed->shnum) in sh_name() 1117 if (!elf_getshnum(ed->elf, &ed->shnum)) { in load_sections() 1121 if (ed->shnum == 0) in load_sections() 1123 if ((ed->sl = calloc(ed->shnum, sizeof(*ed->sl))) == NULL) in load_sections() 1150 if (ndx >= ed->shnum) { in load_sections() 1232 if (symtab >= ed->shnum) in get_symbol_name() 1247 if (sym.st_shndx < ed->shnum) { in get_symbol_name() 1400 for (i = 0; i < ed->shnum; i++) { in elf_print_shdr() 1469 for (j = 0; j < ed->shnum; j++) { in get_versym() [all …]
|
/freebsd/contrib/elftoolchain/readelf/ |
H A D | readelf.c | 171 size_t shnum; /* #sections. */ member 2263 size_t phnum, shnum, shstrndx; in dump_ehdr() local 2341 if (elf_getshnum(re->elf, &shnum)) in dump_ehdr() 2342 printf(" (%ju)", (uintmax_t)shnum); in dump_ehdr() 2538 if (re->shnum == 0) in dump_phdr() 2549 for (j = 1; (size_t)j < re->shnum; j++) { in dump_phdr() 2629 if (re->shnum == 0) { in dump_shdr() 2634 (uintmax_t)re->shnum, (uintmax_t)re->ehdr.e_shoff); in dump_shdr() 2658 for (i = 0; (size_t)i < re->shnum; i++) { in dump_shdr() 2738 for (i = 0; (size_t)i < re->shnum; i++) { in dump_dynamic() [all …]
|
/freebsd/contrib/elftoolchain/nm/ |
H A D | nm.c | 654 get_sym(Elf *elf, struct sym_head *headp, int shnum, size_t dynndx, in get_sym() argument 674 for (i = 1; i < shnum; i++) { in get_sym() 1200 size_t i, shstrndx, shnum, dynndx, strndx; in read_elf() local 1226 if (!elf_getshnum(elf, &shnum)) { in read_elf() 1234 if (shnum == 0) { in read_elf() 1245 if ((type_table = malloc(sizeof(char) * shnum)) == NULL) { in read_elf() 1251 if ((sec_table = calloc(shnum, sizeof(char *))) == NULL) { in read_elf() 1263 for (i = 1; i < shnum; ++i) { in read_elf() 1435 p_data.list_num = get_sym(elf, &list_head, shnum, dynndx, strndx, in read_elf() 1436 type_table, (void *) sec_table, shnum); in read_elf() [all …]
|
/freebsd/lib/libc/gen/ |
H A D | nlist.c | 261 elf_sym_to_nlist(struct nlist *nl, Elf_Sym *s, Elf_Shdr *shdr, int shnum) in elf_sym_to_nlist() argument 275 if (s->st_shndx >= shnum) in elf_sym_to_nlist()
|
/freebsd/contrib/llvm-project/lld/ELF/Arch/ |
H A D | ARM.cpp | 1480 const auto shnum = osIsPairs.size() + 1; in writeARMCmseImportLib() local 1482 sectionHeaderOff + shnum * sizeof(typename ELFT::Shdr); in writeARMCmseImportLib() 1515 eHdr->e_shnum = shnum; in writeARMCmseImportLib()
|