Changeset 32254d6 in mainline for uspace/lib/c/generic/elf/elf_load.c
- Timestamp:
- 2025-02-13T10:16:55Z (7 days ago)
- Branches:
- master
- Children:
- 286c4b0, f455de0
- Parents:
- a7a16a2f
- git-author:
- Matěj Volf <git@…> (2025-02-13 10:16:55)
- git-committer:
- GitHub <noreply@…> (2025-02-13 10:16:55)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/elf/elf_load.c
ra7a16a2f r32254d6 60 60 rtld_t *env; 61 61 #endif 62 errno_t rc; 62 errno_t rc = EOK; 63 elf_finfo_t *finfo = &info->finfo; 63 64 64 rc = elf_load_file(file, 0, &info->finfo);65 rc = elf_load_file(file, 0, finfo); 65 66 if (rc != EOK) { 66 DPRINTF("Failed to load executable '%s'.\n", file_name);67 DPRINTF("Failed to load executable.\n"); 67 68 return rc; 68 69 } 69 70 71 #ifdef CONFIG_RTLD 72 DPRINTF("- prog dynamic: %p\n", finfo->dynamic); 73 rc = rtld_prog_process(finfo, &env); 74 if (rc != EOK) { 75 DPRINTF("Failed to process executable.\n"); 76 return rc; 77 } 78 info->env = env; 79 return EOK; 80 #else 70 81 if (info->finfo.dynamic == NULL) { 71 /* Statically linked program */72 DPRINTF("Binary is statically linked.\n");73 82 info->env = NULL; 74 83 return EOK; 75 84 } 76 85 77 DPRINTF("Binary is dynamically linked.\n"); 78 #ifdef CONFIG_RTLD 79 DPRINTF("- prog dynamic: %p\n", info->finfo.dynamic); 80 81 rc = rtld_prog_process(&info->finfo, &env); 82 info->env = env; 83 #else 84 rc = ENOTSUP; 86 DPRINTF("Error: trying to run a dynamically-linked executable with CONFIG_RTLD disabled.\n"); 87 return ENOTSUP; 85 88 #endif 86 return rc;87 89 } 88 90
Note:
See TracChangeset
for help on using the changeset viewer.