libdwarf
|
#include <libdwarf.h>
Data Fields | |
int(* | om_get_section_info )(void *obj, Dwarf_Unsigned section_index, Dwarf_Obj_Access_Section_a *return_section, int *error) |
Dwarf_Small(* | om_get_byte_order )(void *obj) |
Dwarf_Small(* | om_get_length_size )(void *obj) |
Dwarf_Small(* | om_get_pointer_size )(void *obj) |
Dwarf_Unsigned(* | om_get_filesize )(void *obj) |
Dwarf_Unsigned(* | om_get_section_count )(void *obj) |
int(* | om_load_section )(void *obj, Dwarf_Unsigned dw_section_index, Dwarf_Small **dw_return_data, int *dw_error) |
int(* | om_relocate_a_section )(void *obj, Dwarf_Unsigned section_index, Dwarf_Debug dbg, int *error) |
int(* | om_load_section_a )(void *obj, Dwarf_Unsigned dw_section_index, enum Dwarf_Sec_Alloc_Pref *dw_alloc_pref, Dwarf_Small **dw_return_data_ptr, Dwarf_Unsigned *dw_return_data_len, Dwarf_Small **dw_return_mmap_base_ptr, Dwarf_Unsigned *dw_return_mmap_offset, Dwarf_Unsigned *dw_return_mmap_len, int *dw_error) |
void(* | om_finish )(void *obj) |
The functions we need to access object data from libdwarf are declared here.
Unless you are reading object sections with your own code (as in src/bin/dwarfexample/jitreader.c) you will not need to fill in or use the struct.
om_relocate_a_section uses malloc/read to get section contents and returns a pointer to the malloc space through dw_return_data, which is recorded in the applicable section data.
om_load_section_a uses either malloc/read or mmap and consequently returns more data as needed for eventual free() or munmap().