jail: ignore missing .dynamic sect
[project/procd.git] / jail / elf.c
index 176d046b602baa97530cbc9bb15e8b8067a0c0ce..978fc6e113514578d302e343b9bb7807f53bb941 100644 (file)
@@ -236,18 +236,18 @@ int elf_load_deps(const char *path, const char *map)
        unsigned long load_offset, load_vaddr;
        unsigned long interp_offset;
 
-       if (elf_find_section(map, PT_LOAD, &load_offset, NULL, &load_vaddr)) {
-               ERROR("failed to load the .load section from %s\n", path);
-               return -1;
+       if (elf_find_section(map, PT_INTERP, &interp_offset, NULL, NULL) == 0) {
+               add_path_and_deps(map+interp_offset, 1, -1, 0);
        }
 
-       if (elf_find_section(map, PT_DYNAMIC, &dyn_offset, &dyn_size, NULL)) {
-               ERROR("failed to load the .dynamic section from %s\n", path);
-               return -1;
+       if (elf_find_section(map, PT_LOAD, &load_offset, NULL, &load_vaddr)) {
+               DEBUG("failed to load the .load section from %s\n", path);
+               return 0;
        }
 
-       if (elf_find_section(map, PT_INTERP, &interp_offset, NULL, NULL) == 0) {
-               add_path_and_deps(map+interp_offset, 1, -1, 0);
+       if (elf_find_section(map, PT_DYNAMIC, &dyn_offset, &dyn_size, NULL)) {
+               DEBUG("failed to load the .dynamic section from %s\n", path);
+               return 0;
        }
 
        int clazz = map[EI_CLASS];