Mercurial > ecos
comparison packages/services/objloader/current/src/objelf.c @ 2013:8bf90d16b837
* include/objelf.h: Include hal_tables.h otherwise we get strange
linker errors.
* cdl/objloader.cdl: Rearranged the building of the test case.
* include/relocate_i386.h (New):
* src/relocate_i386.c (New): Added a relocator for i386.
* src/objelf.c: Fixed various Elf_Rel vs Elf_Rela issues.
* test/load_mods.c:
* test/library/hello.c: Modified to make use of the eCos test
infrastructure. Uses a romfs to hold the object file to be loaded.
| author | asl |
|---|---|
| date | Fri, 08 Jul 2005 20:14:13 +0000 |
| parents | 662e1b34b811 |
| children | 6fd46febe457 |
comparison
equal
deleted
inserted
replaced
| 2012:fa05b44883a4 | 2013:8bf90d16b837 |
|---|---|
| 169 | 169 |
| 170 for ( j = 0; j < r_entries; j++ ) | 170 for ( j = 0; j < r_entries; j++ ) |
| 171 { | 171 { |
| 172 sprintf( strname, | 172 sprintf( strname, |
| 173 "%08X %08X ", | 173 "%08X %08X ", |
| 174 #if ELF_ARCH_RELTYPE == Elf_Rela | |
| 174 p_rela[j].r_offset, | 175 p_rela[j].r_offset, |
| 175 p_rela[j].r_info ); | 176 p_rela[j].r_info |
| 177 #else | |
| 178 p_rel[j].r_offset, | |
| 179 p_rel[j].r_info | |
| 180 #endif | |
| 181 ); | |
| 176 | 182 |
| 177 diag_printf( strname ); | 183 diag_printf( strname ); |
| 178 | 184 |
| 185 #if ELF_ARCH_RELTYPE == Elf_Rela | |
| 179 cyg_uint8 sym_type = ELF32_R_SYM( p_rela[j].r_info ); | 186 cyg_uint8 sym_type = ELF32_R_SYM( p_rela[j].r_info ); |
| 187 #else | |
| 188 cyg_uint8 sym_type = ELF32_R_SYM( p_rel[j].r_info ); | |
| 189 #endif | |
| 180 if ( strlen ( p_strtab + p_symtab[sym_type].st_name ) > 0 ) | 190 if ( strlen ( p_strtab + p_symtab[sym_type].st_name ) > 0 ) |
| 181 diag_printf( p_strtab + p_symtab[sym_type].st_name ); | 191 diag_printf( p_strtab + p_symtab[sym_type].st_name ); |
| 182 else | 192 else |
| 183 { | 193 { |
| 184 // If the symbol name is not available, then print | 194 // If the symbol name is not available, then print |
| 218 | 228 |
| 219 // And now return the address of the data. | 229 // And now return the address of the data. |
| 220 return (void*)( addr + p_symtab[sym_index].st_value); | 230 return (void*)( addr + p_symtab[sym_index].st_value); |
| 221 } | 231 } |
| 222 | 232 |
| 223 static void | 233 void |
| 224 *cyg_ldr_external_address( PELF_OBJECT p, cyg_uint32 sym_index ) | 234 *cyg_ldr_external_address( PELF_OBJECT p, cyg_uint32 sym_index ) |
| 225 { | 235 { |
| 226 cyg_uint8* tmp2; | 236 cyg_uint8* tmp2; |
| 227 Elf32_Sym *p_symtab; | 237 Elf32_Sym *p_symtab; |
| 228 cyg_uint8 *p_strtab; | 238 cyg_uint8 *p_strtab; |
