Changeset 49093a4 in mainline


Ignore:
Timestamp:
2008-12-05T22:44:24Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2b1f860
Parents:
965dc18
Message:

Remove obsolete dld-related loader fragments.

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/loader/pcb.h

    r965dc18 r49093a4  
    4848 */
    4949typedef struct {
    50         /** Program entry point */
     50        /** Program entry point. */
    5151        entry_point_t entry;
    5252
    53         /** Number of command-line arguments */
     53        /** Number of command-line arguments. */
    5454        int argc;
    55         /** Command-line arguments */
     55        /** Command-line arguments. */
    5656        char **argv;
    5757
    5858        /*
    59          * ELF-specific data
     59         * ELF-specific data.
    6060         */
    61         /** Pointer to ELF dynamic section of the program */
     61        /** Pointer to ELF dynamic section of the program. */
    6262        void *dynamic;
    63         /** Pointer to dynamic section of the runtime linker */
    64         void *rtld_dynamic;
    65         /** Runtime-linker load bias */
    66         uintptr_t rtld_bias;
    6763} pcb_t;
    6864
     65/**
     66 * A pointer to the program control block. Having received the PCB pointer,
     67 * the C library startup code stores it here for later use.
     68 */
    6969extern pcb_t *__pcb;
    7070
  • uspace/srv/loader/main.c

    r965dc18 r49093a4  
    6060#include <elf_load.h>
    6161
    62 /**
    63  * Bias used for loading the dynamic linker. This will be soon replaced
    64  * by automatic placement.
    65  */
    66 #define RTLD_BIAS 0x80000
    67 
    6862/** Pathname of the file that will be loaded */
    6963static char *pathname = NULL;
     
    230224        int rc;
    231225
    232 //      printf("Load program '%s'\n", pathname);
    233 
    234226        rc = elf_load_file(pathname, 0, &prog_info);
    235227        if (rc < 0) {
    236                 printf("failed to load program\n");
     228                printf("Failed to load executable '%s'.\n", pathname);
    237229                ipc_answer_0(rid, EINVAL);
    238230                return 1;
    239231        }
    240232
    241 //      printf("Create PCB\n");
    242233        elf_create_pcb(&prog_info, &pcb);
    243234
     
    247238        if (prog_info.interp == NULL) {
    248239                /* Statically linked program */
    249 //              printf("Run statically linked program\n");
    250 //              printf("entry point: 0x%lx\n", prog_info.entry);
    251240                is_dyn_linked = false;
    252241                ipc_answer_0(rid, EOK);
     
    254243        }
    255244
    256         printf("Load dynamic linker '%s'\n", prog_info.interp);
    257         rc = elf_load_file("/rtld.so", RTLD_BIAS, &interp_info);
     245        rc = elf_load_file(prog_info.interp, 0, &interp_info);
    258246        if (rc < 0) {
    259                 printf("failed to load dynamic linker\n");
     247                printf("Failed to load interpreter '%s.'\n", prog_info.interp);
    260248                ipc_answer_0(rid, EINVAL);
    261249                return 1;
    262250        }
    263 
    264         /*
    265          * Provide dynamic linker with some useful data
    266          */
    267         pcb.rtld_dynamic = interp_info.dynamic;
    268         pcb.rtld_bias = RTLD_BIAS;
    269251
    270252        is_dyn_linked = true;
Note: See TracChangeset for help on using the changeset viewer.