File: elf32_newphdr.3

package info (click to toggle)
elfutils 0.194-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,848 kB
  • sloc: ansic: 115,014; sh: 35,537; cpp: 4,998; makefile: 1,986; yacc: 1,388; lex: 130; asm: 77; sed: 39; awk: 35
file content (72 lines) | stat: -rw-r--r-- 1,743 bytes parent folder | download | duplicates (5)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
.TH ELF32_NEWPHDR 3 2024-08-14 "Libelf" "Libelf Programmer's Manual"

.SH NAME
elf32_newphdr, elf64_newphdr \- create a new program header table for a
32-bit or 64-bit ELF object file

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

.BI "Elf32_Phdr *elf32_newphdr(Elf *" elf ", size_t " count ");"
.BI "Elf64_Phdr *elf64_newphdr(Elf *" elf ", size_t " count ");"

.SH DESCRIPTION
Create a new program header table for the ELF object file referred to by
.IR elf .
The number of entries in the new program header table is specified by
.IR count .
A
.I count
of zero removes the existing program header table.

The function allocates a new array of
.B Elf32_Phdr
and makes it the program header table for
.IR elf .
The new program header contents are set to zero and any previous program
header table is discarded.  An ELF header must exist before creating a
program header table.

.SH PARAMETERS
.TP
.I elf
Pointer to the ELF object for which a new program header table is to be created.

.TP
.I count
The number of entries in the new program header table. A count of zero removes
the existing program header table.

.SH RETURN VALUE
On success, return a pointer to the first
.B Elf32_Phdr
in the newly created program header table.  If
.I elf
is NULL then return NULL.  If an error occurs, return NULL and set a libelf
error code.

.SH SEE ALSO
.BR elf32_newehdr (3),
.BR elf_errno (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 elf32_newphdr (),
.BR elf64_newphdr ()
T}	Thread safety	MT-Safe
.TE

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