LIBRTLD_DB(3)
π
LIBRTLD_DB(3) β hey bestie, it's the librtld_db page π
Okay so this is the LIBRTLD_DB(3) page from the Library Functions Manual, and we're talking about librtld_db, the library for run-time linker debugging. Buckle up, it's giving debugger-core π«Ά
πΈ NAME πΈ
librtld_db β library for run-time linker debugging
π LIBRARY π
library βlibrtld_dbβ
β¨ SYNOPSIS β¨
#include <rtld_db.h>
void
rd_delete(rd_agent_t *rdap);
char *
rd_errstr(rd_err_e rderr);
rd_err_e
rd_event_addr(rd_agent_t *rdap, rd_event_e event, rd_notify_t *notify);
rd_err_e
rd_event_enable(rd_agent_t *rdap, int onoff);
rd_err_e
rd_event_getmsg(rd_agent_t *rdap, rd_event_msg_t *msg);
rd_err_e
rd_init(int version);
typedef int
rl_iter_f(const rd_loadobj_t *, void *);
rd_err_e
rd_loadobj_iter(rd_agent_t *rdap, rl_iter_f *cb, void *clnt_data);
void
rd_log(const int onoff);
rd_agent_t *
rd_new(struct proc_handle *php);
rd_err_e
rd_objpad_enable(rd_agent_t *rdap, size_t padsize);
rd_err_e
rd_plt_resolution(rd_agent_t *rdap, uintptr_t pc, struct proc *proc,
uintptr_t plt_base, rd_plt_info_t *rpi);
rd_err_e
rd_reset(rd_agent_t *rdap);
π DESCRIPTION π
The librtld_db library gives you a debugging interface to the run-time linker, aka rtld. It literally must be used along with libproc(3), no solo missions bestie.
Most library functions take an rd_agent_t argument. That argument is an opaque structure containing information associated with the current status of the agent. Very mystery, very iconique π
Before you start using librtld_db, you should call rd_init() with the RD_VERSION argument. This initializes the library to the correct version your program was compiled with and provides proper ABI stability. Slay, ABI stability matters.
Okay, function-by-function breakdown time π§
rd_new()β creates a newlibrtld_dbagent. Thephpargument should be theproc_handleyou received fromlibproc(3).rd_reset()β resets your previously created agent.rd_delete()β deallocates the resources associated with the agent.rd_errstr()β returns an error string describing the error present inrderr.rd_event_enable()β enables reporting of events. This function always returnsRD_OK.rd_event_addr()β returns the event address corresponding to theeventparameter. At the moment we only report events of typeRD_NOTIFY_BPT.rd_event_getmsg()β returns the message associated with the latest event. At the moment onlyRD_POSTINITevents are supported.rd_loadobj_iter()β allows you to iterate over the program's loaded objects.cbis a callback of typerl_iter_f().
π RETURN VALUES π
Most functions return an rd_err_e type error. The error codes are described in the header file for this library. You can get the error string using rd_errstr(). iykyk, check the header.
π SEE ALSO π
ld(1), ld-elf.so.1(1), ld.so(1), rtld(1), libproc(3)
π¦ HISTORY π¦
The librtld_db library first appeared in FreeBSD 9.0 and was modeled after the same library present in the Solaris operating system. History lesson served, bestie.
π AUTHORS π
The librtld_db library and this manual page were written by Rui Paulo <rpaulo@FreeBSD.org> under sponsorship from the FreeBSD Foundation.
π CAVEATS π
Heads up: the functions rd_event_enable(), rd_log(), rd_objpad_enable() and rd_plt_resolution() are not yet implemented. Not me pretending they're ready β they are literally not yet implemented.
π source/version: Debian Β· date: June 10, 2010 Β· page: LIBRTLD_DB(3) β okay bye bestie, mwah π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2010 The FreeBSD Foundation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms