Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/loader/elf_load.c

    r08c9f7d5 ra000878c  
    6060#define DPRINTF(...)
    6161
    62 static char *error_codes[] = {
     62static const char *error_codes[] = {
    6363        "no error",
    6464        "invalid image",
     
    9595 * pointed to by @a info.
    9696 *
    97  * @param file_name     Path to the ELF file.
    98  * @param so_bias       Bias to use if the file is a shared object.
    99  * @param info          Pointer to a structure for storing information
    100  *                      extracted from the binary.
     97 * @param file_name Path to the ELF file.
     98 * @param so_bias   Bias to use if the file is a shared object.
     99 * @param info      Pointer to a structure for storing information
     100 *                  extracted from the binary.
    101101 *
    102102 * @return EOK on success or negative error code.
    103  */
    104 int elf_load_file(char *file_name, size_t so_bias, elf_info_t *info)
     103 *
     104 */
     105int elf_load_file(const char *file_name, size_t so_bias, elf_info_t *info)
    105106{
    106107        elf_ld_t elf;
     
    130131 * earlier with elf_load_file(). This function does not return.
    131132 *
    132  * @param info  Info structure filled earlier by elf_load_file()
     133 * @param info Info structure filled earlier by elf_load_file()
     134 *
    133135 */
    134136void elf_run(elf_info_t *info, pcb_t *pcb)
     
    280282 * @return NULL terminated description of error.
    281283 */
    282 char *elf_error(unsigned int rc)
     284const char *elf_error(unsigned int rc)
    283285{
    284286        assert(rc < sizeof(error_codes) / sizeof(char *));
     
    342344        seg_ptr = (void *) seg_addr;
    343345
    344         DPRINTF("Load segment at addr 0x%x, size 0x%x\n", seg_addr,
    345                 entry->p_memsz);       
     346        DPRINTF("Load segment at addr %p, size 0x%x\n", seg_addr,
     347                entry->p_memsz);
    346348
    347349        if (entry->p_align > 1) {
     
    370372        mem_sz = entry->p_memsz + (entry->p_vaddr - base);
    371373
    372         DPRINTF("Map to seg_addr=0x%x-0x%x.\n", seg_addr,
     374        DPRINTF("Map to seg_addr=%p-%p.\n", seg_addr,
    373375        entry->p_vaddr + bias + ALIGN_UP(entry->p_memsz, PAGE_SIZE));
    374376
     
    384386        }
    385387
    386         DPRINTF("as_area_create(0x%lx, 0x%x, %d) -> 0x%lx\n",
     388        DPRINTF("as_area_create(%p, 0x%x, %d) -> 0x%lx\n",
    387389                base + bias, mem_sz, flags, (uintptr_t)a);
    388390
     
    461463                elf->info->dynamic =
    462464                    (void *)((uint8_t *)entry->sh_addr + elf->bias);
    463                 DPRINTF("Dynamic section found at 0x%x.\n",
     465                DPRINTF("Dynamic section found at %p.\n",
    464466                        (uintptr_t)elf->info->dynamic);
    465467                break;
Note: See TracChangeset for help on using the changeset viewer.