Changeset acb14ce in mainline for uspace/lib/c/generic/elf/elf_load.c


Ignore:
Timestamp:
2025-02-02T22:06:07Z (6 months ago)
Author:
Matěj Volf <git@…>
Children:
c095552c
Parents:
bdcf71e
git-author:
Matěj Volf <git@…> (2025-02-02 21:59:42)
git-committer:
Matěj Volf <git@…> (2025-02-02 22:06:07)
Message:

unify rtld loading implementation of static/dynamic executables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/elf/elf_load.c

    rbdcf71e racb14ce  
    6969        }
    7070
     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 '%s'.\n", file_name);
     76                return rc;
     77        }
     78        info->env = env;
     79        return EOK;
     80#else
    7181        if (info->finfo.dynamic == NULL) {
    72                 /* Statically linked program */
    73                 DPRINTF("Binary is statically linked.\n");
    7482                info->env = NULL;
    75 #ifdef CONFIG_RTLD
    76                 rc = rtld_init_static(finfo, &env);
    77                 info->env = env;
    78 #endif
    7983                return EOK;
    8084        }
    8185
    82         DPRINTF("Binary is dynamically linked.\n");
    83 #ifdef CONFIG_RTLD
    84         DPRINTF("- prog dynamic: %p\n", finfo->dynamic);
    85         rc = rtld_prog_process(finfo, &env);
    86         info->env = env;
    87 #else
    88         rc = ENOTSUP;
     86        DPRINTF("Error: trying to run a dynamically-linked executable with CONFIG_RTLD disabled.\n");
     87        return ENOTSUP;
    8988#endif
    90         return rc;
    9189}
    9290
Note: See TracChangeset for help on using the changeset viewer.