procd: ujail static-linked binary (#10381)

ref: openwrt/openwrt#10933
This commit is contained in:
ty 2022-11-07 09:54:23 +08:00 committed by GitHub
parent 297447302a
commit 3ff8b3e253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,29 @@
--- a/jail/elf.c
+++ b/jail/elf.c
@@ -240,18 +240,18 @@ int elf_load_deps(const char *path, cons
gcc_mips64_bug_work_around = 1;
#endif
- 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];