drgn/libdrgn/elfutils/doc/elf_getdata.3
Omar Sandoval 1cedca8ff4 Import elfutils
Based on:

c950e8a9 config: Fix spec file, add manpages and new GFDL license.

With the following patches:

configure: Add --disable-programs
configure: Add --disable-shared
configure: Fix -D_FORTIFY_SOURCE=2 check when CFLAGS contains -Wno-error
libcpu: compile i386_lex.c with -Wno-implicit-fallthrough

The plan is to stop relying on the distribution's version of elfutils
and instead ship our own. This gives us freedom to assume that we're
using the latest version and even ship our own patches (starting with a
few build system improvements). More details are in
scripts/update-elfutils.sh, which was used to generate this commit.
2019-09-05 01:04:33 -07:00

29 lines
1.1 KiB
Groff

.\" Modified Thu Aug 17 2017 by Ben Woodard <woodard@redhat.com>
.\"
.TH ELF_GETDATA 3 2017-08-17 "Libelf" "Libelf Programmer's Manual"
.SH NAME
elf_getdata \- Get washed data of section
.nf
.SH SYNOPSIS
.B #include <libelf.h>
.sp
.BI "Elf_Data * elf_getdata (Elf_Scn *" scn ", Elf_Data *" data ");"
.fi
.SH DESCRIPTION
The
.BR elf_getdata ()
function allows the user to retrieve the data buffers of the section
.I scn
. There can be more than one buffer if the user explicitly added them.
When a file is read the libelf library creates exactly one data buffer.
The first buffer in the list can be obtained by passing a null pointer in the
parameter data. To get the next data buffer the previously returned value must
be passed in the data parameter. If there are no more buffer left in the list a
null pointer is returned.
If the data parameter is not a null pointer it must be a descriptor for a
buffer associated with the section scn . If this is not the case a null pointer
is returned. To facilitate error handling elf_getdata also returns a null
pointer if the scn parameter is a null pointer.