Barrelfish
Functions
elf.c File Reference

Rudimentary ELF loader and handling routines. More...

Functions

errval_t elf_load_tls (uint16_t em_machine, elf_allocator_fn allocate_func, void *state, lvaddr_t base, size_t size, genvaddr_t *retentry, genvaddr_t *ret_tlsbase, size_t *ret_tlsinitlen, size_t *ret_tlstotallen)
 Load ELF binary image into memory. More...
 
size_t elf_virtual_size (lvaddr_t base)
 Calculates the size of the loadable portion of the elf image in virtual memory. This is the amount of virtual memory required to load an image.
 
genvaddr_t elf_virtual_base (lvaddr_t base)
 Calculates the base of the loadable portion of the elf image in virtual memory.
 
errval_t elf_get_eh_info (lvaddr_t elfbase, size_t elfsize, lvaddr_t *eh_frame, size_t *eh_frame_size, lvaddr_t *eh_frame_hdr, size_t *eh_frame_hdr_size)
 obtains the error handling frame information form the elf image More...
 

Detailed Description

Rudimentary ELF loader and handling routines.

Function Documentation

errval_t elf_get_eh_info ( lvaddr_t  elfbase,
size_t  elfsize,
lvaddr_t *  eh_frame,
size_t *  eh_frame_size,
lvaddr_t *  eh_frame_hdr,
size_t *  eh_frame_hdr_size 
)

obtains the error handling frame information form the elf image

Parameters
elfbasevirtual base address of the mapped elf
elfsizesize of the elf in bytes
eh_framereturns the virtual address of the eh_frame
eh_frame_sizereturns the size of the eh_frame
eh_frame_hdrreturns the virtual address of the eh_frame_hdr
eh_frame_hdr_sizereturns the size of the eh_frame_hdr
Returns
SYS_ERR_OK on success
errval_t elf_load_tls ( uint16_t  em_machine,
elf_allocator_fn  allocate_func,
void *  state,
lvaddr_t  base,
size_t  size,
genvaddr_t *  retentry,
genvaddr_t *  ret_tlsbase,
size_t *  ret_tlsinitlen,
size_t *  ret_tlstotallen 
)

Load ELF binary image into memory.

This function loads an ELF binary image, based at 'base' and of size 'size' into the memory provided by 'allocate'

Parameters
em_machineELF machine type.
allocateMemory allocation function.
statePointer to state for allocation function.
baseBase address of ELF binary image in memory.
sizeSize of ELF binary image in bytes.
retentryUsed to return entry point address
ret_tlsbaseUsed to return TLS block base address
ret_tlssizeUsed to return TLS block size