elf_load.c File Reference

Userspace ELF loader. More...

#include <stdio.h>
#include <sys/types.h>
#include <align.h>
#include <assert.h>
#include <as.h>
#include <unistd.h>
#include <fcntl.h>
#include <smc.h>
#include <loader/pcb.h>
#include <entry_point.h>
#include "elf.h"
#include "elf_load.h"

Go to the source code of this file.

Defines

#define DPRINTF()

Functions

void elf_create_pcb (elf_info_t *info, pcb_t *pcb)
 Create the program control block (PCB).
char * elf_error (unsigned int rc)
 Print error message according to error code.
static unsigned int elf_load (elf_ld_t *elf, size_t so_bias)
 Load an ELF binary.
int elf_load_file (const char *file_name, size_t so_bias, eld_flags_t flags, elf_info_t *info)
 Load ELF binary from a file.
static int load_segment (elf_ld_t *elf, elf_segment_header_t *entry)
 Load segment described by program header entry.
static int my_read (int fd, void *buf, size_t len)
 Read until the buffer is read in its entirety.
static int section_header (elf_ld_t *elf, elf_section_header_t *entry)
 Process section header.
static int segment_header (elf_ld_t *elf, elf_segment_header_t *entry)
 Process segment header.

Variables

static const char * error_codes []


Detailed Description

Userspace ELF loader.

This module allows loading ELF binaries (both executables and shared objects) from VFS. The current implementation allocates anonymous memory, fills it with segment data and then adjusts the memory areas' flags to the final value. In the future, the segments will be mapped directly from the file.

Definition in file elf_load.c.


Generated on Thu Jun 2 07:45:55 2011 for HelenOS/USB by  doxygen 1.4.7