diff options
author | Aaron Merey <[email protected]> | 2025-05-12 20:33:37 -0400 |
---|---|---|
committer | Aaron Merey <[email protected]> | 2025-05-14 14:47:46 -0400 |
commit | 40aee9948fa932c2ee65d3753cce727c4bc95ce4 (patch) | |
tree | 4accbd44538152dbc93dd37a248c37437a55c145 | |
parent | bd631e6883c23733e9836726a00ff7959e1aa920 (diff) |
doc: Add elf_end.3
Signed-off-by: Aaron Merey <[email protected]>
-rw-r--r-- | doc/Makefile.am | 1 | ||||
-rw-r--r-- | doc/elf_end.3 | 71 |
2 files changed, 72 insertions, 0 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index b75711ca..dee77214 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -51,6 +51,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ elf64_xlatetom.3 \ elf_begin.3 \ elf_clone.3 \ + elf_end.3 \ elf_errmsg.3 \ elf_errno.3 \ elf_getdata.3 \ diff --git a/doc/elf_end.3 b/doc/elf_end.3 new file mode 100644 index 00000000..48900edc --- /dev/null +++ b/doc/elf_end.3 @@ -0,0 +1,71 @@ +.TH ELF_END 3 2025-03-31 "Libelf" "Libelf Programmer's Manual" + +.SH NAME +elf_end \- Release resources associated with an ELF descriptor. + +.SH SYNOPSIS +.nf +#include <libelf.h> + +.BI "int elf_end(Elf *" elf ");" + +.SH DESCRIPTION +The +.B elf_end +function releases resources associated with an ELF descriptor previously +returned by +.BR elf_begin . +It decrements the ELF descriptor’s internal reference count by one. When +this count reaches zero, the resources associated with the descriptor are +freed and the descriptor is invalidated. If +.I elf +is not an archive member with ELF kind +.BR ELF_K_AR , +the internal reference count is increased by one each time +.I elf +is passed to +.B elf_begin +as the +.I ref +argument. + +An ELF descriptor whose reference count reaches zero is invalidated. +Further operations on the descriptor will result in undefined behavior. + +.SH PARAMETERS +.TP +.I elf +The ELF descriptor (may be NULL). + +.SH RETURN VALUE +Return the ELF descriptor's current internal reference count after +decrementing. A return value of zero indicates the ELF descriptor is now +invalidated. If +.I elf +is NULL, then +.B elf_end +also returns 0. + +.SH SEE ALSO +.BR elf_begin (3), +.BR libelf (3), +.BR elf (5) + +.SH ATTRIBUTES +For an explanation of the terms used in this section, see +.BR attributes (7). +.TS +allbox; +lbx lb lb +l l l. +Interface Attribute Value +T{ +.na +.nh +.BR elf_end () +T} Thread safety MT-Safe +.TE + +.SH REPORTING BUGS +Report bugs to <[email protected]> or https://sourceware.org/bugzilla/. + |