---
name: "dwarf_get_relocation_info_count"
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_relocation_info_count"
---

# dwarf\_get\_relocation\_info\_count(3)

return the number of relocation arrays

## NAME

**dwarf\_get\_relocation\_info\_count** – return the number of relocation arrays

## LIBRARY

library “libdwarf”

## SYNOPSIS

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

*int*\

**dwarf\_get\_relocation\_info\_count**(*Dwarf\_P\_Debug dbg*, *Dwarf\_Unsigned \*reloc\_cnt*, *int \*drd\_buffer\_version*, *Dwarf\_Error \*err*);

## DESCRIPTION

Function **dwarf\_get\_relocation\_info\_count**() retrieves the total number of relocation arrays generated by a prior call to [dwarf\_transform\_to\_disk\_form(3)](/dwarf_transform_to_disk_form/3.md).

Argument *dbg* should reference a DWARF producer instance allocated using [dwarf\_producer\_init(3)](/dwarf_producer_init/3.md) or [dwarf\_producer\_init\_b(3)](/dwarf_producer_init_b/3.md). The DW\_DLC\_SYMBOLIC\_RELOCATIONS flag should have been set on the producer instance.

Argument *reloc\_cnt* should point to a location which will be set to the total number of relocation arrays generated.

Argument *drd\_buffer\_version* should point to a location which will be set to the version number of the relocation structures returned (see the symbol DWARF\_DRD\_BUFFER\_VERSION, defined in the header file ⟨libdwarf.h⟩).

If argument *err* is not NULL, it will be used to store error information in case of an error.

## RETURN VALUES

On success, function **dwarf\_get\_relocation\_info\_count**() returns DW\_DLV\_OK. It returns DW\_DLV\_NO\_ENTRY if the DW\_DLC\_SYMBOLIC\_RELOCATIONS flag is not set on the producer instance. In case of an error, function **dwarf\_get\_relocation\_info\_count**() returns DW\_DLV\_ERROR and sets the argument *err*.

## ERRORS

Function **dwarf\_get\_relocation\_info\_count**() can fail with:

- \[DW\_DLE\_ARGUMENT\]

  One of the arguments *dbg*, *reloc\_cnt* or *drd\_buffer\_version* was NULL.

- \[DW\_DLE\_NO\_ENTRY\]

  The DW\_DLC\_SYMBOLIC\_RELOCATIONS flag was not set.

## SEE ALSO

[dwarf(3)](/dwarf/3.md), [dwarf\_get\_relocation\_info(3)](/dwarf_get_relocation_info/3.md), [dwarf\_producer\_init(3)](/dwarf_producer_init/3.md), [dwarf\_producer\_init\_b(3)](/dwarf_producer_init_b/3.md), [dwarf\_transform\_to\_disk\_form(3)](/dwarf_transform_to_disk_form/3.md)
