---
name: "dwarf_set_reloc_application"
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_set_reloc_application"
---

# dwarf\_set\_reloc\_application(3)

set a library-wide relocation flag

## NAME

**dwarf\_set\_reloc\_application** – set a library-wide relocation flag

## LIBRARY

library “libdwarf”

## SYNOPSIS

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

*int*\

**dwarf\_set\_reloc\_application**(*int apply*);

## DESCRIPTION

Function **dwarf\_set\_reloc\_application**() allows applications to specify how relocation information is to be handled by the DWARF(3) library.

If the argument *apply* holds a non-zero value, the library will process all the relevant “.rel” and “.rela” relocation sections and will apply the relocation records found to their corresponding DWARF sections.

If the argument *apply* is zero, the library will not attempt to apply any relocations.

The default behaviour of the library is to process relocation records.

## NOTES

Function **dwarf\_set\_reloc\_application**() should be called before initialising a dwarf debugging context, i.e, it should be called by the application before calling either of the functions [dwarf\_init(3)](/dwarf_init/3.md) or [dwarf\_elf\_init(3)](/dwarf_elf_init/3.md).

## RETURN VALUES

Function **dwarf\_set\_reloc\_application**() returns the previous value of the library-wide relocation application flag.

## ERRORS

Function **dwarf\_set\_reloc\_application**() does not return an error.

## SEE ALSO

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