Linux and UNIX Man Pages

Test Your Knowledge in Computers #152
Difficulty: Easy
In 1995, Novell transferred the Unix trademarks to the ACME Computing Company.
True or False?
Linux & Unix Commands - Search Man Pages

elf_kind(3elf) [opensolaris man page]

elf_kind(3ELF)						       ELF Library Functions						    elf_kind(3ELF)

NAME
elf_kind - determine file type SYNOPSIS
cc [ flag ... ] file ... -lelf [ library ... ] #include <libelf.h> Elf_Kind elf_kind(Elf *elf); DESCRIPTION
This function returns a value identifying the kind of file associated with an ELF descriptor (elf). Defined values are below: ELF_K_AR The file is an archive [see ar.h(3HEAD)]. An ELF descriptor may also be associated with an archive member, not the archive itself, and then elf_kind() identifies the member's type. ELF_K_COFF The file is a COFF object file. elf_begin(3ELF) describes the library's handling for COFF files. ELF_K_ELF The file is an ELF file. The program may use elf_getident() to determine the class. Other functions, such as elf32_getehdr(), are available to retrieve other file information. ELF_K_NONE This indicates a kind of file unknown to the library. Other values are reserved, to be assigned as needed to new kinds of files. elf should be a value previously returned by elf_begin(). A null pointer is allowed, to simplify error handling, and causes elf_kind() to return ELF_K_NONE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
ar.h(3HEAD), elf(3ELF), elf32_getehdr(3ELF), elf_begin(3ELF), elf_getident(3ELF), libelf(3LIB), attributes(5) SunOS 5.11 11 Jul 2001 elf_kind(3ELF)

Check Out this Related Man Page

elf32_getehdr(3ELF)					       ELF Library Functions					       elf32_getehdr(3ELF)

NAME
elf32_getehdr, elf32_newehdr, elf64_getehdr, elf64_newehdr - retrieve class-dependent object file header SYNOPSIS
cc [ flag ... ] file ... -lelf [ library ... ] #include <libelf.h> Elf32_Ehdr *elf32_getehdr(Elf *elf); Elf32_Ehdr *elf32_newehdr(Elf *elf); Elf64_Ehdr *elf64_getehdr(Elf *elf); Elf64_Ehdr *elf64_newehdr(Elf *elf); DESCRIPTION
For a 32-bit class file, elf32_getehdr() returns a pointer to an ELF header, if one is available for the ELF descriptor elf. If no header exists for the descriptor, elf32_newehdr() allocates a clean one, but it otherwise behaves the same as elf32_getehdr(). It does not allo- cate a new header if one exists already. If no header exists for elf32_getehdr(), one cannot be created for elf32_newehdr(), a system error occurs, the file is not a 32-bit class file, or elf is NULL, both functions return a null pointer. For the 64-bit class, replace 32 with 64 as appropriate. The header includes the following members: unsigned char e_ident[EI_NIDENT]; Elf32_Half e_type; Elf32_Half e_machine; Elf32_Word e_version; Elf32_Addr e_entry; 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; The elf32_newehdr() function automatically sets the ELF_F_DIRTY bit. See elf_flagdata(3ELF). An application can use elf_getident() to inspect the identification bytes from a file. An application can use elf_getshnum() and elf_getshstrndx() to obtain section header information. The location of this section header information differs between standard ELF files to those that require Extended Sections. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
elf(3ELF), elf_begin(3ELF), elf_flagdata(3ELF), elf_getident(3ELF), elf_getshnum(3ELF), elf_getshstrndx(3ELF), libelf(3LIB), attributes(5) SunOS 5.11 19 Jun 2002 elf32_getehdr(3ELF)

Featured Tech Videos