GEL  0.99
Sections

Data Structures

struct  gel_sect_info_t
 

Typedefs

typedef typedef__BEGIN_DECLS struct gel_sect_s gel_sect_t
 

Functions

int gel_sect2cursor (gel_sect_t *s, gel_cursor_t *c)
 
int gel_sect_load (gel_sect_t *s, raddr_t addr)
 
gel_sect_tgel_getsectbyidx (gel_file_t *e, u16_t idx)
 
gel_sect_tgel_getsectbyname (gel_file_t *e, char *sectname)
 
int gel_sect_infos (gel_sect_t *e, gel_sect_info_t *si)
 

Detailed Description

Sections are part of ELF files giving a logical division of a program. They are usually obtained from the ELF file using functions gel_getsectbyidx() and gel_getsectbyname().

Typedef Documentation

◆ gel_sect_t

Opaque type to describe a section in the ELF file. This kind of data is returned by getsectbyidx() et getsectbyname().

Function Documentation

◆ gel_getsectbyidx()

gel_sect_t* gel_getsectbyidx ( gel_file_t e,
u16_t  idx 
)

Get a section descriptor from its index in the ELF file. The section will be automatically fried as soon the ELF file descriptor is closed.

Parameters
eDescriptor of the ELF file containing the section.
idxSection index.
Returns
Section descriptor pointer or NULL for failure (see gel_errno fro details).

◆ gel_getsectbyname()

gel_sect_t* gel_getsectbyname ( gel_file_t e,
char *  sectname 
)

Get a section descriptor from its name. If two sections have the same name, only the first one in index order is returned. The section will be automatically fried as soon as the ELF file descriptor is closed.

Parameters
eDescriptor of the ELF file containing the sectio.
sectnameName of the looked section.
Returns
Description pointer of the found section or NULL (see gel_errno for details).

◆ gel_sect2cursor()

int gel_sect2cursor ( gel_sect_t s,
gel_cursor_t c 
)

Create a cursor on a section (loaded if needed).

Parameters
sSection descriptor.
cCursor instance.
Returns
Error code (0 for success, -1 for failure)

◆ gel_sect_infos()

int gel_sect_infos ( gel_sect_t e,
gel_sect_info_t si 
)

Get public information of a section. Note that the returned information remains only valid until the secton is removed.

Parameters
eSection descriptor.
siStructure to get back section information.
Returns
0 for success, -1 for failure (details in gel_errno).

◆ gel_sect_load()

int gel_sect_load ( gel_sect_t s,
raddr_t  addr 
)

Load the content of a section at the given address or, if null, allocate some memory to put content in.

Parameters
sSection descriptor.
addrMemory to load content in.
Returns
0 for success, -1 for error (see gel_errno for details)