_eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa, _eeee_llll_ffff______nnnn_eeee_wwww_dddd_aaaa_tttt_aaaa, _eeee_llll_ffff______rrrr_aaaa_wwww_dddd_aaaa_tttt_aaaa - get section data
These functions access and manipulate the data associated with a section
descriptor, _s_c_n. When reading an existing file, a section will have a
single data buffer associated with it. A program may build a new section
in pieces, however, composing the new data from multiple data buffers.
For this reason, ``the'' data for a section should be viewed as a list of
buffers, each of which is available through a data descriptor.
_eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa lets a program step through a section's data list. If the
incoming data descriptor, _d_a_t_a, is null, the function returns the first
buffer associated with the section. Otherwise, _d_a_t_a should be a data
descriptor associated with _s_c_n, and the function gives the program access
to the next data element for the section. If _s_c_n is null or an error
occurs, _eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa returns a null pointer.
_eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa translates the data from file representations into memory
representations [see _eeee_llll_ffff______xxxx_llll_aaaa_tttt_eeee(3E)] and presents objects with memory data
types to the program, based on the file's _c_l_a_s_s [see _eeee_llll_ffff(3E)]. The
working library version [see _eeee_llll_ffff______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn(3E)] specifies what version of
the memory structures the program wishes _eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa to present.
_eeee_llll_ffff______nnnn_eeee_wwww_dddd_aaaa_tttt_aaaa creates a new data descriptor for a section, appending it to
any data elements already associated with the section. As described
below, the new data descriptor appears empty, indicating the element
holds no data. For convenience, the descriptor's type (_dddd______tttt_yyyy_pppp_eeee below) is
set to _EEEE_LLLL_FFFF______TTTT______BBBB_YYYY_TTTT_EEEE, and the version (_dddd______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn below) is set to the
working version. The program is responsible for setting (or changing)
the descriptor members as needed. This function implicitly sets the
_EEEE_LLLL_FFFF______FFFF______DDDD_IIII_RRRR_TTTT_YYYY bit for the section's data [see _eeee_llll_ffff______ffff_llll_aaaa_gggg(3E)]. If _s_c_n is
null or an error occurs, _eeee_llll_ffff______nnnn_eeee_wwww_dddd_aaaa_tttt_aaaa returns a null pointer.
_eeee_llll_ffff______rrrr_aaaa_wwww_dddd_aaaa_tttt_aaaa differs from _eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa by returning only uninterpreted
bytes, regardless of the section type. This function typically should be
used only to retrieve a section image from a file being read, and then
only when a program must avoid the automatic data translation described
below. Moreover, a program may not close or disable [see _eeee_llll_ffff______cccc_nnnn_tttt_llll(3E)]
the file descriptor associated with _e_l_f before the initial raw operation,
because _eeee_llll_ffff______rrrr_aaaa_wwww_dddd_aaaa_tttt_aaaa might read the data from the file to ensure it
doesn't interfere with _eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa. See _eeee_llll_ffff______rrrr_aaaa_wwww_ffff_iiii_llll_eeee(3E) for a related
facility that applies to the entire file. When _eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa provides the
_eeee_llll_ffff______rrrr_aaaa_wwww_dddd_aaaa_tttt_aaaa creates a buffer with type _EEEE_LLLL_FFFF______TTTT______BBBB_YYYY_TTTT_EEEE.
As mentioned above, the program's working version controls what
structures the library creates for the application. The library
similarly interprets section types according to the versions. If a
section type ``belongs'' to a version newer than the application's
working version, the library does not translate the section data.
Because the application cannot know the data format in this case, the
library presents an untranslated buffer of type _EEEE_LLLL_FFFF______TTTT______BBBB_YYYY_TTTT_EEEE, just as it
would for an unrecognized section type.
A section with a special type, _SSSS_HHHH_TTTT______NNNN_OOOO_BBBB_IIII_TTTT_SSSS, occupies no space in an object
file, even when the section header indicates a non-zero size.
_eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa and _eeee_llll_ffff______rrrr_aaaa_wwww_dddd_aaaa_tttt_aaaa ``work'' on such a section, setting the _d_a_t_a
structure to have a null buffer pointer and the type indicated above.
Although no data are present, the _dddd______ssss_iiii_zzzz_eeee value is set to the size from
the section header. When a program is creating a new section of type
_SSSS_HHHH_TTTT______NNNN_OOOO_BBBB_IIII_TTTT_SSSS, it should use _eeee_llll_ffff______nnnn_eeee_wwww_dddd_aaaa_tttt_aaaa to add data buffers to the section.
These ``empty'' data buffers should have the _dddd______ssss_iiii_zzzz_eeee members set to the
desired size and the _dddd______bbbb_uuuu_ffff members set to null.
EEEEXXXXAAAAMMMMPPPPLLLLEEEE
The following fragment obtains the string table that holds section names
(ignoring error checking). See _eeee_llll_ffff______ssss_tttt_rrrr_pppp_tttt_rrrr(3E) for a variation of string