Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Examples

ELF object code loader
[The Contiki program loader]


Detailed Description

The Contiki ELF loader is able to load and relocate ELF object files.


Files

file  elfloader-tmp.h
 Header file for the Contiki ELF loader.

Modules

 Architecture specific functionality for the ELF loader.
 The architecture specific functionality for the Contiki ELF loader has to be implemented for each processor type Contiki runs on.

Data Structures

struct  elf32_rela

Defines

#define ELFLOADER_OK   0
 Return value from elfloader_load() indicating that loading worked.
#define ELFLOADER_BAD_ELF_HEADER   1
 Return value from elfloader_load() indicating that the ELF file had a bad header.
#define ELFLOADER_NO_SYMTAB   2
 Return value from elfloader_load() indicating that no symbol table could be find in the ELF file.
#define ELFLOADER_NO_STRTAB   3
 Return value from elfloader_load() indicating that no string table could be find in the ELF file.
#define ELFLOADER_NO_TEXT   4
 Return value from elfloader_load() indicating that the size of the .text segment was zero.
#define ELFLOADER_SYMBOL_NOT_FOUND   5
 Return value from elfloader_load() indicating that a symbol specific symbol could not be found.
#define ELFLOADER_SEGMENT_NOT_FOUND   6
 Return value from elfloader_load() indicating that one of the required segments (.data, .bss, or .text) could not be found.
#define ELFLOADER_NO_STARTPOINT   7
 Return value from elfloader_load() indicating that no starting point could be found in the loaded module.
#define ELFLOADER_DATAMEMORY_SIZE   0x100
#define ELFLOADER_TEXTMEMORY_SIZE   0x100

Typedefs

typedef unsigned long elf32_word
typedef signed long elf32_sword
typedef unsigned short elf32_half
typedef unsigned long elf32_off
typedef unsigned long elf32_addr

Functions

void elfloader_init (void)
 elfloader initialization function.
int elfloader_load (int fd)
 Load and relocate an ELF file.

Variables

process ** elfloader_autostart_processes
 A pointer to the processes loaded with elfloader_load().
char elfloader_unknown [30]
 If elfloader_load() could not find a specific symbol, it is copied into this array.


Define Documentation

#define ELFLOADER_SYMBOL_NOT_FOUND   5
 

Return value from elfloader_load() indicating that a symbol specific symbol could not be found.

If this value is returned from elfloader_load(), the symbol has been copied into the elfloader_unknown[] array.

Definition at line 91 of file elfloader-tmp.h.


Function Documentation

void elfloader_init void   ) 
 

elfloader initialization function.

This function should be called at boot up to initilize the elfloader.

int elfloader_load int  fd  ) 
 

Load and relocate an ELF file.

Parameters:
fd An open file descriptor.
Returns:
ELFLOADER_OK if loading and relocation worked. Otherwise an error value.
This function loads and relocates an ELF file. The ELF file must have been opened with cfs_open() prior to calling this function.

If the function is able to load the ELF file, a pointer to the process structure in the model is stored in the elfloader_loaded_process variable.

Note:
This function modifies the ELF file opened with cfs_open()! If the contents of the file is required to be intact, the file must be backed up first.


Generated on Thu Jun 22 17:45:43 2006 for Contiki 2.x by  doxygen 1.4.4