libdwarf
Functions
Section Groups Objectfile Data

Functions

int dwarf_sec_group_sizes (Dwarf_Debug dw_dbg, Dwarf_Unsigned *dw_section_count_out, Dwarf_Unsigned *dw_group_count_out, Dwarf_Unsigned *dw_selected_group_out, Dwarf_Unsigned *dw_map_entry_count_out, Dwarf_Error *dw_error)
 Get Section Groups data counts. More...
 
int dwarf_sec_group_map (Dwarf_Debug dw_dbg, Dwarf_Unsigned dw_map_entry_count, Dwarf_Unsigned *dw_group_numbers_array, Dwarf_Unsigned *dw_sec_numbers_array, const char **dw_sec_names_array, Dwarf_Error *dw_error)
 Return a map between group numbers and section numbers. More...
 

Detailed Description

Section Groups are defined in the extended Elf ABI and are seen in relocatable Elf object files, not executables or shared objects.

Section Groups Overview

Function Documentation

◆ dwarf_sec_group_sizes()

int dwarf_sec_group_sizes ( Dwarf_Debug  dw_dbg,
Dwarf_Unsigned dw_section_count_out,
Dwarf_Unsigned dw_group_count_out,
Dwarf_Unsigned dw_selected_group_out,
Dwarf_Unsigned dw_map_entry_count_out,
Dwarf_Error dw_error 
)

Allows callers to find out what groups (dwo or COMDAT) are in the object and how much to allocate so one can get the group-section map data.

This is relevant for Debug Fission. If an object file has both .dwo sections and non-dwo sections or it has Elf COMDAT GROUP sections this becomes important.

Section Groups Overview

Parameters
dw_dbgPass in the Dwarf_Debug of interest.
dw_section_count_outOn success returns the number of DWARF sections in the object file. Can sometimes be many more than are of interest.
dw_group_count_outOn success returns the number of groups. Though usually one, it can be much larger.
dw_selected_group_outOn success returns the groupnumber that applies to this specific open Dwarf_Debug.
dw_map_entry_count_outOn success returns the count of record allocations needed to call dwarf_sec_group_map successfully. dw_map_entry_count_out will be less than or equal to dw_section_count_out.
dw_errorThe usual error details pointer.
Returns
On success returns DW_DLV_OK

◆ dwarf_sec_group_map()

int dwarf_sec_group_map ( Dwarf_Debug  dw_dbg,
Dwarf_Unsigned  dw_map_entry_count,
Dwarf_Unsigned dw_group_numbers_array,
Dwarf_Unsigned dw_sec_numbers_array,
const char **  dw_sec_names_array,
Dwarf_Error dw_error 
)

This map shows all the groups in the object file and shows which object sections go with which group.

Parameters
dw_dbgThe Dwarf_Debug of interest.
dw_map_entry_countPass in the dw_map_entry_count_out from dwarf_sec_group_sizes
dw_group_numbers_arrayPass in an array of Dwarf_Unsigned with dw_map_entry_count entries. Zero the data before the call here. On success returns a list of group numbers.
dw_sec_numbers_arrayPass in an array of Dwarf_Unsigned with dw_map_entry_count entries. Zero the data before the call here. On success returns a list of section numbers.
dw_sec_names_arrayPass in an array of const char * with dw_map_entry_count entries. Zero the data before the call here. On success returns a list of section names.
dw_errorThe usual error details pointer.
Returns
On success returns DW_DLV_OK