GEL  0.99
image.h File Reference
#include <gel/common.h>
#include <gel/types.h>
#include <gel/file.h>

Go to the source code of this file.

Data Structures

struct  auxv_t
 
struct  gel_env_s
 
struct  gel_memory_cluster_info_t
 
struct  gel_memory_image_info_t
 
struct  gel_image_info_t
 
struct  gel_block_info_t
 

Macros

#define GEL_ENV_CLUSTERISED_MEMORY   0x00000001
 
#define GEL_ENV_NO_STACK   0x00000002
 
#define STACKADDR_OSDEFAULT   0
 
#define STACKSIZE_OSDEFAULT   0
 
#define ENVFLAGS_OSDEFAULT   0
 
#define CLUSTERSIZE_OSDEFAULT   4096
 
#define GEL_IMAGE_CLOSE_EXEC   0x00000001
 
#define GEL_IMAGE_CLOSE_LIBS   0x00000002
 
#define GEL_IMAGE_PLTBLOCK_LAZY   0x00000004
 
#define GEL_IMAGE_PLTBLOCK_NOW   0x00000008
 

Typedefs

typedef __BEGIN_DECLS struct auxv_t auxv_t
 
typedef struct gel_env_s gel_env_t
 
typedef struct gel_image_s gel_image_t
 
typedef struct gel_memory_image_s gel_memory_image_t
 
typedef struct gel_memory_cluster_s gel_memory_cluster_t
 
typedef struct gel_memory_cluster_info_t gel_memory_cluster_info_t
 
typedef struct gel_memory_image_info_t gel_memory_image_info_t
 
typedef struct gel_image_info_t gel_image_info_t
 
typedef struct gel_block_info_t gel_block_info_t
 

Functions

int gel_block_infos (gel_block_t *b, gel_block_info_t *bi)
 
void gel_close_libs (gel_image_t *im)
 
gel_env_tgel_default_env ()
 
void gel_image_close (gel_image_t *i)
 
void gel_image_close_only (gel_image_t *i)
 
gel_enum_tgel_enum_glob_symbol (gel_image_t *im)
 
gel_sym_tgel_find_glob_symbol (gel_image_t *i, char *name)
 
gel_env_tgel_image_env (gel_image_t *i)
 
int gel_image_infos (gel_image_t *i, gel_image_info_t *ii)
 
gel_image_tgel_image_load (gel_file_t *e, gel_env_t *env, int flags)
 
int gel_memory_image_infos (gel_memory_image_t *mi, gel_memory_image_info_t *mii)
 
vaddr_t gel_raddr_to_vaddr (raddr_t a, gel_image_t *i)
 
int gel_test_raddr (raddr_t a, gel_image_t *i)
 
int gel_test_vaddr (vaddr_t a, gel_image_t *i)
 
raddr_t gel_vaddr_to_raddr (vaddr_t a, gel_image_t *i)
 
int gel_memory_cluster_infos (gel_memory_cluster_t *mc, gel_memory_cluster_info_t *mci)
 
void gel_replacesym (gel_image_t *im, char *symname, gel_sym_t *newsym)
 

Typedef Documentation

◆ auxv_t

typedef __BEGIN_DECLS struct auxv_t auxv_t

◆ gel_env_t

typedef struct gel_env_s gel_env_t

Function Documentation

◆ gel_close_libs()

void gel_close_libs ( gel_image_t im)

Close all opended libraries files in an image, keeping only the memory blocks.

Parameters
imImage to work on.

◆ gel_enum_glob_symbol()

gel_enum_t* gel_enum_glob_symbol ( gel_image_t im)

Return an enumeration of the global symbols of the image. Free the returned enumeration with enu_free().

Parameters
imImage to work on.
Returns
Enumeration or null if there is an error (error code in gel_errno).

◆ gel_find_glob_symbol()

gel_sym_t* gel_find_glob_symbol ( gel_image_t im,
char *  name 
)

Get a global symbol in the image from its name.

Parameters
imImage descriptor..
nameSymbol name.
Returns
Symbol descriptor or null if it is not found..

◆ gel_replacesym()

void gel_replacesym ( gel_image_t im,
char *  symname,
gel_sym_t newsym 
)

Remplace (recopie) un symbole par un autre dans la table de hashage des symboles. Les deux symboles doivent avoir le meme nom.

Parameters
imLa table de hashage
symnameLe nom du symbole a remplacer
newsymLe nouveau symbole a mettre a sa place.

◆ gel_test_raddr()

int gel_test_raddr ( raddr_t  a,
gel_image_t im 
)

Test if a real address is in a memory of an image.

Parameters
aReal address to test.
imImage to test with.
Returns
1 if it is contained, 0 else.

◆ gel_test_vaddr()

int gel_test_vaddr ( vaddr_t  a,
gel_image_t im 
)

Test if a virtual address really exists in an image.

Parameters
aVirtual address to test.
imCurrent image.
Returns
1 if it exists, 0 else.