DWARF_GET_RELOCATION_INFO_COUNT(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’– dwarf_get_relocation_info_count(3) πŸ’–

okay so this page is from the Library Functions Manual, and the header is being extra with its truncated DWARF_GET_RELOCATION_INF(3) moment β€” but the NAME section spells the whole thing out, bestie. We're talking about dwarf_get_relocation_info_count(), and it's giving β€œtell me how many relocation arrays we’ve got” energy. Periodt. ✨


🫢 NAME 🫢

dwarf_get_relocation_info_count β€” return the number of relocation arrays. No cap.

🌸 LIBRARY 🌸

DWARF Access Library (libdwarf, -ldwarf). Slay.

✨ 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 πŸ¦‹

So dwarf_get_relocation_info_count() retrieves the total number of relocation arrays that got generated by a prior call to dwarf_transform_to_disk_form(3). It's literally the β€œcount my relocation arrays” function, and we're obsessed.

  • dbg β€” this should reference a DWARF producer instance allocated using dwarf_producer_init(3) or dwarf_producer_init_b(3). Also, the DW_DLC_SYMBOLIC_RELOCATIONS flag should have been set on the producer instance. Important vibe check, okay?
  • reloc_cnt β€” this should point to a location which will be set to the total number of relocation arrays generated.
  • drd_buffer_version β€” this 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>.
  • err β€” 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. Iconic.
  • 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. Sad but informative.

πŸ’… 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 🌈


okay that's the whole page, bestie 🫢 shoutout to Debian and the September 3, 2… date stamp in the footer β€” the last bit is literally getting cut off, no cap πŸ˜­πŸ’–πŸŽ€

πŸ“¦ where this page comes from