Subversion Repositories HelenOS

Rev

Rev 2963 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2963 Rev 2964
Line 37... Line 37...
37
 
37
 
38
#include <arch/elf.h>
38
#include <arch/elf.h>
39
#include <sys/types.h>
39
#include <sys/types.h>
40
 
40
 
41
#include "elf.h"
41
#include "elf.h"
-
 
42
#include "pcb.h"
42
 
43
 
-
 
44
/**
-
 
45
 * Some data extracted from the headers are stored here
-
 
46
 */
-
 
47
typedef struct {
-
 
48
    /** Entry point */
-
 
49
    entry_point_t entry;
-
 
50
 
-
 
51
    /** Pointer to the dynamic section */
-
 
52
    void *dynamic; 
-
 
53
} elf_info_t;
-
 
54
 
-
 
55
/**
-
 
56
 * Holds information about an ELF binary being loaded.
-
 
57
 */
-
 
58
typedef struct {
-
 
59
    /** Filedescriptor of the file from which we are loading */
-
 
60
    int fd;
-
 
61
 
-
 
62
    /** Difference between run-time addresses and link-time addresses */
-
 
63
    uintptr_t bias;
-
 
64
 
-
 
65
    /** A copy of the ELF file header */
-
 
66
    elf_header_t *header;
-
 
67
 
-
 
68
    /** Store extracted info here */
-
 
69
    elf_info_t *info;
-
 
70
} elf_ld_t;
-
 
71
 
43
int elf_load_file(char *file_name, elf_header_t *header);
72
int elf_load_file(char *file_name, elf_info_t *info);
44
void elf_run(elf_header_t *header);
73
void elf_run(elf_info_t *info);
45
int elf_create_pcb(elf_header_t *header);
74
int elf_create_pcb(elf_info_t *info);
46
 
75
 
47
#endif
76
#endif
48
 
77
 
49
/** @}
78
/** @}
50
 */
79
 */