Main Page   Modules   Data Structures   File List   Data Fields   Examples  

Dynamic
[Section Headers]


Functions

ELF_SPEC_HEADERmelf_dynamicCreate (MELF *melf)
void melf_dynamicInitializeEntryList (MELF *melf, ELF_SPEC_HEADER *sect)
void melf_dynamicSynchronizeEntryList (MELF *melf, ELF_SPEC_HEADER *sect)
Elf32_Dyn * melf_dynamicAddTag (MELF *melf, ELF_SPEC_HEADER *dynamic, Elf32_Sword tag, Elf32_Word val)
unsigned long melf_dynamicRemoveTag (MELF *melf, ELF_SPEC_HEADER *dynamic, Elf32_Sword tag)
unsigned long melf_dynamicRemoveIndex (MELF *melf, ELF_SPEC_HEADER *dynamic, unsigned long index)
Elf32_Dyn * melf_dynamicGetTag (MELF *melf, ELF_SPEC_HEADER *dynamic, Elf32_Sword tag)
Elf32_Dyn * melf_dynamicGetIndex (MELF *melf, ELF_SPEC_HEADER *dynamic, unsigned long index)
unsigned long melf_dynamicSetTag (MELF *melf, ELF_SPEC_HEADER *dynamic, Elf32_Sword tag, Elf32_Word val)
unsigned long melf_dynamicSetIndex (MELF *melf, ELF_SPEC_HEADER *dynamic, unsigned long index, Elf32_Word val)

Function Documentation

Elf32_Dyn* melf_dynamicAddTag MELF   melf,
ELF_SPEC_HEADER   dynamic,
Elf32_Sword    tag,
Elf32_Word    val
 

Adds a tag to the dynamic section.

tag can be one of the following:

  • DT_NULL Blank entry.
  • DT_NEEDED Name of a required dynamic library.
  • DT_PLTRELSZ Size in bytes of the PLT relocs.
  • DT_PLTGOT Processor defined value.
  • DT_HASH Address of the symbol table hash.
  • DT_STRTAB Address of the string table.
  • DT_SYMTAB Address of the symbol table.
  • DT_RELA Address of the rela relocs.
  • DT_RELASZ Size of the rela relocs.
  • DT_RELAENT Size of a rela entry.
  • DT_STRSZ Size of the sring table.
  • DT_SYMENT Size of a symbol entry.
  • DT_INIT Address of init function.
  • DT_FINI Address of fini function.
  • DT_SONAME Name of shared object.
  • DT_REL Address of the rel relocs.
  • DT_RELSZ Size of the rel relocs.
  • DT_RELENT Size of a rel entry.
  • DT_PLTREL Type of reloc in PLT.
  • DT_TEXTREL Reloc might modify .text.
  • DT_JMPREL Address of PLT relocs.
  • DT_RUNPATH Library search path.
  • DT_FLAGS Flags for object being loaded.
  • DT_ENCODING Start of encoding range.
There are a few more tags that are not specified here.
Parameters:
melf  [in] The melf context.
dynamic  [in] The dynamic section to operate on.
tag  [in] The tag to set.
val  [in] The arbitrary value associated with the tag.
Returns:
On succes, a new dynamic entry structure is returned. Otherwise, NULL is returned.
Examples:
new.c.

ELF_SPEC_HEADER* melf_dynamicCreate MELF   melf
 

Creates and initialize a dynamic section header.

Parameters:
melf  [in] The melf context.
Returns:
On success, an initialized dynamic section header is returned. Otherwise, NULL is returned.
Examples:
new.c.

Elf32_Dyn* melf_dynamicGetIndex MELF   melf,
ELF_SPEC_HEADER   dynamic,
unsigned long    index
 

Gets the dynamic entry at a given index. Indexes start at 0.

Parameters:
melf  [in] The melf context.
dynamic  [in] The dynamic section to operate on.
index  [in] The index to get the dynamic entry of.
Returns:
A valid pointer to a dynamic entry if the index is valid, otherwise NULL.

Elf32_Dyn* melf_dynamicGetTag MELF   melf,
ELF_SPEC_HEADER   dynamic,
Elf32_Sword    tag
 

Gets the first instance of a specified tag.

Parameters:
melf  [in] The melf context.
dynamic  [in] The dynamic section to operate on.
tag  [in] The tag to get.
Returns:
If an instance of the given tag is found a valid pointer is returned. Otherwise, NULL is returned.

void melf_dynamicInitializeEntryList 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_dynamicRemoveIndex MELF   melf,
ELF_SPEC_HEADER   dynamic,
unsigned long    index
 

Removes an entry at a specific index. Indexes start at 0.

Parameters:
melf  [in] The melf context.
dynamic  [in] The dynamic section to operate on.
index  [in] The index to remove.
Returns:
1 if successful.

unsigned long melf_dynamicRemoveTag MELF   melf,
ELF_SPEC_HEADER   dynamic,
Elf32_Sword    tag
 

Removes all instances of a specified tag.

Parameters:
melf  [in] The melf context.
dynamic  [in] The dynamic section to operate on.
tag  [in] The tag to remove.
Returns:
The number of instances removed.

unsigned long melf_dynamicSetIndex MELF   melf,
ELF_SPEC_HEADER   dynamic,
unsigned long    index,
Elf32_Word    val
 

Sets the value of an entry at a specified index.

Parameters:
melf  [in] The melf context.
dynamic  [in] The dynamic section to operate on.
index  [in] The index to operate on.
val  [in] The arbitrary value.
Returns:
1 on success.

unsigned long melf_dynamicSetTag MELF   melf,
ELF_SPEC_HEADER   dynamic,
Elf32_Sword    tag,
Elf32_Word    val
 

Attempts to update a given tag if one exists, otherwise a new one is added.

Parameters:
melf  [in] The melf context.
dynamic  [in] The dynamic section to operate on.
tag  [in] The tag to set.
val  [in] The arbitrary value of a given tag.
Returns:
1 on success.

void melf_dynamicSynchronizeEntryList 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