Changeset 0e9b512 in mainline


Ignore:
Timestamp:
2011-04-03T16:31:15Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cf44c14
Parents:
e2098dd7
Message:

Fix mips32 and ppc32 builds.

Location:
uspace
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile.common

    re2098dd7 r0e9b512  
    255255endif
    256256
    257 %.lo: %.S
    258         $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
    259 
    260 %.lo: %.s
    261         $(AS) $(AFLAGS) $< -o $@
     257%.lo: %.S $(DEPEND)
     258        $(CC) $(DEFS) $(LIB_CFLAGS) -D__ASM__ -c $< -o $@
     259ifeq ($(PRECHECK),y)
     260        $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__
     261endif
     262
     263%.lo: %.s $(DEPEND)
     264        $(AS) $(AFLAGS) -o $@ $<
     265ifeq ($(PRECHECK),y)
     266        $(JOBFILE) $(JOB) $< $@ as asm
     267endif
    262268
    263269%.lo: %.c $(DEPEND)
  • uspace/app/dload/arch/mips32/_link.ld.in

    re2098dd7 r0e9b512  
    1414        } :text
    1515        .text : {
    16                 *(.text);
     16                *(.text*);
    1717                *(.rodata*);
    1818        } :text
  • uspace/app/dload/dload.c

    re2098dd7 r0e9b512  
    7070         */
    7171
    72         DPRINTF("Parse program .dynamic section at 0x%x\n", __pcb->dynamic);
     72        DPRINTF("Parse program .dynamic section at %p\n", __pcb->dynamic);
    7373        dynamic_parse(__pcb->dynamic, 0, &prog.dyn);
    7474        prog.bias = 0;
     
    106106         * Finally, run the main program.
    107107         */
    108         DPRINTF("Run program.. (at 0x%lx)\n", (uintptr_t)__pcb->entry);
     108        DPRINTF("Run program.. (at %p)\n", __pcb->entry);
    109109
    110110#ifndef RTLD_DEBUG
  • uspace/lib/c/arch/ppc32/src/tls.c

    re2098dd7 r0e9b512  
    4848}
    4949
     50/*
    5051static void kputint(unsigned i)
    5152{
     
    5960        ) ;
    6061}
     62*/
    6163
    6264typedef struct {
  • uspace/lib/c/rtld/arch/mips32/src/reloc.c

    re2098dd7 r0e9b512  
    3838#include <stdlib.h>
    3939
    40 #include <arch.h>
    4140#include <elf_dyn.h>
    4241#include <symbol.h>
    4342#include <rtld.h>
     43
     44#include <rtld_arch.h>
    4445
    4546void module_process_pre_arch(module_t *m)
     
    5253        uint32_t *got;
    5354        char *str_tab;
    54         int i, j;
     55        unsigned i, j;
    5556
    5657        uint32_t sym_addr;
     
    124125                sym_def = symbol_def_find(str_tab + sym->st_name, m, &dest);
    125126                if (sym_def) {
    126                         sym_addr = symbol_get_addr(sym_def, dest);
     127                        sym_addr = (uintptr_t) symbol_get_addr(sym_def, dest);
    127128                        DPRINTF("symbol definition found, addr=0x%x\n", sym_addr);
    128129                } else {
     
    142143void rel_table_process(module_t *m, elf_rel_t *rt, size_t rt_size)
    143144{
    144         int i;
     145        unsigned i;
    145146
    146147        size_t rt_entries;
     
    154155        elf_symbol_t *sym;
    155156        uint32_t *r_ptr;
    156         uint16_t *r_ptr16;
     157/*      uint16_t *r_ptr16;*/
    157158        char *str_tab;
    158159       
     
    174175        lgotno = m->dyn.arch.lgotno;
    175176
    176         DPRINTF("got=0x%lx, gotsym=%d\n", (uintptr_t) got, gotsym);
     177        DPRINTF("got=0x%x, gotsym=%d\n", (uintptr_t) got, gotsym);
    177178
    178179        DPRINTF("address: 0x%x, entries: %d\n", (uintptr_t)rt, rt_entries);
     
    193194                rel_type = ELF32_R_TYPE(r_info);
    194195                r_ptr = (uint32_t *)(r_offset + m->bias);
    195                 r_ptr16 = (uint16_t *)(r_offset + m->bias);
     196                /*r_ptr16 = (uint16_t *)(r_offset + m->bias);*/
    196197
    197198                if (sym->st_name != 0) {
     
    200201                        DPRINTF("dest bias: 0x%x\n", dest->bias);
    201202                        if (sym_def) {
    202                                 sym_addr = symbol_get_addr(sym_def, dest);
     203                                sym_addr = (uintptr_t) symbol_get_addr(sym_def,
     204                                    dest);
    203205                                DPRINTF("symbol definition found, addr=0x%x\n", sym_addr);
    204206                        } else {
     
    206208                                continue;
    207209                        }
     210                } else {
     211                        sym_def = NULL;
     212                        sym_addr = 0;
    208213                }
    209214
  • uspace/lib/c/rtld/arch/ppc32/src/reloc.c

    re2098dd7 r0e9b512  
    3838#include <stdlib.h>
    3939
    40 #include <arch.h>
    4140#include <elf_dyn.h>
    4241#include <symbol.h>
     
    4443#include <smc.h>
    4544
     45#include <rtld_arch.h>
     46
    4647#define __L(ptr) ((uint32_t)(ptr) & 0x0000ffff)
    4748#define __HA(ptr) ((uint32_t)(ptr) >> 16)
     
    8586{
    8687        uint32_t *plt;
    87         uint32_t *_plt_ent;
     88//      uint32_t *_plt_ent;
    8889       
    8990        /* No lazy linking -- no pre-processing yet. */
     
    9798
    9899        // PLT entries start here. However, each occupies 2 words
    99         _plt_ent = plt + 18;
     100//      _plt_ent = plt + 18;
    100101
    101102        // By definition of the ppc ABI, there's 1:1 correspondence
     
    104105
    105106        uint32_t *_plt_table;
    106         uint32_t *_plt_call;
    107         uint32_t *_plt_resolve;
    108 
    109         _plt_resolve = plt;
    110         _plt_call = plt + 6;
     107//      uint32_t *_plt_call;
     108//      uint32_t *_plt_resolve;
     109
     110//      _plt_resolve = plt;
     111//      _plt_call = plt + 6;
    111112        _plt_table = plt + 18 + plt_n;
    112113
     
    136137void rela_table_process(module_t *m, elf_rela_t *rt, size_t rt_size)
    137138{
    138         int i;
     139        unsigned i;
    139140
    140141        size_t rt_entries;
     
    156157
    157158        uint32_t *plt;
    158         uint32_t *_plt_table;
     159//      uint32_t *_plt_table;
    159160        uint32_t *_plt_ent;
    160161        uint32_t plt_n;
     
    166167        plt_n = m->dyn.plt_rel_sz / sizeof(elf_rela_t);
    167168        _plt_ent = plt+ 18;
    168         _plt_table = plt + 18 + plt_n;
     169//      _plt_table = plt + 18 + plt_n;
    169170
    170171        DPRINTF("parse relocation table\n");
     
    201202                        DPRINTF("dest bias: 0x%x\n", dest->bias);
    202203                        if (sym_def) {
    203                                 sym_addr = symbol_get_addr(sym_def, dest);
     204                                sym_addr = (uintptr_t) symbol_get_addr(
     205                                    sym_def, dest);
    204206                                DPRINTF("symbol definition found, addr=0x%x\n", sym_addr);
    205207                        } else {
     
    207209                                continue;
    208210                        }
     211                } else {
     212                        sym_def = NULL;
     213                        sym_addr = 0;
    209214                }
    210215
     
    247252                         */
    248253                        DPRINTF("fixup R_PPC_COPY (s)\n");
     254
    249255                        sym_size = sym->st_size;
    250256                        if (sym_size != sym_def->st_size) {
  • uspace/lib/c/rtld/include/rtld.h

    re2098dd7 r0e9b512  
    4646
    4747#ifdef RTLD_DEBUG
    48         #define DPRINTF(format, ...) printf(format, ##__VA_ARGS__);
     48        #define DPRINTF(format, ...) printf(format, ##__VA_ARGS__)
    4949#else
    50         #define DPRINTF(format, ...)
     50        #define DPRINTF(format, ...) if (0) printf(format, ##__VA_ARGS__)
    5151#endif
    5252
Note: See TracChangeset for help on using the changeset viewer.