Home
last modified time | relevance | path

Searched refs:sh_size (Results 1 – 25 of 86) sorted by relevance

1234

/freebsd/contrib/elftoolchain/libelf/
H A Delf_data.c45 uint64_t sh_align, sh_offset, sh_size, raw_size; in elf_getdata() local
81 sh_size = (uint64_t) s->s_shdr.s_shdr32.sh_size; in elf_getdata()
86 sh_size = s->s_shdr.s_shdr64.sh_size; in elf_getdata()
98 (sh_offset > raw_size || sh_size > raw_size - sh_offset))) { in elf_getdata()
109 if (sh_size % fsz) { in elf_getdata()
114 if (sh_size / fsz > SIZE_MAX) { in elf_getdata()
119 count = (size_t) (sh_size / fsz); in elf_getdata()
143 if (sh_type == SHT_NOBITS || sh_size == 0) { in elf_getdata()
221 uint64_t sh_align, sh_offset, sh_size, raw_size; in elf_rawdata() local
245 sh_size = (uint64_t) s->s_shdr.s_shdr32.sh_size; in elf_rawdata()
[all …]
H A Delf_update.c122 uint64_t sh_align, sh_entsize, sh_offset, sh_size; in _libelf_compute_section_extents() local
133 sh_size = (uint64_t) shdr32->sh_size; in _libelf_compute_section_extents()
139 sh_size = shdr64->sh_size; in _libelf_compute_section_extents()
282 sh_size < scn_size || in _libelf_compute_section_extents()
310 sh_size = scn_size; in _libelf_compute_section_extents()
326 shdr32->sh_size = (uint32_t) sh_size; in _libelf_compute_section_extents()
331 shdr64->sh_size = sh_size; in _libelf_compute_section_extents()
338 s->s_size = sh_size; in _libelf_compute_section_extents()
728 uint64_t sh_off, sh_size; in _libelf_write_scn() local
738 sh_size = (uint64_t) s->s_shdr.s_shdr32.sh_size; in _libelf_write_scn()
[all …]
H A Dgelf_shdr.c76 d->sh_size = (Elf64_Xword) sh32->sh_size; in gelf_getshdr()
123 LIBELF_COPY_U32(sh32, s, sh_size); in gelf_update_shdr()
H A Dlibelf_extended.c60 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()
/freebsd/contrib/elftoolchain/elfcopy/
H A Dpe.c148 poh.oh_textsize = (uint32_t) roundup(sh.sh_size, in create_pe()
155 roundup(sh.sh_size, poh.oh_filealign); in create_pe()
158 roundup(sh.sh_size, poh.oh_filealign); in create_pe()
179 psh.sh_virtsize = sh.sh_size; in create_pe()
181 psh.sh_rawsize = roundup(sh.sh_size, poh.oh_filealign); in create_pe()
214 pb->pb_size = roundup(sh.sh_size, poh.oh_filealign); in create_pe()
219 memcpy(pb->pb_buf, d->d_buf, sh.sh_size); in create_pe()
H A Dsections.c411 s->sz = ish.sh_size; in create_scn()
646 if (ish.sh_size == 0) in update_section_group()
661 if ((s->buf = malloc(ish.sh_size)) == NULL) in update_section_group()
664 s->sz = ish.sh_size; in update_section_group()
672 n = ish.sh_size / ish.sh_entsize; in update_section_group()
750 n = ish.sh_size / ish.sh_entsize; in filter_reloc()
850 n = osh.sh_size / osh.sh_entsize; in update_reloc()
887 osh.sh_size = s->sz + s->pad_sz; in pad_section()
997 osh.sh_size = s->sz; in resync_sections()
1187 osh.sh_size = s->sz; in copy_shdr()
[all …]
/freebsd/sys/kern/
H A Dlink_elf_obj.c476 ef->ddbsymcnt = shdr[symtabindex].sh_size / sizeof(Elf_Sym); in link_elf_link_preload()
478 ef->ddbstrcnt = shdr[symstrindex].sh_size; in link_elf_link_preload()
480 ef->shstrcnt = shdr[shstrindex].sh_size; in link_elf_link_preload()
511 ef->progtab[pb].size = shdr[i].sh_size; in link_elf_link_preload()
521 dpcpu = dpcpu_alloc(shdr[i].sh_size); in link_elf_link_preload()
526 (uintmax_t)shdr[i].sh_size, in link_elf_link_preload()
533 dpcpu_copy(dpcpu, shdr[i].sh_size); in link_elf_link_preload()
540 vnet_data = vnet_data_alloc(shdr[i].sh_size); in link_elf_link_preload()
545 (uintmax_t)shdr[i].sh_size, in link_elf_link_preload()
565 lf->ctors_size = shdr[i].sh_size; in link_elf_link_preload()
[all …]
H A Dkern_ctf.c158 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()
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()
/freebsd/cddl/contrib/opensolaris/tools/ctf/cvt/
H A Doutput.c355 nent = shdr.sh_size / shdr.sh_entsize; in sort_iidescs()
603 ddata->d_buf = xmalloc(ddata->d_size + shdr.sh_size + in write_file()
605 bcopy(sdata->d_buf, ddata->d_buf, shdr.sh_size); in write_file()
606 strcpy((caddr_t)ddata->d_buf + shdr.sh_size, in write_file()
608 ctfnameoff = (off_t)shdr.sh_size; in write_file()
609 shdr.sh_size += seclen + 1; in write_file()
617 int nsym = shdr.sh_size / shdr.sh_entsize; in write_file()
621 ddata->d_buf = xmalloc(shdr.sh_size); in write_file()
622 bcopy(sdata->d_buf, ddata->d_buf, shdr.sh_size); in write_file()
646 ddata->d_buf = xmalloc(shdr.sh_size); in write_file()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/ObjectYAML/
H A DELFEmitter.cpp653 To.sh_size = *From->ShSize; in overrideFields()
685 LocationCounter += Header.sh_size; in initImplicitHeader()
849 SHeader.sh_size = *RawSec->Size; in initSectionHeaders()
854 LocationCounter += SHeader.sh_size; in initSectionHeaders()
860 SHeader.sh_size = writeContent(CBA, Sec->Content, Sec->Size); in initSectionHeaders()
908 LocationCounter += SHeader.sh_size; in initSectionHeaders()
1031 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initSymtabSectionHeader()
1037 SHeader.sh_size = Syms.size() * sizeof(Elf_Sym); in initSymtabSectionHeader()
1038 CBA.write((const char *)Syms.data(), SHeader.sh_size); in initSymtabSectionHeader()
1057 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initStrtabSectionHeader()
[all …]
/freebsd/stand/common/
H A Dload_elf_obj.c256 if (shdr[i].sh_size == 0) in __elfN()
270 lastaddr += shdr[i].sh_size; in __elfN()
292 lastaddr += shdr[ef->symtabindex].sh_size; in __elfN()
303 lastaddr += shdr[symstrindex].sh_size; in __elfN()
315 lastaddr += shdr[ef->shstrindex].sh_size; in __elfN()
326 lastaddr += shdr[i].sh_size; in __elfN()
362 cshdr->sh_size, (off_t)cshdr->sh_offset) != 0) { in __elfN()
490 *stopp = shdr[i].sh_addr + shdr[i].sh_size; in __elfN()
528 shdr[shdr[i].sh_info].sh_size) in __elfN()
535 nrela = shdr[i].sh_size / sizeof(Elf_Rela); in __elfN()
[all …]
H A Dload_elf.c191 CONVERT_FIELD(b, sh_size, e); \ in elf_section_header_convert()
728 chunk = shdr[ehdr->e_shstrndx].sh_size;
740 size = shdr[i].sh_size;
761 (shdr[i].sh_offset + shdr[i].sh_size <=
764 shdr[i].sh_size = 0;
768 if (shdr[i].sh_offset == 0 || shdr[i].sh_size == 0)
795 size = shdr[i].sh_size;
802 (uintmax_t)shdr[i].sh_size, (uintmax_t)shdr[i].sh_offset,
804 (uintmax_t)(lastaddr + shdr[i].sh_size));
817 result = archsw.arch_readin(VECTX_HANDLE(ef), lastaddr, shdr[i].sh_size);
[all …]
/freebsd/cddl/contrib/opensolaris/lib/libctf/common/
H A Dctf_lib.c171 dst->sh_size = src->sh_size; in shdr_to_gelf()
316 shnum = x32.sh_size; in ctf_fdopen()
326 shnum = x64.sh_size; in ctf_fdopen()
369 strs_mapsz = sp[shstrndx].sh_size + in ctf_fdopen()
394 if (shp->sh_name >= sp[shstrndx].sh_size || in ctf_fdopen()
395 lhp->sh_name >= sp[shstrndx].sh_size) in ctf_fdopen()
403 ctfsect.cts_size = shp->sh_size; in ctf_fdopen()
411 symsect.cts_size = shp->sh_size; in ctf_fdopen()
418 strsect.cts_size = lhp->sh_size; in ctf_fdopen()
/freebsd/cddl/contrib/opensolaris/lib/libdtrace/common/
H A Ddt_link.c63 dt_write(dtp, fd, (data), elf_file.shdr[(index)].sh_size) != \
64 elf_file.shdr[(index)].sh_size)
539 shp->sh_size = sizeof (DTRACE_SHSTRTAB32); in dump_elf32()
541 off = roundup2(shp->sh_offset + shp->sh_size, 8); in dump_elf32()
548 shp->sh_size = dof->dofh_filesz; in dump_elf32()
550 off = shp->sh_offset + shp->sh_size; in dump_elf32()
557 shp->sh_size = de.de_strlen; in dump_elf32()
559 off = roundup2(shp->sh_offset + shp->sh_size, 4); in dump_elf32()
569 shp->sh_size = de.de_nsym * sizeof (Elf32_Sym); in dump_elf32()
571 off = roundup2(shp->sh_offset + shp->sh_size, 4); in dump_elf32()
[all …]
/freebsd/usr.sbin/crunch/crunchide/
H A Dexec_elf32.c304 shdrshdr.sh_size = htoxew(shdrsize); in ELFNAMEEND()
336 if ((size = xewtoh(shstrtabshdr->sh_size)) == 0) in ELFNAMEEND()
364 if ((size = xewtoh(layoutp[i].shdr->sh_size)) == 0) in ELFNAMEEND()
394 nsyms = xewtoh(symtabshdr->sh_size) / xewtoh(symtabshdr->sh_entsize); in ELFNAMEEND()
430 strtabshdr->sh_size = htoxew(nstrtab_nextoff); in ELFNAMEEND()
438 xewtoh(layoutp[i - 1].shdr->sh_size); in ELFNAMEEND()
474 size = xewtoh(layoutp[i].shdr->sh_size); in ELFNAMEEND()
/freebsd/lib/libkldelf/
H A Def.c264 shdr[i].sh_size > phdyn->p_filesz : in ef_parse_dynamic()
265 shdr[i].sh_size != phdyn->p_filesz)) { 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()
401 sizeof(*ef->ef_hashtab) != shdr[i].sh_size) { in ef_parse_dynamic()
439 if (shdr[i].sh_size != rel_sz) { in ef_parse_dynamic()
456 if (shdr[i].sh_size != rela_sz) { in ef_parse_dynamic()
H A Delf.c364 ndyn = elf_object_count(efile, ELF_T_DYN, shdr.sh_size); in elf_read_dynamic()
400 nsym = elf_object_count(efile, ELF_T_SYM, shdr.sh_size); in elf_read_symbols()
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()
452 nrel = elf_object_count(efile, ELF_T_REL, shdr.sh_size); in elf_read_rel()
488 nrela = elf_object_count(efile, ELF_T_RELA, shdr.sh_size); in elf_read_rela()
/freebsd/stand/i386/isoboot/
H A Disoboot.c401 memcpy(p, &es[i].sh_size, in load()
402 sizeof(es[i].sh_size)); in load()
403 p += sizeof(es[i].sh_size); in load()
405 if (xfsread(ino, p, es[i].sh_size)) in load()
407 p += es[i].sh_size; in load()
/freebsd/stand/i386/zfsboot/
H A Dzfsboot.c443 memcpy(p, &es[i].sh_size, in load()
444 sizeof(es[i].sh_size)); in load()
445 p += sizeof(es[i].sh_size); in load()
447 size = es[i].sh_size; in load()
448 if (read(fd, p, es[i].sh_size) != size) { in load()
452 p += es[i].sh_size; in load()
/freebsd/contrib/llvm-project/llvm/include/llvm/Object/
H A DELF.h179 if (Sec.sh_size == 0) in checkSectionOffsets()
181 return Sec.sh_offset + Sec.sh_size <= Phdr.p_offset + Phdr.p_filesz; in checkSectionOffsets()
200 if (Sec.sh_size == 0 || IsTbssInNonTLS) in checkSectionVMA()
202 return Sec.sh_addr + Sec.sh_size <= Phdr.p_vaddr + Phdr.p_memsz; in checkSectionVMA()
432 if (Shdr.sh_offset + Shdr.sh_size > getBufSize()) { in notes_begin()
435 ") or size (0x" + Twine::utohexstr(Shdr.sh_size) + ")"); in notes_begin()
445 return Elf_Note_Iterator(base() + Shdr.sh_offset, Shdr.sh_size, in notes_begin()
622 uintX_t Size = Sec.sh_size; in getSectionContentsAsArray()
831 if (Sec.sh_size % Sec.sh_entsize != 0) { in getDynSymtabSize()
834 Twine(Sec.sh_size) + ") % sh_entsize (" + in getDynSymtabSize()
[all …]
/freebsd/sys/cddl/contrib/opensolaris/uts/common/ctf/
H A Dctf_mod.c141 symsect.cts_size = mp->symhdr->sh_size; in ctf_modopen()
153 strsect.cts_size = mp->strhdr->sh_size; in ctf_modopen()
/freebsd/stand/i386/gptboot/
H A Dgptboot.c462 memcpy(p, &es[i].sh_size, in load()
463 sizeof(es[i].sh_size)); in load()
464 p += sizeof(es[i].sh_size); in load()
466 if (xfsread(ino, p, es[i].sh_size)) in load()
468 p += es[i].sh_size; in load()
/freebsd/sys/compat/linux/
H A Dlinux_vdso.c124 if (shdr[i].sh_size == 0) in __elfN()
129 symcnt = shdr[i].sh_size / sizeof(*dsym); in __elfN()
/freebsd/stand/i386/boot2/
H A Dboot2.c332 *(Elf32_Word *)p = es[i].sh_size; in load()
333 p += sizeof(es[i].sh_size); in load()
335 if (xfsread(ino, p, es[i].sh_size)) in load()
337 p += es[i].sh_size; in load()
/freebsd/lib/libc/gen/
H A Dnlist.c170 symsize = shdr[i].sh_size; in __elf_fdnlist()
172 symstrsize = shdr[shdr[i].sh_link].sh_size; in __elf_fdnlist()

1234