/netbsd/sys/arch/atari/stand/tostools/libtos/ |
H A D | aout.c | 83 struct exec ehdr; in aout_load() local 89 if (read(fd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr)) in aout_load() 96 if ((N_GETMAGIC(ehdr) != NMAGIC) && (N_GETMAGIC(ehdr) != OMAGIC)) in aout_load() 105 od->ksize = textsz + ehdr.a_data + ehdr.a_bss; in aout_load() 110 if (lseek(fd, ehdr.a_text+ehdr.a_data+ehdr.a_syms+sizeof(ehdr), in aout_load() 130 if ((read(fd, (char *)(od->kstart), ehdr.a_text) != ehdr.a_text) in aout_load() 131 ||(read(fd,(char *)(od->kstart+textsz),ehdr.a_data) != ehdr.a_data)) in aout_load() 133 memset(od->kstart + textsz + ehdr.a_data, 0, ehdr.a_bss); in aout_load() 141 p = (long *)((od->kstart) + textsz + ehdr.a_data + ehdr.a_bss); in aout_load() 142 *p++ = ehdr.a_syms; in aout_load() [all …]
|
H A D | elf.c | 72 Elf32_Ehdr ehdr; in elf_load() local 79 if (read(fd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr)) in elf_load() 114 i = ehdr.e_shnum + 1; in elf_load() 116 if (lseek(fd, (off_t)ehdr.e_shoff, SEEK_SET) != ehdr.e_shoff) in elf_load() 131 kernsize += symsize + sizeof(ehdr) + ehdr.e_shnum*sizeof(Elf32_Shdr); in elf_load() 139 od->kentry = ehdr.e_entry; in elf_load() 175 p = symtab + sizeof(ehdr); in elf_load() 176 nhdrs = ehdr.e_shnum; in elf_load() 178 if (lseek(fd, (off_t)ehdr.e_shoff, SEEK_SET) != ehdr.e_shoff) in elf_load() 215 ehdr.e_shoff = sizeof(ehdr); in elf_load() [all …]
|
/netbsd/external/gpl3/gdb/dist/gdb/testsuite/gdb.base/ |
H A D | sym-file-loader.c | 72 Elf_External_Ehdr *ehdr; member 218 Elf_External_Ehdr *ehdr; in load_shlib() local 268 ehdr = (Elf_External_Ehdr *) addr; in load_shlib() 269 if (ehdr->e_ident[EI_MAG0] != ELFMAG0 in load_shlib() 319 lib->ehdr = ehdr; in load_shlib() 344 find_shdrtab (Elf_External_Ehdr *ehdr) in find_shdrtab() argument 346 return (Elf_External_Shdr *) (((uint8_t *) ehdr) + GET (ehdr, e_shoff)); in find_shdrtab() 357 if (GET (ehdr, e_shnum) <= GET (ehdr, e_shstrndx)) in find_shstrtab() 363 shdr = find_shdrtab (ehdr); in find_shstrtab() 373 find_strtab (Elf_External_Ehdr *ehdr, in find_strtab() argument [all …]
|
/netbsd/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.base/ |
H A D | sym-file-loader.c | 72 Elf_External_Ehdr *ehdr; member 218 Elf_External_Ehdr *ehdr; in load_shlib() local 268 ehdr = (Elf_External_Ehdr *) addr; in load_shlib() 269 if (ehdr->e_ident[EI_MAG0] != ELFMAG0 in load_shlib() 319 lib->ehdr = ehdr; in load_shlib() 344 find_shdrtab (Elf_External_Ehdr *ehdr) in find_shdrtab() argument 346 return (Elf_External_Shdr *) (((uint8_t *) ehdr) + GET (ehdr, e_shoff)); in find_shdrtab() 357 if (GET (ehdr, e_shnum) <= GET (ehdr, e_shstrndx)) in find_shstrtab() 363 shdr = find_shdrtab (ehdr); in find_shstrtab() 373 find_strtab (Elf_External_Ehdr *ehdr, in find_strtab() argument [all …]
|
/netbsd/sys/arch/amd64/stand/prekern/ |
H A D | elf.c | 37 Elf_Ehdr *ehdr; member 57 eif.ehdr->e_type != ET_REL) { in elf_check_header() 276 Elf_Ehdr *ehdr; in elf_get_head_size() local 280 ehdr = (Elf_Ehdr *)headva; in elf_get_head_size() 281 shdr = (Elf_Shdr *)((uint8_t *)ehdr + ehdr->e_shoff); in elf_get_head_size() 284 (vaddr_t)ehdr; in elf_get_head_size() 294 eif.ehdr = (Elf_Ehdr *)headva; in elf_build_head() 295 eif.shdr = (Elf_Shdr *)((uint8_t *)eif.ehdr + eif.ehdr->e_shoff); in elf_build_head() 382 j = eif.ehdr->e_shstrndx; in elf_build_info() 386 if (j >= eif.ehdr->e_shnum) { in elf_build_info() [all …]
|
/netbsd/sys/lib/libsa/ |
H A D | loadfile_elf32.c | 93 I16(ehdr->e_type); in internalize_ehdr() 96 I32(ehdr->e_entry); in internalize_ehdr() 97 I32(ehdr->e_phoff); in internalize_ehdr() 98 I32(ehdr->e_shoff); in internalize_ehdr() 99 I32(ehdr->e_flags); in internalize_ehdr() 102 I16(ehdr->e_phnum); in internalize_ehdr() 104 I16(ehdr->e_shnum); in internalize_ehdr() 107 I16(ehdr->e_type); in internalize_ehdr() 110 I64(ehdr->e_entry); in internalize_ehdr() 130 E16(ehdr->e_type); in externalize_ehdr() [all …]
|
/netbsd/external/bsd/elftoolchain/dist/libelf/ |
H A D | libelf_ehdr.c | 122 void *ehdr; in _libelf_ehdr() local 155 return (ehdr); in _libelf_ehdr() 175 e->e_u.e_elf.e_ehdr.e_ehdr32 = ehdr; in _libelf_ehdr() 176 EHDR_INIT(ehdr,32); in _libelf_ehdr() 178 e->e_u.e_elf.e_ehdr.e_ehdr64 = ehdr; in _libelf_ehdr() 179 EHDR_INIT(ehdr,64); in _libelf_ehdr() 186 return (ehdr); in _libelf_ehdr() 197 phnum = ((Elf32_Ehdr *) ehdr)->e_phnum; in _libelf_ehdr() 198 shnum = ((Elf32_Ehdr *) ehdr)->e_shnum; in _libelf_ehdr() 199 shoff = ((Elf32_Ehdr *) ehdr)->e_shoff; in _libelf_ehdr() [all …]
|
H A D | elf_scn.c | 53 _libelf_load_section_headers(Elf *e, void *ehdr) in _libelf_load_section_headers() argument 66 assert(ehdr != NULL); in _libelf_load_section_headers() 86 eh32 = (Elf32_Ehdr *) ehdr; in _libelf_load_section_headers() 90 eh64 = (Elf64_Ehdr *) ehdr; in _libelf_load_section_headers() 146 void *ehdr; in elf_getscn() local 155 if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL) in elf_getscn() 160 _libelf_load_section_headers(e, ehdr) == 0) in elf_getscn() 185 void *ehdr; in elf_newscn() local 198 if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL) in elf_newscn() 213 _libelf_load_section_headers(e, ehdr) == 0) in elf_newscn()
|
/netbsd/sys/kern/ |
H A D | core_elf32.c | 114 Elf_Ehdr ehdr; in ELFNAMEEND() local 159 memset(&ehdr.e_ident[EI_PAD], 0, sizeof(ehdr.e_ident) - EI_PAD); in ELFNAMEEND() 179 ehdr.e_entry = 0; in ELFNAMEEND() 180 ehdr.e_flags = 0; in ELFNAMEEND() 181 ehdr.e_ehsize = sizeof(ehdr); in ELFNAMEEND() 186 ehdr.e_shnum = 0; in ELFNAMEEND() 187 ehdr.e_shoff = 0; in ELFNAMEEND() 188 ehdr.e_phoff = sizeof(ehdr); in ELFNAMEEND() 192 ehdr.e_shnum = 1; in ELFNAMEEND() 193 ehdr.e_shoff = sizeof(ehdr); in ELFNAMEEND() [all …]
|
/netbsd/libexec/ld.elf_so/ |
H A D | map_object.c | 68 Elf_Ehdr *ehdr; in _rtld_map_object() local 129 obj->ehdr = ehdr; in _rtld_map_object() 130 if (ehdr == MAP_FAILED) { in _rtld_map_object() 151 if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN) { in _rtld_map_object() 155 switch (ehdr->e_machine) { in _rtld_map_object() 168 assert(ehdr->e_phoff + ehdr->e_phnum * sizeof(Elf_Phdr) <= in _rtld_map_object() 177 phdr = (Elf_Phdr *) ((caddr_t)ehdr + ehdr->e_phoff); in _rtld_map_object() 189 phlimit = phdr + ehdr->e_phnum; in _rtld_map_object() 270 phdr = (Elf_Phdr *) ((caddr_t)ehdr + ehdr->e_phoff); in _rtld_map_object() 479 if (obj->ehdr != MAP_FAILED) in _rtld_map_object() [all …]
|
/netbsd/external/gpl3/gdb/dist/gold/ |
H A D | target.cc | 72 const elfcpp::Ehdr<size, big_endian>& ehdr) in do_make_elf_object_implementation() argument 74 int et = ehdr.get_e_type(); in do_make_elf_object_implementation() 107 off_t offset, const elfcpp::Ehdr<32, false>& ehdr) in do_make_elf_object() argument 110 offset, ehdr); in do_make_elf_object() 117 off_t offset, const elfcpp::Ehdr<32, true>& ehdr) in do_make_elf_object() argument 120 offset, ehdr); in do_make_elf_object() 127 off_t offset, const elfcpp::Ehdr<64, false>& ehdr) in do_make_elf_object() argument 130 offset, ehdr); in do_make_elf_object() 137 off_t offset, const elfcpp::Ehdr<64, true>& ehdr) in do_make_elf_object() argument 140 offset, ehdr); in do_make_elf_object() [all …]
|
/netbsd/external/gpl3/binutils/dist/gold/ |
H A D | target.cc | 72 const elfcpp::Ehdr<size, big_endian>& ehdr) in do_make_elf_object_implementation() argument 74 int et = ehdr.get_e_type(); in do_make_elf_object_implementation() 107 off_t offset, const elfcpp::Ehdr<32, false>& ehdr) in do_make_elf_object() argument 110 offset, ehdr); in do_make_elf_object() 117 off_t offset, const elfcpp::Ehdr<32, true>& ehdr) in do_make_elf_object() argument 120 offset, ehdr); in do_make_elf_object() 127 off_t offset, const elfcpp::Ehdr<64, false>& ehdr) in do_make_elf_object() argument 130 offset, ehdr); in do_make_elf_object() 137 off_t offset, const elfcpp::Ehdr<64, true>& ehdr) in do_make_elf_object() argument 140 offset, ehdr); in do_make_elf_object() [all …]
|
/netbsd/external/gpl3/binutils.old/dist/gold/ |
H A D | target.cc | 72 const elfcpp::Ehdr<size, big_endian>& ehdr) in do_make_elf_object_implementation() argument 74 int et = ehdr.get_e_type(); in do_make_elf_object_implementation() 107 off_t offset, const elfcpp::Ehdr<32, false>& ehdr) in do_make_elf_object() argument 110 offset, ehdr); in do_make_elf_object() 117 off_t offset, const elfcpp::Ehdr<32, true>& ehdr) in do_make_elf_object() argument 120 offset, ehdr); in do_make_elf_object() 127 off_t offset, const elfcpp::Ehdr<64, false>& ehdr) in do_make_elf_object() argument 130 offset, ehdr); in do_make_elf_object() 137 off_t offset, const elfcpp::Ehdr<64, true>& ehdr) in do_make_elf_object() argument 140 offset, ehdr); in do_make_elf_object() [all …]
|
/netbsd/external/gpl3/gdb.old/dist/gold/ |
H A D | target.cc | 72 const elfcpp::Ehdr<size, big_endian>& ehdr) in do_make_elf_object_implementation() argument 74 int et = ehdr.get_e_type(); in do_make_elf_object_implementation() 107 off_t offset, const elfcpp::Ehdr<32, false>& ehdr) in do_make_elf_object() argument 110 offset, ehdr); in do_make_elf_object() 117 off_t offset, const elfcpp::Ehdr<32, true>& ehdr) in do_make_elf_object() argument 120 offset, ehdr); in do_make_elf_object() 127 off_t offset, const elfcpp::Ehdr<64, false>& ehdr) in do_make_elf_object() argument 130 offset, ehdr); in do_make_elf_object() 137 off_t offset, const elfcpp::Ehdr<64, true>& ehdr) in do_make_elf_object() argument 140 offset, ehdr); in do_make_elf_object() [all …]
|
/netbsd/sys/arch/i386/stand/lib/ |
H A D | exec_multiboot1.c | 54 class = ((Elf_Ehdr *)ehdr)->e_ident[EI_CLASS]; in ksyms_addr_set() 58 ehdr32 = (Elf32_Ehdr *)ehdr; in ksyms_addr_set() 62 ehdr64 = (Elf64_Ehdr *)ehdr; in ksyms_addr_set() 163 Elf32_Ehdr ehdr; in exec_multiboot1() local 168 pvbcopy((void *)mbp->mbp_marks[MARK_SYM], &ehdr, sizeof(ehdr)); in exec_multiboot1() 170 if (memcmp(&ehdr.e_ident, ELFMAG, SELFMAG) != 0) in exec_multiboot1() 175 shlen = ehdr.e_shnum * ehdr.e_shentsize; in exec_multiboot1() 179 ksyms_addr_set(&ehdr, shbuf, in exec_multiboot1() 185 mbi->mi_elfshdr_num = ehdr.e_shnum; in exec_multiboot1() 186 mbi->mi_elfshdr_size = ehdr.e_shentsize; in exec_multiboot1() [all …]
|
/netbsd/sys/arch/x68k/stand/common/ |
H A D | exec_sub.c | 161 xarg->ehdr = *hdr; in xk_elf() 181 xarg->ehdr.e_shnum = 0; /* no symbol */ in xk_elf() 191 xarg->ehdr.e_shnum = 3; in xk_elf() 192 xarg->ehdr.e_shoff = sizeof(Elf32_Ehdr); in xk_elf() 207 xarg->ehdr.e_shnum++; in xk_elf() 252 Elf32_Ehdr *ehdr; in xk_load() local 264 ehdr = buf; in xk_load() 311 ehdr->e_version != EV_CURRENT) in xk_load() 314 if ((u = ehdr->e_machine) != EM_68K) in xk_load() 317 if (ehdr->e_type != ET_EXEC) in xk_load() [all …]
|
/netbsd/usr.sbin/mopd/common/ |
H A D | file.c | 426 Elf32_Ehdr ehdr; in CheckElfFile() 430 if (read(fd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr)) in CheckElfFile() 453 Elf32_Ehdr ehdr; in GetElfFileInfo() 461 if (read(dl->ldfd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr)) in GetElfFileInfo() 480 sizeof(ehdr.e_machine)); in GetElfFileInfo() 483 sizeof(ehdr.e_entry)); in GetElfFileInfo() 487 sizeof(ehdr.e_phoff)); in GetElfFileInfo() 493 sizeof(ehdr.e_phnum)); in GetElfFileInfo() 502 sizeof(ehdr.e_entry)); in GetElfFileInfo() 506 sizeof(ehdr.e_phoff)); in GetElfFileInfo() [all …]
|
/netbsd/sys/arch/mipsco/stand/common/ |
H A D | bootxx.c | 120 Elf32_Ehdr ehdr; in loadfile() local 137 i = read(fd, (char *)&ehdr, sizeof(ehdr)); in loadfile() 138 if ((i != sizeof(ehdr)) || in loadfile() 139 (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0) || in loadfile() 140 (ehdr.e_ident[EI_CLASS] != ELFCLASS32)) { in loadfile() 145 for (i = 0; i < ehdr.e_phnum; i++) { in loadfile() 146 if (lseek(fd, (off_t) ehdr.e_phoff + i * sizeof(phdr), 0) < 0) in loadfile() 157 return ((entrypt)ehdr.e_entry); in loadfile()
|
/netbsd/sys/arch/emips/stand/common/ |
H A D | bootxx.c | 116 Elf32_Ehdr ehdr; in loadfile() local 147 i = read(fd, (char *)&ehdr, sizeof(ehdr)); in loadfile() 148 if ((i != sizeof(ehdr)) || in loadfile() 149 (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0) || in loadfile() 150 (ehdr.e_ident[EI_CLASS] != ELFCLASS32)) { in loadfile() 155 for (i = 0; i < ehdr.e_phnum; i++) { in loadfile() 156 if (lseek(fd, (off_t) ehdr.e_phoff + i * sizeof(phdr), 0) < 0) in loadfile() 167 return ((entrypt*)ehdr.e_entry); in loadfile()
|
/netbsd/usr.sbin/lockstat/ |
H A D | elf32.c | 103 Elf_Ehdr ehdr; in NAME() local 111 if (pread(fd, &ehdr, sizeof(ehdr), 0) != sizeof(ehdr)) in NAME() 114 if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0 || in NAME() 115 ehdr.e_ident[EI_CLASS] != ELFCLASS) in NAME() 118 switch (ehdr.e_machine) { in NAME() 128 off = ehdr.e_shoff; in NAME() 129 for (i = 0; i < ehdr.e_shnum; i++, off += sizeof(symhdr)) { in NAME() 136 if (i == ehdr.e_shnum || symhdr.sh_offset == 0) in NAME() 145 off = ehdr.e_shoff + symhdr.sh_link * sizeof(symhdr); in NAME()
|
/netbsd/sys/arch/pmax/stand/common/ |
H A D | bootxx.c | 138 Elf32_Ehdr ehdr; in loadfile() local 169 i = read(fd, (char *)&ehdr, sizeof(ehdr)); in loadfile() 170 if ((i != sizeof(ehdr)) || in loadfile() 171 (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0) || in loadfile() 172 (ehdr.e_ident[EI_CLASS] != ELFCLASS32)) { in loadfile() 177 for (i = 0; i < ehdr.e_phnum; i++) { in loadfile() 178 if (lseek(fd, (off_t) ehdr.e_phoff + i * sizeof(phdr), 0) < 0) in loadfile() 189 return ((entrypt)ehdr.e_entry); in loadfile()
|
/netbsd/external/bsd/tcpdump/dist/ |
H A D | print-token.c | 158 struct ether_header ehdr; in token_print() local 173 extract_token_addrs(trp, (char*)ESRC(&ehdr), (char*)EDST(&ehdr)); in token_print() 178 *ESRC(&ehdr) &= 0x7f; in token_print() 181 token_hdr_print(ndo, trp, length, ESRC(&ehdr), EDST(&ehdr)); in token_print() 209 token_hdr_print(ndo, trp, length, ESRC(&ehdr), EDST(&ehdr)); in token_print() 212 src.addr = ESRC(&ehdr); in token_print() 214 dst.addr = EDST(&ehdr); in token_print() 238 ESRC(&ehdr), EDST(&ehdr)); in token_print()
|
H A D | print-ipfc.c | 100 struct ether_header ehdr; in ipfc_print() local 111 extract_ipfc_addrs(ipfcp, (char *)ESRC(&ehdr), (char *)EDST(&ehdr)); in ipfc_print() 114 ipfc_hdr_print(ndo, ipfcp, length, ESRC(&ehdr), EDST(&ehdr)); in ipfc_print() 116 src.addr = ESRC(&ehdr); in ipfc_print() 118 dst.addr = EDST(&ehdr); in ipfc_print()
|
/netbsd/sys/arch/sun3/sun3x/ |
H A D | locore2.c | 98 Elf_Ehdr *ehdr; in _save_symtab() local 106 ehdr = (void *)end; in _save_symtab() 107 if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) != 0 || in _save_symtab() 108 ehdr->e_ident[EI_CLASS] != ELFCLASS32) { in _save_symtab() 119 shp = (Elf_Shdr *)(end + ehdr->e_shoff); in _save_symtab() 120 for (i = 0; i < ehdr->e_shnum; i++) { in _save_symtab() 130 ssym = (char *)ehdr; in _save_symtab()
|
/netbsd/sys/arch/pmax/stand/smallnet/setnetimage/ |
H A D | setnetimage.c | 85 Elf32_Ehdr ehdr; in main() local 130 i = read(ifd, (char *)&ehdr, sizeof(ehdr)); in main() 131 if ((i != sizeof(ehdr)) || in main() 132 (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0) || in main() 133 (ehdr.e_ident[EI_CLASS] != ELFCLASS32)) { in main() 139 for (i = 0; i < ehdr.e_phnum; i++) { in main() 140 if (lseek(ifd, (off_t) ehdr.e_phoff + i * sizeof(phdr), 0) < 0) in main() 166 printf("entry point: 0x%08x\n", ehdr.e_entry); in main() 207 NLVAR(X_KERNEL_ENTRY) = ehdr.e_entry; in main()
|