Changeset bdca26a in mainline for uspace/lib/c/generic/elf/elf_load.c
- Timestamp:
- 2019-05-26T13:21:50Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8aea932
- Parents:
- 967e7a1
- git-author:
- Matthieu Riolo <matthieu.riolo@…> (2019-05-17 14:27:34)
- git-committer:
- Jakub Jermář <jakub@…> (2019-05-26 13:21:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/elf/elf_load.c
r967e7a1 rbdca26a 53 53 * @param file File handle 54 54 * @param info Place to store ELF program information 55 * @return E E_OK on success or an EE_xerror code55 * @return EOK on success or an error code 56 56 */ 57 int elf_load(int file, elf_info_t *info)57 errno_t elf_load(int file, elf_info_t *info) 58 58 { 59 59 #ifdef CONFIG_RTLD 60 60 rtld_t *env; 61 61 #endif 62 int rc;62 errno_t rc; 63 63 64 64 rc = elf_load_file(file, 0, &info->finfo); 65 if (rc != E E_OK) {65 if (rc != EOK) { 66 66 DPRINTF("Failed to load executable '%s'.\n", file_name); 67 67 return rc; … … 72 72 DPRINTF("Binary is statically linked.\n"); 73 73 info->env = NULL; 74 return E E_OK;74 return EOK; 75 75 } 76 76 … … 79 79 DPRINTF("- prog dynamic: %p\n", info->finfo.dynamic); 80 80 81 errno_t rc2 = rtld_prog_process(&info->finfo, &env); 82 switch (rc2) { 83 case EOK: 84 rc = EE_OK; 85 break; 86 case ENOMEM: 87 rc = EE_MEMORY; 88 break; 89 default: 90 DPRINTF("Unexpected error code from rtld_prog_process(): %s\n", str_error_name(rc2)); 91 rc = EE_INVALID; 92 } 93 81 rc = rtld_prog_process(&info->finfo, &env); 94 82 info->env = env; 95 83 #else 96 rc = E E_UNSUPPORTED;84 rc = ENOTSUP; 97 85 #endif 98 86 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.