xref: /haiku/src/system/runtime_loader/runtime_loader_private.h (revision 58481f0f6ef1a61ba07283f012cafbc2ed874ead)
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, const char *compatibilitySubDir);
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 image_id load_library(char const *path, uint32 flags, bool addOn,
33 	void** _handle);
34 status_t unload_library(void* handle, image_id imageID, bool addOn);
35 status_t get_nth_symbol(image_id imageID, int32 num, char *nameBuffer,
36 	int32 *_nameLength, int32 *_type, void **_location);
37 status_t get_symbol(image_id imageID, char const *symbolName, int32 symbolType,
38 	bool recursive, image_id *_inImage, void **_location);
39 status_t get_library_symbol(void* handle, void* caller, const char* symbolName,
40 	void **_location);
41 status_t get_next_image_dependency(image_id id, uint32 *cookie,
42 	const char **_name);
43 int resolve_symbol(image_t *rootImage, image_t *image, struct Elf32_Sym *sym,
44 	addr_t *sym_addr);
45 
46 
47 status_t elf_verify_header(void *header, int32 length);
48 void rldelf_init(void);
49 void rldexport_init(void);
50 status_t elf_reinit_after_fork(void);
51 
52 status_t heap_init(void);
53 
54 // arch dependent prototypes
55 status_t arch_relocate_image(image_t *rootImage, image_t *image);
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif	/* RUNTIME_LOADER_H */
62