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

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

Contents


ELF_GETEHDR(3E)						       ELF_GETEHDR(3E)


NAME    [Toc]    [Back]

     elf_getehdr: elf32_getehdr, elf32_newehdr,	elf64_getehdr, elf64_newehdr -
     retrieve class-dependent object file header

SYNOPSIS    [Toc]    [Back]

     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    [Toc]    [Back]

     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 allocate a
     new header	if one exists already.	If no header exists (for elf_getehdr),
     one cannot	be created (for	elf_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 64-bit	class files, the 64 version is applicable instead of the 32
     version of	the functions.

     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;

     For 64-bit	class files, the following is applicable.









									Page 1






ELF_GETEHDR(3E)						       ELF_GETEHDR(3E)



		  unsigned char	  e_ident[EI_NIDENT];
		  Elf64_Half	  e_type;
		  Elf64_Half	  e_machine;
		  Elf64_Word	  e_version;
		  Elf64_Addr	  e_entry;
		  Elf64_Off	  e_phoff;
		  Elf64_Off	  e_shoff;
		  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;

     elf32_newehdr automatically sets the ELF_F_DIRTY bit [see elf_flag(3E)].
     A program may use elf_getident to inspect the identification bytes	from a
     file.

     The 64-bit	class works identically, simply	replacing all instances	of 32
     in	the description	with 64.

SEE ALSO    [Toc]    [Back]

      
      
     elf(3E), elf_begin(3E), elf_flag(3E), elf_getident(3E).


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
elf_getshdr IRIX retrieve class-dependent section header
elf_getphdr IRIX retrieve class-dependent program header table
ldohseek IRIX seek to the optional file header of a common object file
ldohseek Tru64 seek to the optional file header of a common object file
ldfhread IRIX read the file header of a common object file
ldfhread Tru64 read the file header of a common object file
ldshread IRIX read an indexed/named section header of a common object file
ldnshread Tru64 read an indexed/named section header of a common object file
ldshread Tru64 read an indexed/named section header of a common object file
tt_spec_file HP-UX retrieve the name of the file that contains the object described by the spec
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service