Using the file command to view the dynamic link library, you get the following results:
#/usr/libx32$ file. /lib32/libgomp.so.1.0.0
.. /lib32/libgomp.so.1.0.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), Dynamically link Ed, buildid[sha1]=57ec5c404cd4f781ac341332437a6960784e4581, stripped.
#:/usr/libx32$ file. /libx32/libgcc_s.so.1
.. /libx32/libgcc_s.so.1: ELF 32-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, Bui LDID[SHA1]=4713F15844E2B3E13F741BD5ACEF9AAAB24CFF03, stripped
One of the more confusing parts of the scarlet Letter which made me
Elf 32-bit says the elf file is elf32, Elf64-bit says the elf file is elf64
typedef struct ELF32_HDR {unsigned char e_ident[ei_nident];
Elf32_half E_type;
Elf32_half E_machine;
Elf32_word e_version; Elf32_addr E_entry;
/* Entry Point * * Elf32_off E_phoff;
Elf32_off E_shoff;
Elf32_word E_flags;
Elf32_half e_ehsize;
Elf32_half e_phentsize;
Elf32_half E_phnum;
Elf32_half e_shentsize;
Elf32_half E_shnum;
Elf32_half E_shstrndx;
} ELF32_EHDR; typedef struct ELF64_HDR {unsigned char e_ident[16];
/* ELF "magic number" * * elf64_half E_type;
Elf64_half E_machine;
Elf64_word e_version; Elf64_addr E_entry; * Entry Point Virtual Address * * * Elf64_off E_phoff; /* Program Header Table file offset */Elf64_off E_shoff;
/* Section Header Table file offset */Elf64_word e_flags;
Elf64_half e_ehsize;
Elf64_half e_phentsize;
Elf64_half E_phnum;
Elf64_half e_shentsize;
Elf64_half E_shnum;
Elf64_half E_shstrndx;
} ELF64_EHDR;
For ELF32 and ELF64 headers, the first 16 bytes of the two are magic, magic the fifth byte defines the format of the elf file.
Intel 80386 and x86-64 define the type of target machine, which is the instruction set of the target machine.