summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7e5751f)
move all libraries search initialisation stuff
into elf.c / init_library_search()
for now we don't handle musl specific files
Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
struct avl_tree libraries;
static LIST_HEAD(library_paths);
struct avl_tree libraries;
static LIST_HEAD(library_paths);
-void alloc_library_path(const char *path)
+static void alloc_library_path(const char *path)
{
struct stat s;
if (stat(path, &s))
{
struct stat s;
if (stat(path, &s))
-void load_ldso_conf(const char *conf)
+static void load_ldso_conf(const char *conf)
{
FILE* fp = fopen(conf, "r");
char line[PATH_MAX];
{
FILE* fp = fopen(conf, "r");
char line[PATH_MAX];
+
+void init_library_search(void)
+{
+ avl_init(&libraries, avl_strcmp, false, NULL);
+ alloc_library_path("/lib");
+ alloc_library_path("/lib64");
+ alloc_library_path("/usr/lib");
+ load_ldso_conf("/etc/ld.so.conf");
+}
extern struct avl_tree libraries;
extern struct avl_tree libraries;
-void alloc_library_path(const char *path);
int elf_load_deps(const char *library);
const char* find_lib(const char *file);
int elf_load_deps(const char *library);
const char* find_lib(const char *file);
-void load_ldso_conf(const char *conf);
+void init_library_search(void);
- avl_init(&libraries, avl_strcmp, false, NULL);
- alloc_library_path("/lib");
- alloc_library_path("/lib64");
- alloc_library_path("/usr/lib");
- load_ldso_conf("/etc/ld.so.conf");
if (elf_load_deps(*opts.jail_argv)) {
ERROR("failed to load dependencies\n");
if (elf_load_deps(*opts.jail_argv)) {
ERROR("failed to load dependencies\n");