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


Ignore:
Timestamp:
2025-03-02T20:02:33Z (5 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
8cdf360
Parents:
7debda3 (diff), 4285f384 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge 'upstream/master' into helenraid-para

File:
1 edited

Legend:

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

    r7debda3 rd30e067  
    6060        rtld_t *env;
    6161#endif
    62         errno_t rc;
     62        errno_t rc = EOK;
     63        elf_finfo_t *finfo = &info->finfo;
    6364
    64         rc = elf_load_file(file, 0, &info->finfo);
     65        rc = elf_load_file(file, 0, finfo);
    6566        if (rc != EOK) {
    66                 DPRINTF("Failed to load executable '%s'.\n", file_name);
     67                DPRINTF("Failed to load executable.\n");
    6768                return rc;
    6869        }
    6970
     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
    7081        if (info->finfo.dynamic == NULL) {
    71                 /* Statically linked program */
    72                 DPRINTF("Binary is statically linked.\n");
    7382                info->env = NULL;
    7483                return EOK;
    7584        }
    7685
    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;
    8588#endif
    86         return rc;
    8789}
    8890
Note: See TracChangeset for help on using the changeset viewer.