Main Page   Modules   Data Structures   File List   Data Fields   Examples  

Note
[Section Headers]


Functions

ELF_SPEC_HEADERmelf_noteCreate (MELF *melf, const char *name, unsigned long createProgramHeader)
void melf_noteInitializeEntryList (MELF *melf, ELF_SPEC_HEADER *sect)
void melf_noteSynchronizeEntryList (MELF *melf, ELF_SPEC_HEADER *sect)
Elf32_Nhdr * melf_noteAdd (MELF *melf, ELF_SPEC_HEADER *note, Elf32_Word type, const char *name, unsigned char *desc, unsigned long descLength)
Elf32_Nhdr * melf_noteEnum (MELF *melf, ELF_SPEC_HEADER *note, unsigned long index)
unsigned long melf_noteRemove (MELF *melf, ELF_SPEC_HEADER *note, Elf32_Nhdr *item)
unsigned long melf_noteGetType (MELF *melf, ELF_SPEC_HEADER *note, Elf32_Nhdr *item)
const char * melf_noteGetName (MELF *melf, ELF_SPEC_HEADER *note, Elf32_Nhdr *item)
unsigned char * melf_noteGetDesc (MELF *melf, ELF_SPEC_HEADER *note, Elf32_Nhdr *item)

Function Documentation

Elf32_Nhdr* melf_noteAdd MELF   melf,
ELF_SPEC_HEADER   note,
Elf32_Word    type,
const char *    name,
unsigned char *    desc,
unsigned long    descLength
 

Adds an entry to the note section.

type can be one of the following for object files:

  • NT_VERSION Contains a version string.
type can be one of the following for core files:

  • NT_PRSTATUS Contains a copy of prstatus struct.
  • NT_FPREGSET Contains copy of fpregset struct.
  • NT_PRPSINFO Contains copy of prpsinfo struct.
  • NT_PRXREG Contains copy of prxregset struct.
  • NT_PLATFORM String from sysinfo(SI_PLATFORM).
  • NT_AUXV Contains copy of auxv array.
  • NT_GWINDOWS Contains copy of gwindows struct.
  • NT_PSTATUS Contains copy of pstatus struct.
  • NT_PSINFO Contains copy of psinfo struct.
  • NT_PRCRED Contains copy of prcred struct.
  • NT_UTSNAME Contains copy of utsname struct.
  • NT_LWPSTATUS Contains copy of lwpstatus struct.
  • NT_LWPSINFO Contains copy of lwpinfo struct.
  • NT_PRFPXREG Contains copy of fprxregset struct
Parameters:
melf  [in] The melf context.
note  [in] The note section to operate on.
type  [in] The type of note.
name  [in] The name associated with the type.
desc  [in] The desc associated with the type.
descLength  [in] The length of the desc.
Examples:
new.c.

ELF_SPEC_HEADER* melf_noteCreate MELF   melf,
const char *    name,
unsigned long    createProgramHeader
 

Creates a note section with the provided name, optionally creating a program header for the note section.

Parameters:
melf  [in] The melf context.
name  [in] The name of the section. This can be NULL.
createProgramHeader  [in] 1 if a PT_NOTE program header is to be made, 0 if not.
Returns:
On success, an initialized note section header is returned. Otherwise, NULL is returned.
Examples:
new.c.

Elf32_Nhdr* melf_noteEnum MELF   melf,
ELF_SPEC_HEADER   note,
unsigned long    index
 

Enumerates the note entries at a given index. Indexes start at 0.

Parameters:
melf  [in] The melf context.
note  [in] The note section to operate on.
index  [in] The index to enumerate at.
Returns:
If the index is valid, a valid pointer to a note entry is returned. Otherwise, NULL is returned.

unsigned char* melf_noteGetDesc MELF   melf,
ELF_SPEC_HEADER   note,
Elf32_Nhdr *    item
 

Parameters:
melf  [in] The melf context.
note  [in] The note section to operate on.
item  [in] The entry to get the desc of.
Returns:
The desc.

const char* melf_noteGetName MELF   melf,
ELF_SPEC_HEADER   note,
Elf32_Nhdr *    item
 

Parameters:
melf  [in] The melf context.
note  [in] The note section to operate on.
item  [in] The entry to get the name of.
Returns:
The name.

unsigned long melf_noteGetType MELF   melf,
ELF_SPEC_HEADER   note,
Elf32_Nhdr *    item
 

Gets the type associated with a given note entry.

Parameters:
melf  [in] The melf context.
note  [in] The note section to operate on.
item  [in] The entry to get the type of.
Returns:
The type.

void melf_noteInitializeEntryList MELF   melf,
ELF_SPEC_HEADER   sect
 

Initializes the entry list for the given section. It is not recommended that this function be called directly.

Parameters:
melf  [in] The melf context.
sect  [in] The section that is being operated on.

unsigned long melf_noteRemove MELF   melf,
ELF_SPEC_HEADER   note,
Elf32_Nhdr *    item
 

Removes a note entry.

Parameters:
melf  [in] The melf context.
note  [in] The note section to operate on.
item  [in] The entry to remove.
Returns:
1 on success.

void melf_noteSynchronizeEntryList MELF   melf,
ELF_SPEC_HEADER   sect
 

Synchronizes the entry list for the given section. It is not recommended that this function be called directly.

Parameters:
melf  [in] The melf context.
sect  [in] The section that is being operated on.


Generated on Tue May 4 00:14:34 2004 for libmelf by doxygen1.2.15