Changeset 0e9b512 in mainline
- Timestamp:
- 2011-04-03T16:31:15Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cf44c14
- Parents:
- e2098dd7
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/Makefile.common
re2098dd7 r0e9b512 255 255 endif 256 256 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 $@ 259 ifeq ($(PRECHECK),y) 260 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__ 261 endif 262 263 %.lo: %.s $(DEPEND) 264 $(AS) $(AFLAGS) -o $@ $< 265 ifeq ($(PRECHECK),y) 266 $(JOBFILE) $(JOB) $< $@ as asm 267 endif 262 268 263 269 %.lo: %.c $(DEPEND) -
uspace/app/dload/arch/mips32/_link.ld.in
re2098dd7 r0e9b512 14 14 } :text 15 15 .text : { 16 *(.text );16 *(.text*); 17 17 *(.rodata*); 18 18 } :text -
uspace/app/dload/dload.c
re2098dd7 r0e9b512 70 70 */ 71 71 72 DPRINTF("Parse program .dynamic section at 0x%x\n", __pcb->dynamic);72 DPRINTF("Parse program .dynamic section at %p\n", __pcb->dynamic); 73 73 dynamic_parse(__pcb->dynamic, 0, &prog.dyn); 74 74 prog.bias = 0; … … 106 106 * Finally, run the main program. 107 107 */ 108 DPRINTF("Run program.. (at 0x%lx)\n", (uintptr_t)__pcb->entry);108 DPRINTF("Run program.. (at %p)\n", __pcb->entry); 109 109 110 110 #ifndef RTLD_DEBUG -
uspace/lib/c/arch/ppc32/src/tls.c
re2098dd7 r0e9b512 48 48 } 49 49 50 /* 50 51 static void kputint(unsigned i) 51 52 { … … 59 60 ) ; 60 61 } 62 */ 61 63 62 64 typedef struct { -
uspace/lib/c/rtld/arch/mips32/src/reloc.c
re2098dd7 r0e9b512 38 38 #include <stdlib.h> 39 39 40 #include <arch.h>41 40 #include <elf_dyn.h> 42 41 #include <symbol.h> 43 42 #include <rtld.h> 43 44 #include <rtld_arch.h> 44 45 45 46 void module_process_pre_arch(module_t *m) … … 52 53 uint32_t *got; 53 54 char *str_tab; 54 inti, j;55 unsigned i, j; 55 56 56 57 uint32_t sym_addr; … … 124 125 sym_def = symbol_def_find(str_tab + sym->st_name, m, &dest); 125 126 if (sym_def) { 126 sym_addr = symbol_get_addr(sym_def, dest);127 sym_addr = (uintptr_t) symbol_get_addr(sym_def, dest); 127 128 DPRINTF("symbol definition found, addr=0x%x\n", sym_addr); 128 129 } else { … … 142 143 void rel_table_process(module_t *m, elf_rel_t *rt, size_t rt_size) 143 144 { 144 inti;145 unsigned i; 145 146 146 147 size_t rt_entries; … … 154 155 elf_symbol_t *sym; 155 156 uint32_t *r_ptr; 156 uint16_t *r_ptr16; 157 /* uint16_t *r_ptr16;*/ 157 158 char *str_tab; 158 159 … … 174 175 lgotno = m->dyn.arch.lgotno; 175 176 176 DPRINTF("got=0x% lx, gotsym=%d\n", (uintptr_t) got, gotsym);177 DPRINTF("got=0x%x, gotsym=%d\n", (uintptr_t) got, gotsym); 177 178 178 179 DPRINTF("address: 0x%x, entries: %d\n", (uintptr_t)rt, rt_entries); … … 193 194 rel_type = ELF32_R_TYPE(r_info); 194 195 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);*/ 196 197 197 198 if (sym->st_name != 0) { … … 200 201 DPRINTF("dest bias: 0x%x\n", dest->bias); 201 202 if (sym_def) { 202 sym_addr = symbol_get_addr(sym_def, dest); 203 sym_addr = (uintptr_t) symbol_get_addr(sym_def, 204 dest); 203 205 DPRINTF("symbol definition found, addr=0x%x\n", sym_addr); 204 206 } else { … … 206 208 continue; 207 209 } 210 } else { 211 sym_def = NULL; 212 sym_addr = 0; 208 213 } 209 214 -
uspace/lib/c/rtld/arch/ppc32/src/reloc.c
re2098dd7 r0e9b512 38 38 #include <stdlib.h> 39 39 40 #include <arch.h>41 40 #include <elf_dyn.h> 42 41 #include <symbol.h> … … 44 43 #include <smc.h> 45 44 45 #include <rtld_arch.h> 46 46 47 #define __L(ptr) ((uint32_t)(ptr) & 0x0000ffff) 47 48 #define __HA(ptr) ((uint32_t)(ptr) >> 16) … … 85 86 { 86 87 uint32_t *plt; 87 uint32_t *_plt_ent;88 // uint32_t *_plt_ent; 88 89 89 90 /* No lazy linking -- no pre-processing yet. */ … … 97 98 98 99 // PLT entries start here. However, each occupies 2 words 99 _plt_ent = plt + 18;100 // _plt_ent = plt + 18; 100 101 101 102 // By definition of the ppc ABI, there's 1:1 correspondence … … 104 105 105 106 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; 111 112 _plt_table = plt + 18 + plt_n; 112 113 … … 136 137 void rela_table_process(module_t *m, elf_rela_t *rt, size_t rt_size) 137 138 { 138 inti;139 unsigned i; 139 140 140 141 size_t rt_entries; … … 156 157 157 158 uint32_t *plt; 158 uint32_t *_plt_table;159 // uint32_t *_plt_table; 159 160 uint32_t *_plt_ent; 160 161 uint32_t plt_n; … … 166 167 plt_n = m->dyn.plt_rel_sz / sizeof(elf_rela_t); 167 168 _plt_ent = plt+ 18; 168 _plt_table = plt + 18 + plt_n;169 // _plt_table = plt + 18 + plt_n; 169 170 170 171 DPRINTF("parse relocation table\n"); … … 201 202 DPRINTF("dest bias: 0x%x\n", dest->bias); 202 203 if (sym_def) { 203 sym_addr = symbol_get_addr(sym_def, dest); 204 sym_addr = (uintptr_t) symbol_get_addr( 205 sym_def, dest); 204 206 DPRINTF("symbol definition found, addr=0x%x\n", sym_addr); 205 207 } else { … … 207 209 continue; 208 210 } 211 } else { 212 sym_def = NULL; 213 sym_addr = 0; 209 214 } 210 215 … … 247 252 */ 248 253 DPRINTF("fixup R_PPC_COPY (s)\n"); 254 249 255 sym_size = sym->st_size; 250 256 if (sym_size != sym_def->st_size) { -
uspace/lib/c/rtld/include/rtld.h
re2098dd7 r0e9b512 46 46 47 47 #ifdef RTLD_DEBUG 48 #define DPRINTF(format, ...) printf(format, ##__VA_ARGS__) ;48 #define DPRINTF(format, ...) printf(format, ##__VA_ARGS__) 49 49 #else 50 #define DPRINTF(format, ...) 50 #define DPRINTF(format, ...) if (0) printf(format, ##__VA_ARGS__) 51 51 #endif 52 52
Note:
See TracChangeset
for help on using the changeset viewer.