| /netbsd-src/sys/arch/amd64/stand/prekern/ |
| H A D | elf.c | 38 Elf_Shdr *shdr; member 64 elf_section_mappable(Elf_Shdr *shdr) in elf_section_mappable() argument 66 if (!(shdr->sh_flags & SHF_ALLOC)) { in elf_section_mappable() 69 if (shdr->sh_type != SHT_NOBITS && in elf_section_mappable() 70 shdr->sh_type != SHT_PROGBITS) { in elf_section_mappable() 77 elf_can_drop_unmappable(Elf_Shdr *shdr) in elf_can_drop_unmappable() argument 91 if (shdr->sh_type == SHT_NOTE) { in elf_can_drop_unmappable() 130 if (eif.shdr[i].sh_name == 0) { in elf_find_section() 133 buf = eif.shstrtab + eif.shdr[i].sh_name; in elf_find_section() 135 return &eif.shdr[i]; in elf_find_section() [all …]
|
| /netbsd-src/sys/lib/libsa/ |
| H A D | loadfile_elf32.c | 190 internalize_shdr(Elf_Byte bo, Elf_Shdr *shdr) in internalize_shdr() argument 194 I32(shdr->sh_name); in internalize_shdr() 195 I32(shdr->sh_type); in internalize_shdr() 196 I32(shdr->sh_flags); in internalize_shdr() 197 I32(shdr->sh_addr); in internalize_shdr() 198 I32(shdr->sh_offset); in internalize_shdr() 199 I32(shdr->sh_size); in internalize_shdr() 200 I32(shdr->sh_link); in internalize_shdr() 201 I32(shdr->sh_info); in internalize_shdr() 202 I32(shdr->sh_addralign); in internalize_shdr() [all …]
|
| /netbsd-src/external/cddl/osnet/dist/tools/ctf/cvt/ |
| H A D | output.c | 346 GElf_Shdr shdr; in sort_iidescs() local 361 gelf_getshdr(scn, &shdr); in sort_iidescs() 362 nent = shdr.sh_size / shdr.sh_entsize; in sort_iidescs() 364 scn = elf_getscn(elf, shdr.sh_link); in sort_iidescs() 469 GElf_Shdr shdr; in write_file() local 550 gelf_getshdr(sscn, &shdr); in write_file() 567 pad = new_offset % shdr.sh_addralign; in write_file() 570 new_offset += shdr.sh_addralign - pad; in write_file() 571 shdr.sh_offset = new_offset; in write_file() 574 shdr.sh_link = secxlate[shdr.sh_link]; in write_file() [all …]
|
| /netbsd-src/sys/kern/ |
| H A D | subr_kobj.c | 156 Elf_Shdr *shdr; in kobj_load() local 176 shdr = NULL; in kobj_load() 235 error = ko->ko_read(ko, (void **)&shdr, ko->ko_shdrsz, hdr->e_shoff, in kobj_load() 241 ko->ko_shdr = shdr; in kobj_load() 249 switch (shdr[i].sh_type) { in kobj_load() 257 symstrindex = shdr[i].sh_link; in kobj_load() 260 if (shdr[shdr[i].sh_info].sh_type != SHT_PROGBITS) in kobj_load() 265 if (shdr[shdr[i].sh_info].sh_type != SHT_PROGBITS) in kobj_load() 288 shdr[symstrindex].sh_type != SHT_STRTAB) { in kobj_load() 328 ko->ko_symcnt = shdr[symtabindex].sh_size / sizeof(Elf_Sym); in kobj_load() [all …]
|
| /netbsd-src/external/gpl3/binutils.old/dist/gprofng/src/ |
| H A D | Elf.cc | 371 Elf_Internal_Shdr *shdr = get_shdr (sec); in elf_get_sec_num() local 372 if (shdr == NULL) in elf_get_sec_num() 374 char *sname = elf_strptr (ehdrp->e_shstrndx, shdr->sh_name); in elf_get_sec_num() 384 Elf_Internal_Shdr *shdr = get_shdr (sec); in get_sec_name() local 385 if (ehdrp == NULL || shdr == NULL) in get_sec_name() 387 return elf_strptr (ehdrp->e_shstrndx, shdr->sh_name); in get_sec_name() 402 Elf_Internal_Shdr *shdr = get_shdr (sec); in elf_getdata() local 403 if (shdr == NULL) in elf_getdata() 407 if ((shdr->sh_flags & SHF_SUNW_ABSENT) != 0) in elf_getdata() 433 edta->d_buf = get_data (shdr->sh_offset, (size_t) shdr->sh_size, NULL); in elf_getdata() [all …]
|
| /netbsd-src/external/gpl3/binutils/dist/gprofng/src/ |
| H A D | Elf.cc | 384 Elf_Internal_Shdr *shdr = get_shdr (sec); in elf_get_sec_num() local 385 if (shdr == NULL) in elf_get_sec_num() 387 char *sname = elf_strptr (ehdrp->e_shstrndx, shdr->sh_name); in elf_get_sec_num() 397 Elf_Internal_Shdr *shdr = get_shdr (sec); in get_sec_name() local 398 if (ehdrp == NULL || shdr == NULL) in get_sec_name() 400 return elf_strptr (ehdrp->e_shstrndx, shdr->sh_name); in get_sec_name() 415 Elf_Internal_Shdr *shdr = get_shdr (sec); in elf_getdata() local 416 if (shdr == NULL) in elf_getdata() 420 if ((shdr->sh_flags & SHF_SUNW_ABSENT) != 0) in elf_getdata() 446 edta->d_buf = get_data (shdr->sh_offset, (size_t) shdr->sh_size, NULL); in elf_getdata() [all …]
|
| /netbsd-src/external/gpl3/binutils/dist/elfcpp/ |
| H A D | elfcpp_file.h | 440 Ef_shdr shdr(v.data()); in initialize_shnum() 443 this->shnum_ = shdr.get_sh_size(); in initialize_shnum() 447 this->shstrndx_ = shdr.get_sh_link(); in initialize_shnum() 487 Ef_shdr shdr(v.data() + This::shdr_size * i); in find_section_by_type() 488 if (shdr.get_sh_type() == type) in find_section_by_type() 519 Ef_shdr shdr(v.data()); in section_name() 520 sh_name = shdr.get_sh_name(); in section_name() 567 Ef_shdr shdr(v.data()); in section_contents() 568 return typename File::Location(shdr.get_sh_offset(), shdr.get_sh_size()); in section_contents() 586 Ef_shdr shdr(v.data()); in section_size() [all …]
|
| /netbsd-src/external/gpl3/binutils.old/dist/elfcpp/ |
| H A D | elfcpp_file.h | 440 Ef_shdr shdr(v.data()); in initialize_shnum() 443 this->shnum_ = shdr.get_sh_size(); in initialize_shnum() 447 this->shstrndx_ = shdr.get_sh_link(); in initialize_shnum() 487 Ef_shdr shdr(v.data() + This::shdr_size * i); in find_section_by_type() 488 if (shdr.get_sh_type() == type) in find_section_by_type() 519 Ef_shdr shdr(v.data()); in section_name() 520 sh_name = shdr.get_sh_name(); in section_name() 567 Ef_shdr shdr(v.data()); in section_contents() 568 return typename File::Location(shdr.get_sh_offset(), shdr.get_sh_size()); in section_contents() 586 Ef_shdr shdr(v.data()); in section_size() [all …]
|
| /netbsd-src/external/gpl3/gcc.old/dist/libiberty/ |
| H A D | simple-object-elf.c | 504 unsigned char shdr[sizeof (Elf64_External_Shdr)]; in simple_object_elf_match() local 508 if (!simple_object_internal_read (descriptor, offset + eor->shoff, shdr, in simple_object_elf_match() 520 shdr, sh_size, Elf_Addr); in simple_object_elf_match() 525 shdr, sh_link, Elf_Word); in simple_object_elf_match() 625 unsigned char *shdr; in simple_object_elf_find_sections() local 631 shdr = shdrs + (i - 1) * shdr_size; in simple_object_elf_find_sections() 633 shdr, sh_name, Elf_Word); in simple_object_elf_find_sections() 644 shdr, sh_offset, Elf_Addr); in simple_object_elf_find_sections() 646 shdr, sh_size, Elf_Addr); in simple_object_elf_find_sections() 1161 unsigned char *shdr; in simple_object_elf_copy_lto_debug_sections() local [all …]
|
| /netbsd-src/external/gpl3/gcc/dist/libiberty/ |
| H A D | simple-object-elf.c | 504 unsigned char shdr[sizeof (Elf64_External_Shdr)]; in simple_object_elf_match() local 508 if (!simple_object_internal_read (descriptor, offset + eor->shoff, shdr, in simple_object_elf_match() 520 shdr, sh_size, Elf_Addr); in simple_object_elf_match() 525 shdr, sh_link, Elf_Word); in simple_object_elf_match() 625 unsigned char *shdr; in simple_object_elf_find_sections() local 631 shdr = shdrs + (i - 1) * shdr_size; in simple_object_elf_find_sections() 633 shdr, sh_name, Elf_Word); in simple_object_elf_find_sections() 644 shdr, sh_offset, Elf_Addr); in simple_object_elf_find_sections() 646 shdr, sh_size, Elf_Addr); in simple_object_elf_find_sections() 1161 unsigned char *shdr; in simple_object_elf_copy_lto_debug_sections() local [all …]
|
| /netbsd-src/external/gpl3/binutils.old/dist/libiberty/ |
| H A D | simple-object-elf.c | 504 unsigned char shdr[sizeof (Elf64_External_Shdr)]; in simple_object_elf_match() local 508 if (!simple_object_internal_read (descriptor, offset + eor->shoff, shdr, in simple_object_elf_match() 520 shdr, sh_size, Elf_Addr); in simple_object_elf_match() 525 shdr, sh_link, Elf_Word); in simple_object_elf_match() 625 unsigned char *shdr; in simple_object_elf_find_sections() local 631 shdr = shdrs + (i - 1) * shdr_size; in simple_object_elf_find_sections() 633 shdr, sh_name, Elf_Word); in simple_object_elf_find_sections() 644 shdr, sh_offset, Elf_Addr); in simple_object_elf_find_sections() 646 shdr, sh_size, Elf_Addr); in simple_object_elf_find_sections() 1161 unsigned char *shdr; in simple_object_elf_copy_lto_debug_sections() local [all …]
|
| /netbsd-src/external/gpl3/binutils/dist/libiberty/ |
| H A D | simple-object-elf.c | 504 unsigned char shdr[sizeof (Elf64_External_Shdr)]; in simple_object_elf_match() local 508 if (!simple_object_internal_read (descriptor, offset + eor->shoff, shdr, in simple_object_elf_match() 520 shdr, sh_size, Elf_Addr); in simple_object_elf_match() 525 shdr, sh_link, Elf_Word); in simple_object_elf_match() 625 unsigned char *shdr; in simple_object_elf_find_sections() local 631 shdr = shdrs + (i - 1) * shdr_size; in simple_object_elf_find_sections() 633 shdr, sh_name, Elf_Word); in simple_object_elf_find_sections() 644 shdr, sh_offset, Elf_Addr); in simple_object_elf_find_sections() 646 shdr, sh_size, Elf_Addr); in simple_object_elf_find_sections() 1161 unsigned char *shdr; in simple_object_elf_copy_lto_debug_sections() local [all …]
|
| /netbsd-src/external/gpl3/binutils.old/dist/gold/ |
| H A D | object.cc | 122 typename elfcpp::Shdr<size, big_endian> shdr(p); in read_symtab_xindex() local 123 bytecount = convert_to_section_size_type(shdr.get_sh_size()); in read_symtab_xindex() 124 contents = object->get_view(shdr.get_sh_offset(), bytecount, true, false); in read_symtab_xindex() 527 typename This::Shdr shdr(p); in find_symtab() local 528 if (shdr.get_sh_type() == elfcpp::SHT_SYMTAB) in find_symtab() 546 if (shdr.get_sh_type() == elfcpp::SHT_SYMTAB_SHNDX) in find_symtab() 549 xindex_link = this->adjust_shndx(shdr.get_sh_link()); in find_symtab() 574 const elfcpp::Shdr<size, big_endian>* shdr) const in check_eh_frame_flags() 576 elfcpp::Elf_Word sh_type = shdr->get_sh_type(); in check_eh_frame_flags() 579 && (shdr->get_sh_flags() & elfcpp::SHF_ALLOC) != 0); in check_eh_frame_flags() [all …]
|
| H A D | reloc.cc | 281 typename This::Shdr shdr(ps); in do_read_relocs() local 283 unsigned int sh_type = shdr.get_sh_type(); in do_read_relocs() 287 unsigned int shndx = this->adjust_shndx(shdr.get_sh_info()); in do_read_relocs() 315 if (this->adjust_shndx(shdr.get_sh_link()) != this->symtab_shndx_) in do_read_relocs() 319 i, this->adjust_shndx(shdr.get_sh_link())); in do_read_relocs() 323 off_t sh_size = shdr.get_sh_size(); in do_read_relocs() 333 if (reloc_size != shdr.get_sh_entsize()) in do_read_relocs() 336 i, static_cast<unsigned long>(shdr.get_sh_entsize()), in do_read_relocs() 353 sr.contents = this->get_lasting_view(shdr.get_sh_offset(), sh_size, in do_read_relocs() 702 typename This::Shdr shdr(p); in write_sections() local [all …]
|
| /netbsd-src/external/gpl3/binutils/dist/gold/ |
| H A D | object.cc | 122 typename elfcpp::Shdr<size, big_endian> shdr(p); in read_symtab_xindex() local 123 bytecount = convert_to_section_size_type(shdr.get_sh_size()); in read_symtab_xindex() 124 contents = object->get_view(shdr.get_sh_offset(), bytecount, true, false); in read_symtab_xindex() 527 typename This::Shdr shdr(p); in find_symtab() local 528 if (shdr.get_sh_type() == elfcpp::SHT_SYMTAB) in find_symtab() 546 if (shdr.get_sh_type() == elfcpp::SHT_SYMTAB_SHNDX) in find_symtab() 549 xindex_link = this->adjust_shndx(shdr.get_sh_link()); in find_symtab() 574 const elfcpp::Shdr<size, big_endian>* shdr) const in check_eh_frame_flags() 576 elfcpp::Elf_Word sh_type = shdr->get_sh_type(); in check_eh_frame_flags() 579 && (shdr->get_sh_flags() & elfcpp::SHF_ALLOC) != 0); in check_eh_frame_flags() [all …]
|
| H A D | reloc.cc | 281 typename This::Shdr shdr(ps); in do_read_relocs() local 283 unsigned int sh_type = shdr.get_sh_type(); in do_read_relocs() 287 unsigned int shndx = this->adjust_shndx(shdr.get_sh_info()); in do_read_relocs() 315 if (this->adjust_shndx(shdr.get_sh_link()) != this->symtab_shndx_) in do_read_relocs() 319 i, this->adjust_shndx(shdr.get_sh_link())); in do_read_relocs() 323 off_t sh_size = shdr.get_sh_size(); in do_read_relocs() 333 if (reloc_size != shdr.get_sh_entsize()) in do_read_relocs() 336 i, static_cast<unsigned long>(shdr.get_sh_entsize()), in do_read_relocs() 353 sr.contents = this->get_lasting_view(shdr.get_sh_offset(), sh_size, in do_read_relocs() 702 typename This::Shdr shdr(p); in write_sections() local [all …]
|
| /netbsd-src/external/gpl3/binutils/dist/gprofng/libcollector/ |
| H A D | mmaptrace.c | 988 ELF_SHDR *shdr = (ELF_SHDR*) (base + ehdr->e_shoff); in process_vsyscall_page() local 1022 i, (long long) shdr[i].sh_name, base + shdr[ehdr->e_shstrndx].sh_offset + shdr[i].sh_name, in process_vsyscall_page() 1023 (long long) shdr[i].sh_type, (long long) shdr[i].sh_type, in process_vsyscall_page() 1024 (long long) shdr[i].sh_flags, (long long) shdr[i].sh_flags, in process_vsyscall_page() 1025 (long long) shdr[i].sh_addr, (long long) shdr[i].sh_addr, in process_vsyscall_page() 1026 (long long) shdr[i].sh_offset, (long long) shdr[i].sh_offset, in process_vsyscall_page() 1027 (long long) shdr[i].sh_size, (long long) shdr[i].sh_size, in process_vsyscall_page() 1028 (long long) shdr[i].sh_link, (long long) shdr[i].sh_link, in process_vsyscall_page() 1029 (long long) shdr[i].sh_info, (long long) shdr[i].sh_info, in process_vsyscall_page() 1030 (long long) shdr[i].sh_addralign, (long long) shdr[i].sh_addralign, in process_vsyscall_page() [all …]
|
| /netbsd-src/external/gpl3/binutils.old/dist/gprofng/libcollector/ |
| H A D | mmaptrace.c | 1009 ELF_SHDR *shdr = (ELF_SHDR*) (base + ehdr->e_shoff); in process_vsyscall_page() local 1043 i, (long long) shdr[i].sh_name, base + shdr[ehdr->e_shstrndx].sh_offset + shdr[i].sh_name, in process_vsyscall_page() 1044 (long long) shdr[i].sh_type, (long long) shdr[i].sh_type, in process_vsyscall_page() 1045 (long long) shdr[i].sh_flags, (long long) shdr[i].sh_flags, in process_vsyscall_page() 1046 (long long) shdr[i].sh_addr, (long long) shdr[i].sh_addr, in process_vsyscall_page() 1047 (long long) shdr[i].sh_offset, (long long) shdr[i].sh_offset, in process_vsyscall_page() 1048 (long long) shdr[i].sh_size, (long long) shdr[i].sh_size, in process_vsyscall_page() 1049 (long long) shdr[i].sh_link, (long long) shdr[i].sh_link, in process_vsyscall_page() 1050 (long long) shdr[i].sh_info, (long long) shdr[i].sh_info, in process_vsyscall_page() 1051 (long long) shdr[i].sh_addralign, (long long) shdr[i].sh_addralign, in process_vsyscall_page() [all …]
|
| /netbsd-src/external/bsd/elftoolchain/dist/libelf/ |
| H A D | libelf_checksum.c | 58 GElf_Shdr shdr; in _libelf_checksum() local 86 if (gelf_getshdr(scn, &shdr) == NULL) in _libelf_checksum() 88 if ((shdr.sh_flags & SHF_ALLOC) == 0 || in _libelf_checksum() 89 shdr.sh_type == SHT_DYNAMIC || in _libelf_checksum() 90 shdr.sh_type == SHT_DYNSYM) in _libelf_checksum()
|
| H A D | elf_strptr.c | 52 GElf_Shdr shdr; in elf_strptr() local 61 gelf_getshdr(s, &shdr) == NULL) in elf_strptr() 64 if (shdr.sh_type != SHT_STRTAB || in elf_strptr() 65 offset >= shdr.sh_size) { in elf_strptr()
|
| /netbsd-src/sys/arch/atari/stand/tostools/libtos/ |
| H A D | elf.c | 119 Elf32_Shdr shdr; in elf_load() local 122 if (read(fd, &shdr, sizeof(shdr)) != sizeof(shdr)) in elf_load() 124 if ((shdr.sh_type == SHT_SYMTAB) || (shdr.sh_type == SHT_STRTAB)) in elf_load() 125 symsize += shdr.sh_size; in elf_load()
|
| /netbsd-src/external/bsd/libproc/dist/ |
| H A D | proc_sym.c | 325 GElf_Shdr shdr; in proc_addr2sym() local 355 gelf_getshdr(scn, &shdr); in proc_addr2sym() 356 switch (shdr.sh_type) { in proc_addr2sym() 359 symtabstridx = shdr.sh_link; in proc_addr2sym() 363 dynsymstridx = shdr.sh_link; in proc_addr2sym() 474 GElf_Shdr shdr; in proc_name2sym() local 503 gelf_getshdr(scn, &shdr); in proc_name2sym() 504 switch (shdr.sh_type) { in proc_name2sym() 507 symtabstridx = shdr.sh_link; in proc_name2sym() 511 dynsymstridx = shdr.sh_link; in proc_name2sym() [all …]
|
| /netbsd-src/lib/libexecinfo/ |
| H A D | symtab.c | 124 GElf_Shdr shdr; in symtab_create() local 129 gelf_getshdr(scn, &shdr); in symtab_create() 130 if(shdr.sh_type != SHT_SYMTAB) in symtab_create() 134 ns = shdr.sh_size / shdr.sh_entsize; in symtab_create() 147 elf_strptr(elf, shdr.sh_link, sym.st_name), in symtab_create() 162 elf_strptr(elf, shdr.sh_link, sym.st_name)); in symtab_create()
|
| /netbsd-src/sys/dev/pci/ |
| H A D | if_ipw.c | 377 struct ipw_soft_hdr *shdr; in ipw_dma_alloc() local 554 shdr = &sc->shdr_list[i]; in ipw_dma_alloc() 555 shdr->hdr = sc->hdr_list + i; in ipw_dma_alloc() 556 shdr->offset = sizeof(struct ipw_hdr) * i; in ipw_dma_alloc() 557 shdr->addr = sc->hdr_map->dm_segs[0].ds_addr + shdr->offset; in ipw_dma_alloc() 558 TAILQ_INSERT_TAIL(&sc->sc_free_shdr, shdr, next); in ipw_dma_alloc() 1180 struct ipw_soft_hdr *shdr; in ipw_release_sbd() local 1191 shdr = sbd->priv; in ipw_release_sbd() 1193 shdr->offset, sizeof(struct ipw_hdr), BUS_DMASYNC_POSTWRITE); in ipw_release_sbd() 1194 TAILQ_INSERT_TAIL(&sc->sc_free_shdr, shdr, next); in ipw_release_sbd() [all …]
|
| /netbsd-src/external/gpl3/gcc.old/dist/libbacktrace/ |
| H A D | elf.c | 2747 const b_elf_shdr *shdr; in elf_add() local 2749 if (!backtrace_get_view (state, descriptor, shoff, sizeof shdr, in elf_add() 2753 shdr = (const b_elf_shdr *) shdr_view.data; in elf_add() 2756 shnum = shdr->sh_size; in elf_add() 2760 shstrndx = shdr->sh_link; in elf_add() 2813 const b_elf_shdr *shdr; in elf_add() local 2818 shdr = &shdrs[i - 1]; in elf_add() 2820 if (shdr->sh_type == SHT_SYMTAB) in elf_add() 2822 else if (shdr->sh_type == SHT_DYNSYM) in elf_add() 2825 sh_name = shdr->sh_name; in elf_add() [all …]
|