---
name: "dwarf_get_section_max_offsets"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/dwarf_get_section_max_offsets"
---

# dwarf\_get\_section\_max\_offsets(3)

return the size of DWARF sections

## NAME

**dwarf\_get\_section\_max\_offsets**, **dwarf\_get\_section\_max\_offsets\_b** – return the size of DWARF sections

## LIBRARY

library “libdwarf”

## SYNOPSIS

**#include \<libdwarf.h\>**

*int*\

**dwarf\_get\_section\_max\_offsets**(*Dwarf\_Debug dbg*, *Dwarf\_Unsigned \*debug\_info*, *Dwarf\_Unsigned \*debug\_abbrev*, *Dwarf\_Unsigned \*debug\_line*, *Dwarf\_Unsigned \*debug\_loc*, *Dwarf\_Unsigned \*debug\_aranges*, *Dwarf\_Unsigned \*debug\_macinfo*, *Dwarf\_Unsigned \*debug\_pubnames*, *Dwarf\_Unsigned \*debug\_str*, *Dwarf\_Unsigned \*debug\_frame*, *Dwarf\_Unsigned \*debug\_ranges*, *Dwarf\_Unsigned \*debug\_pubtypes*);

*int*\

**dwarf\_get\_section\_max\_offsets\_b**(*Dwarf\_Debug dbg*, *Dwarf\_Unsigned \*debug\_info*, *Dwarf\_Unsigned \*debug\_abbrev*, *Dwarf\_Unsigned \*debug\_line*, *Dwarf\_Unsigned \*debug\_loc*, *Dwarf\_Unsigned \*debug\_aranges*, *Dwarf\_Unsigned \*debug\_macinfo*, *Dwarf\_Unsigned \*debug\_pubnames*, *Dwarf\_Unsigned \*debug\_str*, *Dwarf\_Unsigned \*debug\_frame*, *Dwarf\_Unsigned \*debug\_ranges*, *Dwarf\_Unsigned \*debug\_pubtypes*, *Dwarf\_Unsigned \*debug\_types*);

## DESCRIPTION

Function **dwarf\_get\_section\_max\_offsets\_b**() retrieves the sizes of the DWARF sections in a DWARF debug context. Argument *dbg* should reference a DWARF debug context allocated using [dwarf\_init(3)](/dwarf_init/3.md). The function stores the size of each DWARF section to the location pointed to by the argument corresponding to the section name. If a DWARF section does not exist, the location pointed to by the argument corresponding to that section will be set to zero.

A value of NULL may be used for any of the arguments *debug\_info*, *debug\_abbrev*, *debug\_line*, *debug\_loc*, *debug\_aranges*, *debug\_macinfo*, *debug\_pubnames*, *debug\_str*, *debug\_frame*, *debug\_ranges*, *debug\_pubtypes* and *debug\_types* if the caller is not interested in the respective section size.

Function **dwarf\_get\_section\_max\_offsets**() is identical to function **dwarf\_get\_section\_max\_offsets\_b**() except that it does not provide argument *debug\_types*, and thus cannot return the size of the “.debug\_types” section.

## RETURN VALUES

On success, these functions return DW\_DLV\_OK. If argument *dbg* is NULL, they return DW\_DLV\_ERROR.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_init(3)](/dwarf_init/3.md)
