libdwarf: Section Groups Objectfile Data

libdwarf

Loading...
Searching...
No Matches
Functions
Section Groups Objectfile Data

## Functions
DW_API 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.
DW_API 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.

## 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_map()

DW_API 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.

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

Parameters

  dw_dbg | The Dwarf_Debug of interest.
  dw_map_entry_count | Pass in the dw_map_entry_count_out from dwarf_sec_group_sizes
  dw_group_numbers_array | Pass 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_array | Pass 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_array | Pass 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_error | The usual error details pointer.

Returns
  On success returns DW_DLV_OK

## ◆ dwarf_sec_group_sizes()

DW_API 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.

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_dbg | Pass in the Dwarf_Debug of interest.
  dw_section_count_out | On success returns the number of DWARF sections in the object file. Can sometimes be many more than are of interest.
  dw_group_count_out | On success returns the number of groups. Though usually one, it can be much larger.
  dw_selected_group_out | On success returns the groupnumber that applies to this specific open Dwarf_Debug.
  dw_map_entry_count_out | On 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_error | The usual error details pointer.

Returns
  On success returns DW_DLV_OK