Searched refs:shnum (Results 1 - 15 of 15) sorted by relevance

/freebsd-11-stable/contrib/elftoolchain/libelf/
H A Delf_shnum.c35 _libelf_getshdrnum(Elf *e, size_t *shnum) argument
49 *shnum = e->e_u.e_elf.e_nscn;
55 elf_getshdrnum(Elf *e, size_t *shnum) argument
57 return (_libelf_getshdrnum(e, shnum));
62 elf_getshnum(Elf *e, size_t *shnum) argument
64 return (_libelf_getshdrnum(e, shnum) >= 0);
H A Dlibelf_extended.c49 _libelf_setshnum(Elf *e, void *eh, int ec, size_t shnum) argument
53 if (shnum >= SHN_LORESERVE) {
60 scn->s_shdr.s_shdr32.sh_size = (Elf32_Word) shnum;
62 scn->s_shdr.s_shdr64.sh_size = shnum;
66 shnum = 0;
70 ((Elf32_Ehdr *) eh)->e_shnum = shnum & 0xFFFFU;
72 ((Elf64_Ehdr *) eh)->e_shnum = shnum & 0xFFFFU;
H A Dlibelf_ehdr.c110 uint16_t phnum, shnum, strndx; local
180 shnum = ((Elf32_Ehdr *) ehdr)->e_shnum;
185 shnum = ((Elf64_Ehdr *) ehdr)->e_shnum;
190 if (shnum >= SHN_LORESERVE ||
191 (shoff == 0LL && (shnum != 0 || phnum == PN_XNUM ||
201 if ((shnum == 0 && shoff != 0) || phnum == PN_XNUM || strndx == SHN_XINDEX) {
207 e->e_u.e_elf.e_nscn = shnum;
H A Delf_scn.c66 size_t fsz, i, shnum; local
77 shnum > SIZE_MAX / fsz || \
78 fsz * shnum > rawsize - shoff) { \
88 shnum = e->e_u.e_elf.e_nscn;
120 for (; i < shnum; i++, src += fsz) {
H A Delf_update.c515 size_t phnum, shnum; local
573 shnum = e->e_u.e_elf.e_nscn;
669 if (shnum) {
670 fsz = _libelf_fsize(ELF_T_SHDR, ec, eh_version, shnum);
695 _libelf_setshnum(e, ehdr, ec, shnum);
/freebsd-11-stable/contrib/file/src/
H A Delfclass.h55 shnum = elf_getu16(swap, elfhdr.e_shnum);
56 if (shnum > ms->elf_shnum_max)
57 return toomany(ms, "section", shnum);
61 fsize, shnum, &flags, &notecount) == -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 Dreadelf.c1777 uint16_t type, phnum, shnum, notecount; local
/freebsd-11-stable/usr.sbin/crunch/crunchide/
H A Dexec_elf32.c240 Elf_Half shnum; local
247 shnum = xe16toh(ehdr.e_shnum);
249 shdrsize = shnum * xe16toh(ehdr.e_shentsize);
258 for (i = 0; i < shnum; i++) {
298 layoutp = xmalloc((shnum + 1) * sizeof(struct shlayout),
307 layoutp[shnum].shdr = &shdrshdr;
310 for (i = shnum; i-- != 0;) {
312 r = shnum;
330 ++shnum;
349 for (i = 0; i < shnum;
[all...]
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libctf/common/
H A Dctf_lib.c219 size_t shstrndx, shnum; local
301 shnum = hdr.e64.e_shnum;
305 if ((shstrndx == SHN_XINDEX) || (shnum == 0)) {
314 shnum = x32.sh_size;
324 shnum = x64.sh_size;
329 if (shstrndx >= shnum)
332 nbytes = sizeof (GElf_Shdr) * shnum;
344 nbytes = sizeof (Elf32_Shdr) * shnum;
353 for (i = 0; i < shnum; i++)
385 for (i = 0; i < shnum;
[all...]
/freebsd-11-stable/usr.bin/elfdump/
H A Delfdump.c469 * Helpers for ELF files with shnum or shstrndx values that don't fit in the
476 uint64_t shnum; local
478 shnum = elf_get_quarter(e, e, E_SHNUM);
479 if (shnum == 0)
480 shnum = elf_get_word(e, (char *)sh, SH_SIZE);
481 return shnum;
504 u_int64_t shnum; local
601 shnum = elf_get_shnum(e, sh);
608 shnum = 0;
612 for (i = 0; (u_int64_t)i < shnum;
711 u_int64_t shnum; local
797 u_int64_t shnum; local
[all...]
/freebsd-11-stable/contrib/elftoolchain/elfdump/
H A Delfdump.c121 size_t shnum; /* #sections. */ member in struct:elfdump
380 if ((uint64_t)ndx < ed->shnum)
1117 if (!elf_getshnum(ed->elf, &ed->shnum)) {
1121 if (ed->shnum == 0)
1123 if ((ed->sl = calloc(ed->shnum, sizeof(*ed->sl))) == NULL)
1150 if (ndx >= ed->shnum) {
1232 if (symtab >= ed->shnum)
1247 if (sym.st_shndx < ed->shnum) {
1400 for (i = 0; i < ed->shnum; i++) {
1469 for (j = 0; j < ed->shnum;
[all...]
/freebsd-11-stable/contrib/elftoolchain/readelf/
H A Dreadelf.c166 size_t shnum; /* #sections. */ member in struct:readelf
2227 size_t phnum, shnum, shstrndx; local
2305 if (elf_getshnum(re->elf, &shnum))
2306 printf(" (%ju)", (uintmax_t)shnum);
2502 if (re->shnum == 0)
2513 for (j = 1; (size_t)j < re->shnum; j++) {
2593 if (re->shnum == 0) {
2598 (uintmax_t)re->shnum, (uintmax_t)re->ehdr.e_shoff);
2622 for (i = 0; (size_t)i < re->shnum; i++) {
2697 for (i = 0; (size_t)i < re->shnum;
[all...]
/freebsd-11-stable/contrib/elftoolchain/nm/
H A Dnm.c617 get_sym(Elf *elf, struct sym_head *headp, int shnum, size_t dynndx, argument
637 for (i = 1; i < shnum; i++) {
1162 size_t i, shstrndx, shnum, dynndx, strndx; local
1188 if (!elf_getshnum(elf, &shnum)) {
1196 if (shnum == 0) {
1207 if ((type_table = malloc(sizeof(char) * shnum)) == NULL) {
1213 if ((sec_table = calloc(shnum, sizeof(char *))) == NULL) {
1225 for (i = 1; i < shnum; ++i) {
1397 p_data.list_num = get_sym(elf, &list_head, shnum, dynndx, strndx,
1398 type_table, (void *) sec_table, shnum);
[all...]
/freebsd-11-stable/lib/libc/gen/
H A Dnlist.c374 elf_sym_to_nlist(struct nlist *nl, Elf_Sym *s, Elf_Shdr *shdr, int shnum) argument
388 if (s->st_shndx >= shnum)
/freebsd-11-stable/contrib/binutils/bfd/
H A Delf.c507 unsigned int i, shnum; local
511 shnum = elf_numsections (abfd);
520 for (i = 0; i < shnum; i++)
546 for (i = 0; i < shnum; i++)
601 if (idx >= shnum)

Completed in 239 milliseconds