Home
last modified time | relevance | path

Searched refs:shdr (Results 1 – 25 of 34) sorted by relevance

12

/openbsd/usr.bin/nm/
H A Delf.c179 free(shdr); in elf_load_shdrs()
203 shdr->sh_name = swap32(shdr->sh_name); in elf_fix_shdrs()
204 shdr->sh_type = swap32(shdr->sh_type); in elf_fix_shdrs()
205 shdr->sh_flags = swap_xword(shdr->sh_flags); in elf_fix_shdrs()
206 shdr->sh_addr = swap_addr(shdr->sh_addr); in elf_fix_shdrs()
207 shdr->sh_offset = swap_off(shdr->sh_offset); in elf_fix_shdrs()
208 shdr->sh_size = swap_xword(shdr->sh_size); in elf_fix_shdrs()
209 shdr->sh_link = swap32(shdr->sh_link); in elf_fix_shdrs()
210 shdr->sh_info = swap32(shdr->sh_info); in elf_fix_shdrs()
211 shdr->sh_addralign = swap_xword(shdr->sh_addralign); in elf_fix_shdrs()
[all …]
H A Dnm.c644 void *shdr; in show_file() local
646 if (!(shdr = elf32_load_shdrs(name, fp, foff, &head->elf32))) in show_file()
650 elf32_size(&head->elf32, shdr, &text, &data, &bss) : in show_file()
651 elf32_symload(name, fp, foff, &head->elf32, shdr, in show_file()
653 free(shdr); in show_file()
660 void *shdr; in show_file() local
662 if (!(shdr = elf64_load_shdrs(name, fp, foff, &head->elf64))) in show_file()
666 elf64_size(&head->elf64, shdr, &text, &data, &bss) : in show_file()
667 elf64_symload(name, fp, foff, &head->elf64, shdr, in show_file()
669 free(shdr); in show_file()
/openbsd/lib/libc/gen/
H A Dnlist.c97 Elf_Shdr *shdr = NULL; in __fdnlist() local
121 if (shdr == MAP_FAILED) { in __fdnlist()
127 free(shdr); in __fdnlist()
139 if (shdr[i].sh_type == SHT_SYMTAB) { in __fdnlist()
140 if (shdr[i].sh_link >= ehdr.e_shnum) in __fdnlist()
142 symoff = shdr[i].sh_offset; in __fdnlist()
143 symsize = shdr[i].sh_size; in __fdnlist()
144 symstroff = shdr[shdr[i].sh_link].sh_offset; in __fdnlist()
145 symstrsize = shdr[shdr[i].sh_link].sh_size; in __fdnlist()
152 free(shdr); in __fdnlist()
[all …]
/openbsd/usr.sbin/installboot/
H A Di386_nlist.c104 Elf_Shdr *shdr = NULL; in __elf_fdnlist() local
128 if (shdr == MAP_FAILED) { in __elf_fdnlist()
135 free(shdr); in __elf_fdnlist()
147 if (shdr[i].sh_type == SHT_SYMTAB) { in __elf_fdnlist()
148 if (shdr[i].sh_link >= ehdr.e_shnum) in __elf_fdnlist()
150 symoff = shdr[i].sh_offset; in __elf_fdnlist()
151 symsize = shdr[i].sh_size; in __elf_fdnlist()
152 symstroff = shdr[shdr[i].sh_link].sh_offset; in __elf_fdnlist()
153 symstrsize = shdr[shdr[i].sh_link].sh_size; in __elf_fdnlist()
160 free(shdr); in __elf_fdnlist()
[all …]
/openbsd/sys/ddb/
H A Ddb_dwarf.c487 Elf_Shdr shdr; in main() local
489 sizeof(shdr)); in main()
490 if (shdr.sh_type != SHT_STRTAB) in main()
492 if (shdr.sh_offset > filesize) in main()
494 if (shdr.sh_size > filesize - shdr.sh_offset) in main()
497 size_t shstrtabsize = shdr.sh_size; in main()
503 sizeof(shdr)); in main()
505 shstrtabsize - shdr.sh_name)) in main()
510 if (shdr.sh_offset > filesize) in main()
512 if (shdr.sh_size > filesize - shdr.sh_offset) in main()
[all …]
/openbsd/lib/libelf/
H A Dlibelf_checksum.c53 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 Delf_strptr.c43 GElf_Shdr shdr; in elf_strptr() local
52 gelf_getshdr(s, &shdr) == NULL) in elf_strptr()
55 if (shdr.sh_type != SHT_STRTAB || in elf_strptr()
56 offset >= shdr.sh_size) { in elf_strptr()
/openbsd/usr.sbin/rdsetroot/
H A Drdsetroot.c43 GElf_Shdr shdr; in main() local
120 if (gelf_getshdr(scn, &shdr) != &shdr) in main()
123 if ((name = elf_strptr(e, shstrndx, shdr.sh_name)) == NULL) in main()
127 shdr.sh_type == SHT_SYMTAB && shdr.sh_entsize != 0) { in main()
129 nsymb = shdr.sh_size / shdr.sh_entsize; in main()
133 shdr.sh_type == SHT_STRTAB) { in main()
135 strtabsz = shdr.sh_size; in main()
/openbsd/usr.sbin/btrace/
H A Dksyms.c56 GElf_Shdr shdr; in kelf_open() local
86 if (gelf_getshdr(scn, &shdr) != &shdr) { in kelf_open()
90 if ((name = elf_strptr(elf, shstrndx, shdr.sh_name)) == NULL) { in kelf_open()
95 shdr.sh_type == SHT_SYMTAB && shdr.sh_entsize != 0) { in kelf_open()
97 symtab_size = shdr.sh_size / shdr.sh_entsize; in kelf_open()
100 shdr.sh_type == SHT_STRTAB) { in kelf_open()
/openbsd/sys/arch/arm64/dev/
H A Dapldc.c765 struct mtp_subhdr *shdr; in apldchidev_rx_intr() local
793 memcpy(sc->sc_data, (shdr + 1), shdr->len); in apldchidev_rx_intr()
794 sc->sc_data_len = shdr->len; in apldchidev_rx_intr()
810 apldchidev_handle_comm(sc, shdr + 1, shdr->len); in apldchidev_rx_intr()
812 apldckbd_intr(sc->sc_kbd, (uint8_t *)(shdr + 1), shdr->len); in apldchidev_rx_intr()
814 apldcms_intr(sc->sc_mt, (uint8_t *)(shdr + 1), shdr->len); in apldchidev_rx_intr()
829 struct mtp_subhdr shdr; in apldchidev_cmd() local
851 memset(&shdr, 0, sizeof(shdr)); in apldchidev_cmd()
852 shdr.flags = flags; in apldchidev_cmd()
853 shdr.len = len; in apldchidev_cmd()
[all …]
/openbsd/usr.bin/ctfdump/
H A Dctfdump.c211 GElf_Shdr shdr; in elf_dump() local
225 if (gelf_getshdr(scn, &shdr) != &shdr) { in elf_dump()
230 if ((name = elf_strptr(e, shstrndx, shdr.sh_name)) == NULL) { in elf_dump()
239 shdr.sh_type == SHT_SYMTAB && shdr.sh_entsize != 0) { in elf_dump()
241 nsymb = shdr.sh_size / shdr.sh_entsize; in elf_dump()
245 shdr.sh_type == SHT_STRTAB) { in elf_dump()
247 strtabsz = shdr.sh_size; in elf_dump()
/openbsd/sys/dev/
H A Dksyms.c77 Elf_Shdr *shdr; in ksymsattach() local
86 shdr = (Elf_Shdr *)&symtab[elf->e_shoff]; in ksymsattach()
88 if (shdr[i].sh_type == SHT_SYMTAB) { in ksymsattach()
H A Dipmi.c1036 struct sdrhdr shdr; in get_sdr() local
1052 if (get_sdr_partial(sc, recid, resid, 0, sizeof shdr, &shdr, nxtrec)) { in get_sdr()
1058 sdrlen = sizeof(shdr) + shdr.record_length; in get_sdr()
1063 memcpy(psdr, &shdr, sizeof(shdr)); in get_sdr()
1066 for (offset = sizeof(shdr); offset < sdrlen; offset += maxsdrlen) { in get_sdr()
/openbsd/sys/dev/pci/
H A Dif_ipw.c338 struct ipw_soft_hdr *shdr; in ipw_dma_alloc() local
463 shdr = &sc->shdr_list[i]; in ipw_dma_alloc()
988 struct ipw_soft_hdr *shdr; in ipw_release_sbd() local
997 shdr = sbd->priv; in ipw_release_sbd()
1146 struct ipw_soft_hdr *shdr; in ipw_tx_start() local
1179 shdr->hdr.subtype = htole32(0); in ipw_tx_start()
1181 shdr->hdr.encrypt = 0; in ipw_tx_start()
1182 shdr->hdr.keyidx = 0; in ipw_tx_start()
1183 shdr->hdr.keysz = 0; in ipw_tx_start()
1217 error = bus_dmamap_load(sc->sc_dmat, shdr->map, &shdr->hdr, in ipw_tx_start()
[all …]
/openbsd/gnu/llvm/lld/ELF/
H A DOutputSections.cpp61 void OutputSection::writeHeaderTo(typename ELFT::Shdr *shdr) { in writeHeaderTo() argument
62 shdr->sh_entsize = entsize; in writeHeaderTo()
63 shdr->sh_addralign = addralign; in writeHeaderTo()
64 shdr->sh_type = type; in writeHeaderTo()
65 shdr->sh_offset = offset; in writeHeaderTo()
66 shdr->sh_flags = flags; in writeHeaderTo()
67 shdr->sh_info = info; in writeHeaderTo()
68 shdr->sh_link = link; in writeHeaderTo()
69 shdr->sh_addr = addr; in writeHeaderTo()
70 shdr->sh_size = size; in writeHeaderTo()
[all …]
H A DInputSection.cpp139 typename ELFT::Shdr shdr = in relsOrRelas() local
141 if (shdr.sh_type == SHT_REL) { in relsOrRelas()
143 file->mb.getBufferStart() + shdr.sh_offset), in relsOrRelas()
144 shdr.sh_size / sizeof(typename ELFT::Rel)); in relsOrRelas()
146 assert(shdr.sh_type == SHT_RELA); in relsOrRelas()
148 file->mb.getBufferStart() + shdr.sh_offset), in relsOrRelas()
149 shdr.sh_size / sizeof(typename ELFT::Rela)); in relsOrRelas()
/openbsd/gnu/usr.bin/binutils-2.17/bfd/
H A Delf.c447 Elf_Internal_Shdr *shdr; member
498 if (shdr->sh_type == SHT_GROUP && shdr->sh_size >= 8) in setup_group()
523 if (shdr->sh_type == SHT_GROUP && shdr->sh_size >= 8) in setup_group()
535 shdr->contents = bfd_alloc2 (abfd, shdr->sh_size, in setup_group()
537 if (shdr->contents == NULL in setup_group()
539 || (bfd_bread (shdr->contents, shdr->sh_size, abfd) in setup_group()
540 != shdr->sh_size)) in setup_group()
547 src = shdr->contents + shdr->sh_size; in setup_group()
598 n_elt = shdr->sh_size / 4; in setup_group()
705 elf_sec_group (idx->shdr->bfd_section) = shdr->bfd_section; in _bfd_elf_setup_sections()
[all …]
H A Delf32-i370.c379 Elf_Internal_Shdr *shdr, in i370_elf_fake_sections() argument
383 shdr->sh_flags |= SHF_EXCLUDE; in i370_elf_fake_sections()
386 shdr->sh_type = SHT_ORDERED; in i370_elf_fake_sections()
H A Delf-bfd.h33 #define NUM_SHDR_ENTRIES(shdr) ((shdr)->sh_size / (shdr)->sh_entsize) argument
/openbsd/gnu/usr.bin/binutils/bfd/
H A Delf.c426 Elf_Internal_Shdr *shdr; member
474 if (shdr->sh_type == SHT_GROUP && shdr->sh_size >= 8) in setup_group()
495 if (shdr->sh_type == SHT_GROUP && shdr->sh_size >= 8) in setup_group()
508 if (shdr->contents == NULL in setup_group()
510 || (bfd_bread (shdr->contents, shdr->sh_size, abfd) in setup_group()
511 != shdr->sh_size)) in setup_group()
518 src = shdr->contents + shdr->sh_size; in setup_group()
531 shdr->bfd_section->flags in setup_group()
562 if ((++idx)->shdr == hdr) in setup_group()
570 n_elt = shdr->sh_size / 4; in setup_group()
[all …]
H A Delf32-i370.c418 i370_elf_fake_sections (abfd, shdr, asect) in i370_elf_fake_sections() argument
420 Elf_Internal_Shdr *shdr;
424 shdr->sh_flags |= SHF_EXCLUDE;
427 shdr->sh_type = SHT_ORDERED;
H A Delf-bfd.h33 #define NUM_SHDR_ENTRIES(shdr) ((shdr)->sh_size / (shdr)->sh_entsize) argument
H A Delflink.h2767 elf_link_read_relocs_from_section (abfd, shdr, external_relocs, in elf_link_read_relocs_from_section() argument
2770 Elf_Internal_Shdr *shdr;
2781 if (!shdr)
2785 if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0)
2789 if (bfd_bread (external_relocs, shdr->sh_size, abfd) != shdr->sh_size)
2795 if (shdr->sh_entsize == sizeof (Elf_External_Rel))
2797 else if (shdr->sh_entsize == sizeof (Elf_External_Rela))
2806 erelaend = erela + NUM_SHDR_ENTRIES (shdr) * shdr->sh_entsize;
2812 erela += shdr->sh_entsize;
/openbsd/sys/kern/
H A Dexec_elf.c1235 Elf_Shdr shdr; member
1238 .shdr = {
1296 ehdr.e_phoff = shstrtab.shdr.sh_offset + shstrtab.shdr.sh_size; in coredump_setup_elf()
1309 Elf_Shdr shdr = { .sh_info = ws->npsections }; in coredump_setup_elf() local
1310 error = coredump_write(ws->iocookie, UIO_SYSSPACE, &shdr, in coredump_setup_elf()
1311 sizeof shdr, 0); in coredump_setup_elf()
1315 sizeof(shstrtab.shdr) + sizeof(shstrtab.shstrtab), 0); in coredump_setup_elf()
/openbsd/gnu/llvm/llvm/lib/ExecutionEngine/RuntimeDyld/
H A DRuntimeDyldELF.cpp108 Elf_Shdr *shdr = in updateSectionAddress() local
113 shdr->sh_addr = static_cast<addr_type>(Addr); in updateSectionAddress()
164 Elf_Shdr *shdr = const_cast<Elf_Shdr *>( in createRTDyldELFObject() local
170 shdr->sh_addr = static_cast<addr_type>(SecLoadAddr); in createRTDyldELFObject()

12