Changeset 31ea2a7 in mainline for uspace/lib/c/generic/elf


Ignore:
Timestamp:
2025-01-26T17:53:49Z (12 months ago)
Author:
Matěj Volf <git@…>
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)
Message:

init RTLD runtime at load time even for statically linked binaries

before this, main_fibril of a statically linked binary had wrong thread-local storage

please see PR description for an elaborate explanation of what and why was wrong

File:
1 edited

Legend:

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

    reff458d r31ea2a7  
    5757errno_t elf_load(int file, elf_info_t *info)
    5858{
    59 #ifdef CONFIG_RTLD
    60         rtld_t *env;
    61 #endif
    62         errno_t rc;
     59        errno_t rc = EOK;
    6360
    6461        rc = elf_load_file(file, 0, &info->finfo);
     
    6865        }
    6966
    70         if (info->finfo.dynamic == NULL) {
    71                 /* Statically linked program */
    72                 DPRINTF("Binary is statically linked.\n");
    73                 info->env = NULL;
    74                 return EOK;
    75         }
    76 
    77         DPRINTF("Binary is dynamically linked.\n");
    7867#ifdef CONFIG_RTLD
    79         DPRINTF("- prog dynamic: %p\n", info->finfo.dynamic);
    80 
     68        rtld_t *env;
    8169        rc = rtld_prog_process(&info->finfo, &env);
    8270        info->env = env;
Note: See TracChangeset for help on using the changeset viewer.