Ben Woodard | f0a5176 | 2019-08-23 13:42:06 -0700 | [diff] [blame] | 1 | .\" Modified Thu Aug 17 2017 by Ben Woodard <woodard@redhat.com> |
| 2 | .\" |
| 3 | .TH ELF_GETDATA 3 2017-08-17 "Libelf" "Libelf Programmer's Manual" |
| 4 | .SH NAME |
| 5 | elf_getdata \- Get washed data of section |
| 6 | .nf |
| 7 | .SH SYNOPSIS |
| 8 | .B #include <libelf.h> |
| 9 | .sp |
| 10 | .BI "Elf_Data * elf_getdata (Elf_Scn *" scn ", Elf_Data *" data ");" |
| 11 | .fi |
| 12 | .SH DESCRIPTION |
| 13 | The |
| 14 | .BR elf_getdata () |
| 15 | function allows the user to retrieve the data buffers of the section |
| 16 | .I scn |
| 17 | . There can be more than one buffer if the user explicitly added them. |
| 18 | When a file is read the libelf library creates exactly one data buffer. |
| 19 | |
| 20 | The first buffer in the list can be obtained by passing a null pointer in the |
| 21 | parameter data. To get the next data buffer the previously returned value must |
| 22 | be passed in the data parameter. If there are no more buffer left in the list a |
| 23 | null pointer is returned. |
| 24 | |
| 25 | If the data parameter is not a null pointer it must be a descriptor for a |
| 26 | buffer associated with the section scn . If this is not the case a null pointer |
| 27 | is returned. To facilitate error handling elf_getdata also returns a null |
| 28 | pointer if the scn parameter is a null pointer. |