*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> libelf/elf_getident (3)              
Title
Content
Arch
Section
 

Contents


ELF_GETIDENT(3E)					      ELF_GETIDENT(3E)


NAME    [Toc]    [Back]

     elf_getident - retrieve file identification data

SYNOPSIS    [Toc]    [Back]

     cc	[flag ...] file	...  -lelf [library ...]

     #include <libelf.h>

     char *elf_getident(Elf *elf, size_t *ptr);

DESCRIPTION    [Toc]    [Back]

     As	elf(3E)	explains, ELF provides a framework for various classes of
     files, where basic	objects	may have 32 bits, 64 bits, etc.	 To
     accommodate these differences, without forcing the	larger sizes on
     smaller machines, the initial bytes in an ELF file	hold identification
     information common	to all file classes.  Every ELF	header's e_ident has
     EI_NIDENT bytes with the following	interpretation.

		e_ident	Index	   Value	     Purpose
		__________________________________________________
		EI_MAG0	      |	ELFMAG0	     |
		EI_MAG1	      |	ELFMAG1	     |
		EI_MAG2	      |	ELFMAG2	     | File identification
		EI_MAG3	      |	ELFMAG3	     |
			      |		     |
		______________|______________|____________________
			      |	ELFCLASSNONE |
		EI_CLASS      |	ELFCLASS32   | File class
			      |	ELFCLASS64   |
		______________|______________|____________________
			      |	ELFDATANONE  |
		EI_DATA	      |	ELFDATA2LSB  | Data encoding
			      |	ELFDATA2MSB  |
		______________|______________|____________________
		EI_VERSION    |	EV_CURRENT   | File version
		______________|______________|____________________
		7-15	      |	0	     | Unused, set to zero
		______________|______________|____________________

     Other kinds of files [see elf_kind(3E)] also may have identification
     data, though they would not conform to e_ident.

     elf_getident returns a pointer to the file's ``initial bytes.''  If the
     library recognizes	the file, a conversion from the	file image to the
     memory image may occur.  In any case, the identification bytes are
     guaranteed	not to have been modified, though the size of the unmodified
     area depends on the file type.  If	ptr is non-null, the library stores
     the number	of identification bytes	in the location	to which ptr points.
     If	no data	are present, elf is null, or an	error occurs, the return value
     is	a null pointer,	with zero optionally stored through ptr.





									Page 1






ELF_GETIDENT(3E)					      ELF_GETIDENT(3E)


SEE ALSO    [Toc]    [Back]

      
      
     elf(3E), elf_begin(3E), elf_getehdr(3E), elf_kind(3E), elf_rawfile(3E).


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
issue Tru64 Issue identification file
issue HP-UX issue identification file
sys_id IRIX system identification (hostname) file
issue.net Linux identification file for telnet sessions
issue.net Tru64 Network issue identification file
issue Linux pre-login message and identification file
SSL_get_session Tru64 Retrieve TLS/SSL session data
SSL_get_session NetBSD retrieve TLS/SSL session data
SSL_get0_session OpenBSD retrieve TLS/SSL session data
SSL_get_session OpenBSD retrieve TLS/SSL session data
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service