elf-loader.c File Reference

simple ELF interpreter More...

#include <assert.h>
#include <stdio.h>
#include <l4/sys/types.h>
#include <l4/sys/consts.h>
#include <l4/env/errno.h>
#include <l4/env/env.h>
#include <l4/dm_mem/dm_mem.h>
#include <l4/util/elf.h>
#include "app.h"
#include "dm-if.h"
#include "elf-loader.h"
#include "fprov-if.h"

Functions

static int elf_map (app_t *app, l4_addr_t image, l4_addr_t base, l4_addr_t *entry, l4_uint32_t *save_phnum, l4_addr_t *save_phdr, int load_hdrs)
int elf_map_binary (app_t *app)
 Load program sections of binary which must be interpreted by libld-l4.s.so.
int elf_map_ldso (app_t *app, l4_addr_t app_addr)
 Load the libld-l4.s.so interpreter.
int elf_check_ftype (const l4_addr_t img, const l4_size_t size, const l4env_infopage_t *env)

Variables

const char *const interp = "libld-l4.s.so"


Detailed Description

simple ELF interpreter

Date:
05/10/2005
Author:
Frank Mehnert <fm3@os.inf.tu-dresden.de>

Function Documentation

int elf_check_ftype ( const l4_addr_t  img,
const l4_size_t  size,
const l4env_infopage_t env 
)

Parameters:
img Pointer to binary image in memory
size Size of image
env L4Env info page
Returns:
0 Image is ELF for given architecture -ELF_INTERPRETER Found an interpreter section.
-L4_EINVAL Invalid input data, or invalid interpreter detected -ELF_BADFORMAT Image is not ELF for given arch -ELF_CORRUPT Image is corrupt

static int elf_map ( app_t app,
l4_addr_t  image,
l4_addr_t  base,
l4_addr_t *  entry,
l4_uint32_t *  save_phnum,
l4_addr_t *  save_phdr,
int  load_hdrs 
) [static]

< all sections writable

int elf_map_binary ( app_t app  ) 

Load program sections of binary which must be interpreted by libld-l4.s.so.

Parameters:
app application
Returns:
0 if success

int elf_map_ldso ( app_t app,
l4_addr_t  app_addr 
)

Load the libld-l4.s.so interpreter.

Parameters:
app application
app_addr load address inside application
Returns:
0 on success


L4 Loader Reference Manual, part of DROPS  © 2000-2003