File: elf_getbase.3

package info (click to toggle)
elfutils 0.194-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,680 kB
  • sloc: ansic: 114,970; sh: 35,537; cpp: 4,998; makefile: 1,986; yacc: 1,388; lex: 130; asm: 77; sed: 39; awk: 35
file content (59 lines) | stat: -rw-r--r-- 1,092 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.TH ELF_GETBASE 3 2025-03-31 "Libelf" "Libelf Programmer's Manual"

.SH NAME
elf_getbase \- Retrieve the base offset for an ELF object file.

.SH SYNOPSIS
.B #include <libelf.h>

.BI "int64_t elf_getbase(Elf *" elf ");"

.SH DESCRIPTION
.B elf_getbase
returns the file offset of the first byte of the ELF descriptor
.IR elf .
If
.I elf
is a member of an archive and has ELF kind
.BR ELF_K_AR ,
the base offset is the offset of the ELF object within the archive.
For other ELF object types the base offset is 0.

.SH PARAMETERS
.TP
.I elf
The ELF descriptor.

.SH RETURN VALUE
Return the base offset of
.IR elf
if its ELF kind is
.BR ELF_K_AR ,
otherwise return 0.  If
.I elf
is NULL, return -1.

.SH SEE ALSO
.BR elf_getaroff (3),
.BR elf_rawelf (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_getbase ()
T}	Thread safety	MT-Safe
.TE

.SH REPORTING BUGS
Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.