|
| typedef typedef__BEGIN_DECLS struct gel_sect_s | gel_sect_t |
| |
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().
◆ gel_sect_t
Opaque type to describe a section in the ELF file. This kind of data is returned by getsectbyidx() et getsectbyname().
◆ gel_getsectbyidx()
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
-
| e | Descriptor of the ELF file containing the section. |
| idx | Section index. |
- Returns
- Section descriptor pointer or NULL for failure (see gel_errno fro details).
◆ gel_getsectbyname()
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
-
| e | Descriptor of the ELF file containing the sectio. |
| sectname | Name of the looked section. |
- Returns
- Description pointer of the found section or NULL (see gel_errno for details).
◆ gel_sect2cursor()
Create a cursor on a section (loaded if needed).
- Parameters
-
| s | Section descriptor. |
| c | Cursor instance. |
- Returns
- Error code (0 for success, -1 for failure)
◆ gel_sect_infos()
Get public information of a section. Note that the returned information remains only valid until the secton is removed.
- Parameters
-
| e | Section descriptor. |
| si | Structure to get back section information. |
- Returns
- 0 for success, -1 for failure (details in gel_errno).
◆ gel_sect_load()
Load the content of a section at the given address or, if null, allocate some memory to put content in.
- Parameters
-
| s | Section descriptor. |
| addr | Memory to load content in. |
- Returns
- 0 for success, -1 for error (see gel_errno for details)