/freebsd/contrib/elftoolchain/libelf/ |
H A D | gelf_ehdr.c | 67 (void) memcpy(d->e_ident, eh32->e_ident, in gelf_getehdr() 68 sizeof(eh32->e_ident)); in gelf_getehdr() 150 (void) memcpy(eh32->e_ident, s->e_ident, sizeof(eh32->e_ident)); in gelf_update_ehdr()
|
H A D | libelf_ehdr.c | 93 eh->e_ident[EI_MAG0] = ELFMAG0; \ 94 eh->e_ident[EI_MAG1] = ELFMAG1; \ 95 eh->e_ident[EI_MAG2] = ELFMAG2; \ 96 eh->e_ident[EI_MAG3] = ELFMAG3; \ 97 eh->e_ident[EI_CLASS] = ELFCLASS##SZ; \ 98 eh->e_ident[EI_DATA] = ELFDATANONE; \ 99 eh->e_ident[EI_VERSION] = LIBELF_PRIVATE(version) & 0xFFU; \
|
H A D | elf_update.c | 537 eh_byteorder = eh32->e_ident[EI_DATA]; in _libelf_resync_elf() 538 eh_class = eh32->e_ident[EI_CLASS]; in _libelf_resync_elf() 543 eh_byteorder = eh64->e_ident[EI_DATA]; in _libelf_resync_elf() 544 eh_class = eh64->e_ident[EI_CLASS]; in _libelf_resync_elf() 580 (E)->e_ident[EI_MAG0] = ELFMAG0; \ in _libelf_resync_elf() 581 (E)->e_ident[EI_MAG1] = ELFMAG1; \ in _libelf_resync_elf() 582 (E)->e_ident[EI_MAG2] = ELFMAG2; \ in _libelf_resync_elf() 583 (E)->e_ident[EI_MAG3] = ELFMAG3; \ in _libelf_resync_elf() 584 (E)->e_ident[EI_CLASS] = (unsigned char) (EC); \ in _libelf_resync_elf() 585 (E)->e_ident[EI_VERSION] = (_version & 0xFFU); \ in _libelf_resync_elf()
|
/freebsd/lib/libkvm/ |
H A D | kvm_powerpc64.c | 58 if (eh->e_ident[EI_CLASS] != ELFCLASS64) in valid_elf_header() 60 if (eh->e_ident[EI_DATA] != ELFDATA2MSB && in valid_elf_header() 61 eh->e_ident[EI_DATA] != ELFDATA2LSB) in valid_elf_header() 63 if (eh->e_ident[EI_VERSION] != EV_CURRENT) in valid_elf_header() 65 if (eh->e_ident[EI_OSABI] != ELFOSABI_STANDALONE) in valid_elf_header() 190 kd->nlehdr.e_ident[EI_DATA] == ELFDATA2MSB); in _powerpc64_probe() 198 kd->nlehdr.e_ident[EI_DATA] == ELFDATA2LSB); in _powerpc64le_probe()
|
H A D | kvm_powerpc.c | 58 if (eh->e_ident[EI_CLASS] != ELFCLASS32) in valid_elf_header() 60 if (eh->e_ident[EI_DATA] != ELFDATA2MSB) in valid_elf_header() 62 if (eh->e_ident[EI_VERSION] != EV_CURRENT) in valid_elf_header() 64 if (eh->e_ident[EI_OSABI] != ELFOSABI_STANDALONE) in valid_elf_header() 185 kd->nlehdr.e_ident[EI_DATA] == ELFDATA2MSB); in _powerpc_probe()
|
H A D | kvm_private.h | 137 if (kd->nlehdr.e_ident[EI_DATA] == ELFDATA2LSB) in _kvm16toh() 147 if (kd->nlehdr.e_ident[EI_DATA] == ELFDATA2LSB) in _kvm32toh() 157 if (kd->nlehdr.e_ident[EI_DATA] == ELFDATA2LSB) in _kvm64toh()
|
/freebsd/sys/kern/ |
H A D | kern_dump.c | 301 ehdr.e_ident[EI_MAG0] = ELFMAG0; in dumpsys_generic() 302 ehdr.e_ident[EI_MAG1] = ELFMAG1; in dumpsys_generic() 303 ehdr.e_ident[EI_MAG2] = ELFMAG2; in dumpsys_generic() 304 ehdr.e_ident[EI_MAG3] = ELFMAG3; in dumpsys_generic() 305 ehdr.e_ident[EI_CLASS] = ELF_CLASS; in dumpsys_generic() 307 ehdr.e_ident[EI_DATA] = ELFDATA2LSB; in dumpsys_generic() 309 ehdr.e_ident[EI_DATA] = ELFDATA2MSB; in dumpsys_generic() 311 ehdr.e_ident[EI_VERSION] = EV_CURRENT; in dumpsys_generic() 312 ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ in dumpsys_generic()
|
/freebsd/sys/dev/ksyms/ |
H A D | ksyms.c | 278 hdr->kh_ehdr.e_ident[EI_PAD] = 0; in ksyms_snapshot() 279 hdr->kh_ehdr.e_ident[EI_MAG0] = ELFMAG0; in ksyms_snapshot() 280 hdr->kh_ehdr.e_ident[EI_MAG1] = ELFMAG1; in ksyms_snapshot() 281 hdr->kh_ehdr.e_ident[EI_MAG2] = ELFMAG2; in ksyms_snapshot() 282 hdr->kh_ehdr.e_ident[EI_MAG3] = ELFMAG3; in ksyms_snapshot() 283 hdr->kh_ehdr.e_ident[EI_DATA] = ELF_DATA; in ksyms_snapshot() 284 hdr->kh_ehdr.e_ident[EI_OSABI] = ELFOSABI_FREEBSD; in ksyms_snapshot() 285 hdr->kh_ehdr.e_ident[EI_CLASS] = ELF_CLASS; in ksyms_snapshot() 286 hdr->kh_ehdr.e_ident[EI_VERSION] = EV_CURRENT; in ksyms_snapshot() 287 hdr->kh_ehdr.e_ident[EI_ABIVERSION] = 0; in ksyms_snapshot()
|
/freebsd/sys/compat/linux/ |
H A D | linux_vdso.c | 113 MPASS(ehdr->e_ident[EI_CLASS] == ELF_TARG_CLASS); in __elfN() 114 MPASS(ehdr->e_ident[EI_DATA] == ELF_TARG_DATA); in __elfN() 115 MPASS(ehdr->e_ident[EI_VERSION] == EV_CURRENT); in __elfN() 135 ehdr->e_ident[EI_OSABI] = ELFOSABI_LINUX; in __elfN()
|
/freebsd/usr.bin/elfdump/ |
H A D | elfdump.c | 96 offsetof(Elf32_Ehdr, e_ident[EI_CLASS]), 97 offsetof(Elf32_Ehdr, e_ident[EI_DATA]), 98 offsetof(Elf32_Ehdr, e_ident[EI_OSABI]), 137 offsetof(Elf32_Ehdr, e_ident[EI_CLASS]), 138 offsetof(Elf32_Ehdr, e_ident[EI_DATA]), 139 offsetof(Elf32_Ehdr, e_ident[EI_OSABI]), 1105 switch (e->e_ident[EI_CLASS]) { in elf_get_byte() 1125 switch (e->e_ident[EI_CLASS]) { in elf_get_quarter() 1128 switch (e->e_ident[EI_DATA]) { in elf_get_quarter() 1141 switch (e->e_ident[EI_DATA]) { in elf_get_quarter() [all …]
|
/freebsd/usr.bin/gcore/ |
H A D | elfcore.c | 138 switch (hdr.e_ident[EI_DATA]) { in elf_ident() 483 ehdr->e_ident[EI_MAG0] = ELFMAG0; in elf_puthdr() 484 ehdr->e_ident[EI_MAG1] = ELFMAG1; in elf_puthdr() 485 ehdr->e_ident[EI_MAG2] = ELFMAG2; in elf_puthdr() 486 ehdr->e_ident[EI_MAG3] = ELFMAG3; in elf_puthdr() 487 ehdr->e_ident[EI_CLASS] = ELF_CLASS; in elf_puthdr() 488 ehdr->e_ident[EI_DATA] = ELF_DATA; in elf_puthdr() 489 ehdr->e_ident[EI_VERSION] = EV_CURRENT; in elf_puthdr() 490 ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; in elf_puthdr() 491 ehdr->e_ident[EI_ABIVERSION] = 0; in elf_puthdr() [all …]
|
/freebsd/cddl/contrib/opensolaris/lib/libctf/common/ |
H A D | ctf_lib.c | 144 bcopy(src->e_ident, dst->e_ident, EI_NIDENT); in ehdr_to_gelf() 278 bcmp(&hdr.e32.e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) { in ctf_fdopen() 290 if (hdr.e32.e_ident[EI_DATA] != order) in ctf_fdopen() 295 if (hdr.e32.e_ident[EI_CLASS] == ELFCLASS64) { in ctf_fdopen() 308 if (hdr.e32.e_ident[EI_CLASS] == ELFCLASS32) { in ctf_fdopen() 343 if (hdr.e32.e_ident[EI_CLASS] == ELFCLASS32) { in ctf_fdopen()
|
/freebsd/cddl/contrib/opensolaris/lib/libdtrace/common/ |
H A D | dt_link.c | 488 elf_file.ehdr.e_ident[EI_MAG0] = ELFMAG0; in dump_elf32() 489 elf_file.ehdr.e_ident[EI_MAG1] = ELFMAG1; in dump_elf32() 490 elf_file.ehdr.e_ident[EI_MAG2] = ELFMAG2; in dump_elf32() 491 elf_file.ehdr.e_ident[EI_MAG3] = ELFMAG3; in dump_elf32() 492 elf_file.ehdr.e_ident[EI_VERSION] = EV_CURRENT; in dump_elf32() 493 elf_file.ehdr.e_ident[EI_CLASS] = ELFCLASS32; in dump_elf32() 495 elf_file.ehdr.e_ident[EI_DATA] = ELFDATA2MSB; in dump_elf32() 497 elf_file.ehdr.e_ident[EI_DATA] = ELFDATA2LSB; in dump_elf32() 499 elf_file.ehdr.e_ident[EI_OSABI] = ELFOSABI_FREEBSD; in dump_elf32() 642 elf_file.ehdr.e_ident[EI_MAG0] = ELFMAG0; in dump_elf64() [all …]
|
/freebsd/contrib/elftoolchain/brandelf/ |
H A D | brandelf.c | 194 argv[0], iselftype(ehdr.e_ident[EI_OSABI]), in main() 195 ehdr.e_ident[EI_OSABI]); in main() 216 ehdr.e_ident[EI_OSABI] = (unsigned char) type; in main()
|
/freebsd/cddl/contrib/opensolaris/tools/ctf/cvt/ |
H A D | util.c | 107 if (ehdr.e_ident[EI_CLASS] == ELFCLASS32) in elf_ptrsz() 109 else if (ehdr.e_ident[EI_CLASS] == ELFCLASS64) in elf_ptrsz() 112 terminate("unknown ELF class %d\n", ehdr.e_ident[EI_CLASS]); in elf_ptrsz()
|
/freebsd/contrib/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ |
H A D | ELFHeader.h | 57 unsigned char e_ident[llvm::ELF::EI_NIDENT]; ///< ELF file identification. member 86 return e_ident[llvm::ELF::EI_CLASS] == llvm::ELF::ELFCLASS32; in Is32Bit() 94 return e_ident[llvm::ELF::EI_CLASS] == llvm::ELF::ELFCLASS64; in Is64Bit()
|
H A D | ObjectFileELF.cpp | 253 uint32_t endian = header.e_ident[EI_DATA]; in mipsVariantFromElfFlags() 255 uint32_t fileclass = header.e_ident[EI_CLASS]; in mipsVariantFromElfFlags() 305 uint32_t fileclass = header.e_ident[EI_CLASS]; in riscvVariantFromElfFlags() 317 uint32_t endian = header.e_ident[EI_DATA]; in ppc64VariantFromElfFlags() 325 uint32_t fileclass = header.e_ident[EI_CLASS]; in loongarchVariantFromElfFlags() 569 eArchTypeELF, header.e_machine, sub_type, header.e_ident[EI_OSABI]); in GetModuleSpecifications() 579 OSABIAsCString(header.e_ident[EI_OSABI])); in GetModuleSpecifications() 588 GetOsFromOSABI(header.e_ident[EI_OSABI], ostype); in GetModuleSpecifications() 760 if (m_header.e_ident[EI_DATA] == ELFDATA2MSB) in GetByteOrder() 762 if (m_header.e_ident[EI_DATA] == ELFDATA2LSB) in GetByteOrder() [all …]
|
H A D | ELFHeader.cpp | 74 if (e_ident[EI_DATA] == ELFDATA2MSB) in GetByteOrder() 76 if (e_ident[EI_DATA] == ELFDATA2LSB) in GetByteOrder() 117 if (data.GetU8(offset, &e_ident, EI_NIDENT) == nullptr) in Parse()
|
/freebsd/contrib/llvm-project/llvm/lib/InterfaceStub/ |
H A D | ELFObjHandler.cpp | 55 ElfHeader.e_ident[EI_MAG0] = ElfMagic[EI_MAG0]; in initELFHeader() 56 ElfHeader.e_ident[EI_MAG1] = ElfMagic[EI_MAG1]; in initELFHeader() 57 ElfHeader.e_ident[EI_MAG2] = ElfMagic[EI_MAG2]; in initELFHeader() 58 ElfHeader.e_ident[EI_MAG3] = ElfMagic[EI_MAG3]; in initELFHeader() 59 ElfHeader.e_ident[EI_CLASS] = ELFT::Is64Bits ? ELFCLASS64 : ELFCLASS32; in initELFHeader() 61 ElfHeader.e_ident[EI_DATA] = IsLittleEndian ? ELFDATA2LSB : ELFDATA2MSB; in initELFHeader() 62 ElfHeader.e_ident[EI_VERSION] = EV_CURRENT; in initELFHeader() 63 ElfHeader.e_ident[EI_OSABI] = ELFOSABI_NONE; in initELFHeader() 605 convertELFBitWidthToIFS(ElfFile.getHeader().e_ident[EI_CLASS]); in buildStub() 607 convertELFEndiannessToIFS(ElfFile.getHeader().e_ident[EI_DATA]); in buildStub()
|
/freebsd/lib/libc/gen/ |
H A D | nlist.c | 108 ehdr->e_ident[EI_CLASS] == ELF_TARG_CLASS && in __elf_is_okay__() 109 ehdr->e_ident[EI_DATA] == ELF_TARG_DATA && in __elf_is_okay__() 110 ehdr->e_ident[EI_VERSION] == ELF_TARG_VER) { in __elf_is_okay__()
|
/freebsd/contrib/llvm-project/llvm/include/llvm/BinaryFormat/ |
H A D | ELF.h | 63 unsigned char e_ident[EI_NIDENT]; // ELF Identification bytes member 79 return (memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0; in checkMagic() 82 unsigned char getFileClass() const { return e_ident[EI_CLASS]; } in getFileClass() 83 unsigned char getDataEncoding() const { return e_ident[EI_DATA]; } in getDataEncoding() 89 unsigned char e_ident[EI_NIDENT]; member 105 return (memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0; in checkMagic() 108 unsigned char getFileClass() const { return e_ident[EI_CLASS]; } in getFileClass() 109 unsigned char getDataEncoding() const { return e_ident[EI_DATA]; } in getDataEncoding()
|
/freebsd/usr.bin/ldd/ |
H A D | ldd.c | 295 if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { in has_freebsd_abi_tag() 369 if (gelf_xlatetom(elf, &dst, &src, ehdr->e_ident[EI_DATA]) == NULL) { in is_pie() 431 freebsd = ehdr.e_ident[EI_OSABI] == ELFOSABI_FREEBSD; in is_executable() 440 if (ehdr.e_ident[EI_OSABI] == ELFOSABI_NONE && !freebsd) in is_executable()
|
/freebsd/lib/libkldelf/ |
H A D | elf.c | 57 if (hdr->e_ident[EI_CLASS] == (*erd)->class && in elf_find_reloc() 58 hdr->e_ident[EI_DATA] == (*erd)->data && in elf_find_reloc() 145 if (efile->ef_hdr.e_ident[EI_CLASS] != hdr->e_ident[EI_CLASS] || in elf_compatible() 146 efile->ef_hdr.e_ident[EI_DATA] != hdr->e_ident[EI_DATA] || in elf_compatible()
|
/freebsd/contrib/elftoolchain/elfcopy/ |
H A D | binary.c | 180 oeh.e_ident[EI_CLASS] = ecp->oec; in create_elf_from_binary() 181 oeh.e_ident[EI_DATA] = ecp->oed; in create_elf_from_binary() 186 oeh.e_ident[EI_OSABI] = ELFOSABI_NONE; in create_elf_from_binary()
|
H A D | main.c | 301 ecp->oed = ieh.e_ident[EI_DATA]; in create_elf() 310 memcpy(oeh.e_ident, ieh.e_ident, sizeof(ieh.e_ident)); in create_elf() 311 oeh.e_ident[EI_CLASS] = ecp->oec; in create_elf() 312 oeh.e_ident[EI_DATA] = ecp->oed; in create_elf() 314 oeh.e_ident[EI_OSABI] = ecp->abi; in create_elf() 416 if (oeh.e_ident[EI_OSABI] == ELFOSABI_FREEBSD) in create_elf()
|