Changeset 31ea2a7 in mainline for uspace/lib/c/generic/rtld
- Timestamp:
- 2025-01-26T17:53:49Z (14 months ago)
- Children:
- f215c6ef
- Parents:
- eff458d
- git-author:
- Matěj Volf <git@…> (2025-01-25 21:36:13)
- git-committer:
- Matěj Volf <git@…> (2025-01-26 17:53:49)
- File:
-
- 1 edited
-
uspace/lib/c/generic/rtld/rtld.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/rtld/rtld.c
reff458d r31ea2a7 45 45 static rtld_t rt_env_static; 46 46 47 /** Initialize the runtime linker for use in a statically-linked executable. */47 /** Initialize a minimal runtime linker environment for use in executables loaded directly by kernel. */ 48 48 errno_t rtld_init_static(void) 49 49 { … … 65 65 } 66 66 67 /** Initialize and process a dynamically linked executable.67 /** Initialize and process an executable, static or dynamic. 68 68 * 69 69 * @param p_info Program info … … 75 75 module_t *prog; 76 76 77 DPRINTF("Load dynamically linked program.\n");77 DPRINTF("Load program with rtld.\n"); 78 78 79 79 /* Allocate new RTLD environment to pass to the loaded program */ … … 95 95 */ 96 96 97 DPRINTF("Parse program .dynamic section at %p\n", p_info->dynamic); 98 dynamic_parse(p_info->dynamic, 0, &prog->dyn); 97 if (p_info->dynamic) { 98 DPRINTF("Parse program .dynamic section at %p\n", p_info->dynamic); 99 dynamic_parse(p_info->dynamic, 0, &prog->dyn); 100 } else { 101 DPRINTF("Program is statically linked\n"); 102 } 99 103 prog->bias = 0; 100 104 prog->dyn.soname = "[program]"; … … 124 128 */ 125 129 126 DPRINTF("Load all program dependencies\n"); 127 errno_t rc = module_load_deps(prog, 0); 128 if (rc != EOK) { 129 return rc; 130 if (p_info->dynamic) { 131 DPRINTF("Load all program dependencies\n"); 132 errno_t rc = module_load_deps(prog, 0); 133 if (rc != EOK) { 134 free(prog); 135 free(env); 136 return rc; 137 } 130 138 } 131 139
Note:
See TracChangeset
for help on using the changeset viewer.
