xref: /haiku/src/system/runtime_loader/runtime_loader_private.h (revision d2e1e872611179c9cfaa43ce11bd58b1e3554e4b)
1 /*
2  * Copyright 2003-2008, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  *
5  * Copyright 2002, Manuel J. Petit. All rights reserved.
6  * Distributed under the terms of the NewOS License.
7  */
8 #ifndef RUNTIME_LOADER_H
9 #define RUNTIME_LOADER_H
10 
11 
12 #include <user_runtime.h>
13 #include <runtime_loader.h>
14 
15 
16 extern struct user_space_program_args *gProgramArgs;
17 extern struct rld_export gRuntimeLoader;
18 extern char *(*gGetEnv)(const char *name);
19 
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 int runtime_loader(void *arg);
26 int open_executable(char *name, image_type type, const char *rpath,
27 	const char *programPath);
28 status_t test_executable(const char *path, char *interpreter);
29 
30 void terminate_program(void);
31 image_id load_program(char const *path, void **entry);
32 status_t unload_library(image_id imageID, bool addOn);
33 image_id load_library(char const *path, uint32 flags, bool addOn);
34 status_t get_nth_symbol(image_id imageID, int32 num, char *nameBuffer,
35 	int32 *_nameLength, int32 *_type, void **_location);
36 status_t get_symbol(image_id imageID, char const *symbolName, int32 symbolType,
37 	void **_location);
38 status_t get_next_image_dependency(image_id id, uint32 *cookie,
39 	const char **_name);
40 int resolve_symbol(image_t *rootImage, image_t *image, struct Elf32_Sym *sym,
41 	addr_t *sym_addr);
42 
43 
44 status_t elf_verify_header(void *header, int32 length);
45 void rldelf_init(void);
46 void rldexport_init(void);
47 status_t elf_reinit_after_fork();
48 
49 status_t heap_init(void);
50 
51 // arch dependent prototypes
52 status_t arch_relocate_image(image_t *rootImage, image_t *image);
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif	/* RUNTIME_LOADER_H */
59