Changeset d8c70ba6 in rtems
- Timestamp:
- 01/15/19 06:47:41 (5 years ago)
- Branches:
- 5, master
- Children:
- 194eb403
- Parents:
- 4408603
- git-author:
- Chris Johns <chrisj@…> (01/15/19 06:47:41)
- git-committer:
- Chris Johns <chrisj@…> (02/08/19 23:06:34)
- Files:
-
- 15 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/include/rtems/rtl/rtl-obj.h
r4408603 rd8c70ba6 1 1 /* 2 * COPYRIGHT (c) 2012 Chris Johns <chrisj@rtems.org>2 * COPYRIGHT (c) 2012,2019 Chris Johns <chrisj@rtems.org> 3 3 * 4 4 * The license and distribution terms for this file may be … … 221 221 uint32_t obj_num; /**< The count of elf files in an rtl 222 222 * obj. */ 223 void* trampoline; /**< Trampoline memory. Used for fixups or 224 * veneers */ 225 size_t tramp_size; /**< Size of the tramopline memory. */ 226 void* tramp_brk; /**< Trampoline memory allocator. MD 227 * relocators can take memory from the 228 * break upto the size. */ 223 229 struct link_map* linkmap; /**< For GDB. */ 224 230 void* loader; /**< The file details specific to a … … 351 357 return (sym >= obj->global_table && 352 358 sym < (obj->global_table + obj->global_syms)); 359 } 360 361 /** 362 * Is there space in the trampoline memory for a trapoline. 363 * 364 * @param obj The object file's descriptor to check for available space. 365 * @param size The size to be allocated. 366 * @retval bool Returns @true if the space is available. 367 */ 368 static inline bool rtems_rtl_obj_has_ramp_space (const rtems_rtl_obj* obj, 369 const size_t size) 370 { 371 return (obj->trampoline != NULL && 372 ((obj->tramp_brk - obj->trampoline) + size) <= obj->tramp_size); 353 373 } 354 374 … … 478 498 479 499 /** 500 * Allocate a table for trampoline fixup calls. 501 * 502 * @param obj The object file's descriptor. 503 * @retval true The table was allocated. 504 * @retval false The alloction failed. 505 */ 506 bool rtems_rtl_obj_alloc_trampoline (rtems_rtl_obj* obj); 507 508 /** 509 * Erase the object file descriptor's trampoline table.. 510 * 511 * @param obj The object file's descriptor. 512 */ 513 void rtems_rtl_obj_erase_trampoline (rtems_rtl_obj* obj); 514 515 /** 480 516 * Allocate a table for dependent objects. 481 517 * -
cpukit/libdl/rtl-elf.c
r4408603 rd8c70ba6 88 88 *symbol = rtems_rtl_symbol_obj_find (obj, symname); 89 89 if (!*symbol) 90 { 91 rtems_rtl_set_error (EINVAL, "global symbol not found: %s", symname); 92 return false; 93 } 90 return false; 94 91 95 92 *value = (Elf_Addr) (*symbol)->value; … … 101 98 sect = rtems_rtl_obj_find_section_by_index (obj, sym->st_shndx); 102 99 if (!sect) 103 { 104 rtems_rtl_set_error (EINVAL, "reloc symbol's section not found"); 105 return false; 106 } 100 return false; 107 101 108 102 *value = sym->st_value + (Elf_Addr) sect->base; … … 146 140 { 147 141 rtems_rtl_elf_reloc_data* rd = (rtems_rtl_elf_reloc_data*) data; 142 143 /* 144 * Check the reloc record to see if a trampoline is needed. 145 */ 146 if (is_rela) 147 { 148 const Elf_Rela* rela = (const Elf_Rela*) relbuf; 149 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) 150 printf ("rtl: rela tramp: sym:%s(%d)=%08jx type:%d off:%08jx addend:%d\n", 151 symname, (int) ELF_R_SYM (rela->r_info), 152 (uintmax_t) symvalue, (int) ELF_R_TYPE (rela->r_info), 153 (uintmax_t) rela->r_offset, (int) rela->r_addend); 154 if (!rtems_rtl_elf_relocate_rela_tramp (obj, rela, targetsect, 155 symname, sym->st_info, symvalue)) 156 return false; 157 } 158 else 159 { 160 const Elf_Rel* rel = (const Elf_Rel*) relbuf; 161 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) 162 printf ("rtl: rel tramp: sym:%s(%d)=%08jx type:%d off:%08jx\n", 163 symname, (int) ELF_R_SYM (rel->r_info), 164 (uintmax_t) symvalue, (int) ELF_R_TYPE (rel->r_info), 165 (uintmax_t) rel->r_offset); 166 if (!rtems_rtl_elf_relocate_rel_tramp (obj, rel, targetsect, 167 symname, sym->st_info, symvalue)) 168 return false; 169 } 170 148 171 /* 149 172 * If the symbol has been resolved and there is a symbol name it is a global … … 154 177 ++rd->unresolved; 155 178 } 156 else if ( resolved &&symname != NULL)179 else if (symname != NULL) 157 180 { 158 181 /* … … 555 578 556 579 return true; 580 } 581 582 static bool 583 rtems_rtl_elf_alloc_trampoline (rtems_rtl_obj* obj, size_t unresolved) 584 { 585 /* 586 * Add on enough space to handle the unresolved externals that need to be 587 * resolved at some point in time. They could all require fixups and 588 * trampolines. 589 */ 590 obj->tramp_size += 591 rtems_rtl_elf_relocate_tramp_max_size () * unresolved; 592 return rtems_rtl_obj_alloc_trampoline (obj); 557 593 } 558 594 … … 1298 1334 return false; 1299 1335 1336 /* 1337 * Parse the relocation records. It lets us know how many dependents 1338 * and fixup trampolines there are. 1339 */ 1300 1340 if (!rtems_rtl_obj_relocate (obj, fd, rtems_rtl_elf_relocs_parser, &relocs)) 1301 1341 return false; 1302 1342 1303 1343 if (!rtems_rtl_elf_dependents (obj, &relocs)) 1344 return false; 1345 1346 if (!rtems_rtl_elf_alloc_trampoline (obj, relocs.unresolved)) 1304 1347 return false; 1305 1348 -
cpukit/libdl/rtl-elf.h
r4408603 rd8c70ba6 53 53 54 54 /** 55 * Relocation trampoline relocation data. 56 */ 57 typedef struct rtems_rtl_mdreloc_trmap 58 { 59 bool parsing; /**< The reloc records are being parsed. */ 60 void* tampolines; /**< The trampoline memory. */ 61 size_t size; /**< The trampoline size. */ 62 } rtems_rtl_mdreloc_tramp; 63 64 /** 55 65 * Maximum string length. This a read buffering limit rather than a 56 66 * specific ELF length. I hope this is ok as I am concerned about … … 82 92 83 93 /** 94 * Architecture specific relocation maximum trampoline size. A trampoline entry 95 * of this size is allocated for each unresolved external. 96 * 97 * @return size_t The maximum size of a trampoline for this architecture. 98 */ 99 size_t rtems_rtl_elf_relocate_tramp_max_size (void); 100 101 /** 102 * Architecture specific relocation trampoline handler compiled in for a 103 * specific architecture by the build system. The handler determines if the 104 * relocation record requires a trampoline. 105 * 106 * @param obj The object file being relocated. 107 * @param rel The ELF relocation record. 108 * @param sect The section of the object file the relocation is for. 109 * @param symname The symbol's name. 110 * @param syminfo The ELF symbol info field. 111 * @param symvalue If a symbol is referenced, this is the symbols value. 112 * @retval bool The relocation is valid. 113 * @retval bool The relocation is not valid. 114 */ 115 bool rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 116 const Elf_Rel* rel, 117 const rtems_rtl_obj_sect* sect, 118 const char* symname, 119 const Elf_Byte syminfo, 120 const Elf_Word symvalue); 121 122 /** 84 123 * Architecture specific relocation handler compiled in for a specific 85 124 * architecture by the build system. The handler applies the relocation … … 87 126 * 88 127 * @param obj The object file being relocated. 128 * @param rela The ELF addend relocation record. 129 * @param sect The section of the object file the relocation is for. 130 * @param symname The symbol's name. 131 * @param syminfo The ELF symbol info field. 132 * @param symvalue If a symbol is referenced, this is the symbols value. 133 * @retval bool The relocation is valid. 134 * @retval bool The relocation is not valid. 135 */ 136 bool rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 137 const Elf_Rela* rela, 138 const rtems_rtl_obj_sect* sect, 139 const char* symname, 140 const Elf_Byte syminfo, 141 const Elf_Word symvalue); 142 143 /** 144 * Architecture specific relocation handler compiled in for a specific 145 * architecture by the build system. The handler applies the relocation 146 * to the target. 147 * 148 * @param obj The object file being relocated. 89 149 * @param rel The ELF relocation record. 90 150 * @param sect The section of the object file the relocation is for. … … 95 155 * @retval bool The relocation could not be applied. 96 156 */ 97 bool rtems_rtl_elf_relocate_rel ( const rtems_rtl_obj*obj,157 bool rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 98 158 const Elf_Rel* rel, 99 159 const rtems_rtl_obj_sect* sect, … … 116 176 * @retval bool The relocation could not be applied. 117 177 */ 118 bool rtems_rtl_elf_relocate_rela ( const rtems_rtl_obj*obj,178 bool rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 119 179 const Elf_Rela* rela, 120 180 const rtems_rtl_obj_sect* sect, -
cpukit/libdl/rtl-mdreloc-arm.c
r4408603 rd8c70ba6 34 34 load_ptr(void *where) 35 35 { 36 37 38 39 40 36 Elf_Addr res; 37 38 memcpy(&res, where, sizeof(res)); 39 40 return (res); 41 41 } 42 42 … … 44 44 store_ptr(void *where, Elf_Addr val) 45 45 { 46 47 memcpy(where, &val, sizeof(val)); 46 memcpy(where, &val, sizeof(val)); 48 47 } 49 48 … … 68 67 } 69 68 69 static void* 70 set_veneer(void* tramopline, Elf_Addr target) 71 { 72 /* 73 * http://shell-storm.org/online/Online-Assembler-and-Disassembler/ 74 * 75 * ldr.w pc, [pc] 76 */ 77 uint32_t* tramp = (uint32_t*) tramopline; 78 *tramp++ = 0xf000f8df; 79 *tramp++ = (uint32_t) target; 80 return tramp; 81 } 82 83 static size_t 84 get_veneer_size(int type) 85 { 86 (void) type; 87 return 8; 88 } 89 90 size_t 91 rtems_rtl_elf_relocate_tramp_max_size (void) 92 { 93 return 8; 94 } 95 70 96 uint32_t 71 97 rtems_rtl_elf_section_flags (const rtems_rtl_obj* obj, … … 85 111 86 112 bool 87 rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, 113 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 114 const Elf_Rela* rela, 115 const rtems_rtl_obj_sect* sect, 116 const char* symname, 117 const Elf_Byte syminfo, 118 const Elf_Word symvalue) 119 { 120 (void) obj; 121 (void) rela; 122 (void) sect; 123 (void) symname; 124 (void) syminfo; 125 (void) symvalue; 126 rtems_rtl_set_error (EINVAL, "rela type record not supported"); 127 return false; 128 } 129 130 bool 131 rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 88 132 const Elf_Rela* rela, 89 133 const rtems_rtl_obj_sect* sect, … … 92 136 const Elf_Word symvalue) 93 137 { 138 (void) obj; 139 (void) rela; 140 (void) sect; 141 (void) symname; 142 (void) syminfo; 143 (void) symvalue; 94 144 rtems_rtl_set_error (EINVAL, "rela type record not supported"); 95 145 return false; 96 146 } 97 147 98 bool 99 rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, 100 const Elf_Rel* rel, 101 const rtems_rtl_obj_sect* sect, 102 const char* symname, 103 const Elf_Byte syminfo, 104 const Elf_Word symvalue) 148 static bool 149 rtems_rtl_elf_relor_rel (rtems_rtl_obj* obj, 150 const Elf_Rel* rel, 151 const rtems_rtl_obj_sect* sect, 152 const char* symname, 153 const Elf_Byte syminfo, 154 const Elf_Word symvalue, 155 const bool parsing) 105 156 { 106 157 Elf_Addr *where; … … 143 194 144 195 if (((Elf_Sword)tmp > 0x7fffff) || ((Elf_Sword)tmp < -0x800000)) { 145 printf("CALL/JUMP24 Overflow\n"); 146 return false; 147 } 148 149 *where = (*where & 0xff000000) | (tmp & 0xffffff); 150 151 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) 152 printf ("rtl: JUMP24/PC24/CALL %p @ %p in %s\n", 153 (void *)*where, where, rtems_rtl_obj_oname (obj)); 154 196 Elf_Word tramp_addr; 197 size_t tramp_size = get_veneer_size(ELF_R_TYPE(rel->r_info)); 198 199 if (parsing) { 200 obj->tramp_size += tramp_size; 201 return true; 202 } 203 204 if (!rtems_rtl_obj_has_ramp_space (obj, tramp_size)) { 205 rtems_rtl_set_error (EINVAL, 206 "%s: CALL/JUMP24: overflow: no tramp memory", 207 sect->name); 208 return false; 209 } 210 211 tramp_addr = ((Elf_Addr) obj->tramp_brk) | (symvalue & 1); 212 obj->tramp_brk = set_veneer(obj->tramp_brk, symvalue); 213 214 tmp = tramp_addr + (addend << 2) - (Elf_Addr)where; 215 tmp = (Elf_Sword)tmp >> 2; 216 } 217 218 if (!parsing) { 219 *where = (*where & 0xff000000) | (tmp & 0xffffff); 220 221 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) 222 printf ("rtl: JUMP24/PC24/CALL %p @ %p in %s\n", 223 (void *)*where, where, rtems_rtl_obj_oname (obj)); 224 } 155 225 break; 156 226 157 227 case R_TYPE(V4BX): 158 228 /* Miscellaneous, ignore */ 159 if ( rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) {229 if (!parsing && rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) { 160 230 printf ("rtl: V4BX %p @ %p in %s\n", 161 231 (void *)*where, where, rtems_rtl_obj_oname (obj)); … … 183 253 } 184 254 185 *where = (insn & 0xfff0f000) | ((tmp & 0xf000) << 4) | (tmp & 0xfff); 186 187 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) 188 printf ("rtl: MOVT_ABS/MOVW_ABS_NC %p @ %p in %s\n", 189 (void *)*where, where, rtems_rtl_obj_oname (obj)); 190 break; 191 255 if (!parsing) { 256 *where = (insn & 0xfff0f000) | ((tmp & 0xf000) << 4) | (tmp & 0xfff); 257 258 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) 259 printf ("rtl: MOVT_ABS/MOVW_ABS_NC %p @ %p in %s\n", 260 (void *)*where, where, rtems_rtl_obj_oname (obj)); 261 } 262 break; 192 263 193 264 case R_TYPE(REL32): /* word32 (S + A) | T - P */ … … 197 268 case R_TYPE(TARGET1): /* Equivalent to ABS32 */ 198 269 case R_TYPE(TARGET2): /* Equivalent to REL32 */ 199 if (__predict_true(RELOC_ALIGNED_P(where))) { 200 tmp = *where + symvalue; 201 if (isThumb(symvalue)) 202 tmp |= 1; 203 if (ELF_R_TYPE(rel->r_info) == R_TYPE(REL32) || 204 ELF_R_TYPE(rel->r_info) == R_TYPE(TARGET2)) 205 tmp -= (Elf_Addr)where; 206 else if (ELF_R_TYPE(rel->r_info) == R_TYPE(PREL31)) 207 tmp = sign_extend31(tmp - (Elf_Addr)where); 208 *where = tmp; 209 } else { 210 tmp = load_ptr(where) + symvalue; 211 if (isThumb(symvalue)) 212 tmp |= 1; 213 if (ELF_R_TYPE(rel->r_info) == R_TYPE(REL32) || 214 ELF_R_TYPE(rel->r_info) == R_TYPE(TARGET2)) 215 tmp -= (Elf_Addr)where; 216 else if (ELF_R_TYPE(rel->r_info) == R_TYPE(PREL31)) 217 tmp = sign_extend31(tmp - (Elf_Addr)where); 218 store_ptr(where, tmp); 219 } 220 221 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) 222 printf ("rtl: REL32/ABS32/GLOB_DAT/PREL31/TARGET2 %p @ %p in %s\n", 223 (void *)tmp, where, rtems_rtl_obj_oname (obj)); 270 if (!parsing) { 271 if (__predict_true(RELOC_ALIGNED_P(where))) { 272 tmp = *where + symvalue; 273 if (isThumb(symvalue)) 274 tmp |= 1; 275 if (ELF_R_TYPE(rel->r_info) == R_TYPE(REL32) || 276 ELF_R_TYPE(rel->r_info) == R_TYPE(TARGET2)) 277 tmp -= (Elf_Addr)where; 278 else if (ELF_R_TYPE(rel->r_info) == R_TYPE(PREL31)) 279 tmp = sign_extend31(tmp - (Elf_Addr)where); 280 if (!parsing) { 281 *where = tmp; 282 } 283 } else { 284 tmp = load_ptr(where) + symvalue; 285 if (isThumb(symvalue)) 286 tmp |= 1; 287 if (ELF_R_TYPE(rel->r_info) == R_TYPE(REL32) || 288 ELF_R_TYPE(rel->r_info) == R_TYPE(TARGET2)) 289 tmp -= (Elf_Addr)where; 290 else if (ELF_R_TYPE(rel->r_info) == R_TYPE(PREL31)) 291 tmp = sign_extend31(tmp - (Elf_Addr)where); 292 store_ptr(where, tmp); 293 } 294 295 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) 296 printf ("rtl: REL32/ABS32/GLOB_DAT/PREL31/TARGET2 %p @ %p in %s\n", 297 (void *)tmp, where, rtems_rtl_obj_oname (obj)); 298 } 224 299 break; 225 300 226 301 case R_TYPE(THM_MOVT_ABS): 227 302 case R_TYPE(THM_MOVW_ABS_NC): 228 upper_insn = *(uint16_t *)where; 229 lower_insn = *((uint16_t *)where + 1); 230 231 addend = ((upper_insn & 0x000f) << 12) | ((upper_insn & 0x0400) << 1) | 232 ((lower_insn & 0x7000) >> 4) | (lower_insn & 0x00ff); 233 addend = (addend ^ 0x8000) - 0x8000; 234 235 tmp = addend + symvalue; 236 if (ELF32_R_TYPE(rel->r_info) == R_ARM_THM_MOVT_ABS) 237 tmp >>= 16; 238 239 *(uint16_t *)where = (uint16_t)((upper_insn & 0xfbf0) | 240 ((tmp & 0xf000) >> 12) | 241 ((tmp & 0x0800) >> 1)); 242 *((uint16_t *)where + 1) = (uint16_t)((lower_insn & 0x8f00) | 243 ((tmp & 0x0700) << 4) | 244 (tmp & 0x00ff)); 245 246 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) { 247 printf ("rtl: THM_MOVT_ABS/THM_MOVW_ABS_NC %p @ %p in %s\n", 248 (void *)*where, where, rtems_rtl_obj_oname (obj)); 249 } 250 303 if (!parsing) { 304 upper_insn = *(uint16_t *)where; 305 lower_insn = *((uint16_t *)where + 1); 306 307 addend = ((upper_insn & 0x000f) << 12) | ((upper_insn & 0x0400) << 1) | 308 ((lower_insn & 0x7000) >> 4) | (lower_insn & 0x00ff); 309 addend = (addend ^ 0x8000) - 0x8000; 310 311 tmp = addend + symvalue; 312 if (ELF32_R_TYPE(rel->r_info) == R_ARM_THM_MOVT_ABS) 313 tmp >>= 16; 314 315 *(uint16_t *)where = (uint16_t)((upper_insn & 0xfbf0) | 316 ((tmp & 0xf000) >> 12) | 317 ((tmp & 0x0800) >> 1)); 318 *((uint16_t *)where + 1) = (uint16_t)((lower_insn & 0x8f00) | 319 ((tmp & 0x0700) << 4) | 320 (tmp & 0x00ff)); 321 322 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)) { 323 printf ("rtl: THM_MOVT_ABS/THM_MOVW_ABS_NC %p @ %p in %s\n", 324 (void *)*where, where, rtems_rtl_obj_oname (obj)); 325 } 326 } 251 327 break; 252 328 … … 279 355 280 356 if (((Elf_Sword)tmp > 0x7fffff) || ((Elf_Sword)tmp < -0x800000)) { 281 printf("THM_CALL/JUMP24 overflow\n"); 282 return false; 283 } 284 285 sign = (tmp >> 24) & 1; 286 *(uint16_t *)where = (uint16_t)((upper_insn & 0xf800) | (sign << 10) | 287 ((tmp >> 12) & 0x3ff)); 288 289 *((uint16_t *)where + 1) = (uint16_t)((lower_insn & 0xd000)| 290 ((sign ^ (~(tmp >> 23) & 1)) << 13) | 291 ((sign ^ (~(tmp >> 22) & 1)) << 11) | 292 ((tmp >> 1) & 0x7ff)); 293 294 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)){ 295 printf ("rtl: THM_CALL/JUMP24 %p @ %p in %s\n", 296 (void *)*where, where, rtems_rtl_obj_oname (obj)); 297 } 298 357 Elf_Word tramp_addr; 358 size_t tramp_size = get_veneer_size(ELF_R_TYPE(rel->r_info)); 359 360 if (parsing) { 361 obj->tramp_size += tramp_size; 362 return true; 363 } 364 365 if (!rtems_rtl_obj_has_ramp_space (obj, tramp_size)) { 366 rtems_rtl_set_error (EINVAL, 367 "%s: THM_CALL/JUMP24: overflow: no tramp memory", 368 sect->name); 369 return false; 370 } 371 372 tramp_addr = ((Elf_Addr) obj->tramp_brk) | (symvalue & 1); 373 obj->tramp_brk = set_veneer(obj->tramp_brk, symvalue); 374 375 376 tmp = tramp_addr + addend; 377 tmp = tmp - (Elf_Addr)where; 378 } 379 380 if (!parsing) { 381 sign = (tmp >> 24) & 1; 382 *(uint16_t *)where = (uint16_t)((upper_insn & 0xf800) | (sign << 10) | 383 ((tmp >> 12) & 0x3ff)); 384 385 *((uint16_t *)where + 1) = (uint16_t)((lower_insn & 0xd000)| 386 ((sign ^ (~(tmp >> 23) & 1)) << 13) | 387 ((sign ^ (~(tmp >> 22) & 1)) << 11) | 388 ((tmp >> 1) & 0x7ff)); 389 390 if (rtems_rtl_trace (RTEMS_RTL_TRACE_RELOC)){ 391 printf ("rtl: THM_CALL/JUMP24 %p @ %p in %s\n", 392 (void *)*where, where, rtems_rtl_obj_oname (obj)); 393 } 394 } 299 395 break; 300 396 … … 328 424 "THM_JUMP19 relocations", 329 425 sect->name, (uint32_t) ELF_R_TYPE(rel->r_info)); 426 return true; 330 427 return false; 331 428 } … … 360 457 361 458 bool 459 rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 460 const Elf_Rel* rel, 461 const rtems_rtl_obj_sect* sect, 462 const char* symname, 463 const Elf_Byte syminfo, 464 const Elf_Word symvalue) 465 { 466 return rtems_rtl_elf_relor_rel (obj, 467 rel, 468 sect, 469 symname, 470 syminfo, 471 symvalue, 472 true); 473 } 474 475 bool 476 rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 477 const Elf_Rel* rel, 478 const rtems_rtl_obj_sect* sect, 479 const char* symname, 480 const Elf_Byte syminfo, 481 const Elf_Word symvalue) 482 { 483 return rtems_rtl_elf_relor_rel (obj, 484 rel, 485 sect, 486 symname, 487 syminfo, 488 symvalue, 489 false); 490 } 491 492 bool 362 493 rtems_rtl_elf_unwind_parse (const rtems_rtl_obj* obj, 363 494 const char* name, -
cpukit/libdl/rtl-mdreloc-bfin.c
r4408603 rd8c70ba6 33 33 } 34 34 35 size_t 36 rtems_rtl_elf_relocate_tramp_max_size (void) 37 { 38 /* 39 * Disable by returning 0. 40 */ 41 return 0; 42 } 43 35 44 bool 36 rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, 45 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 46 const Elf_Rela* rela, 47 const rtems_rtl_obj_sect* sect, 48 const char* symname, 49 const Elf_Byte syminfo, 50 const Elf_Word symvalue) 51 { 52 (void) obj; 53 (void) rela; 54 (void) sect; 55 (void) symname; 56 (void) syminfo; 57 (void) symvalue; 58 return true; 59 } 60 61 bool 62 rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 37 63 const Elf_Rela* rela, 38 64 const rtems_rtl_obj_sect* sect, … … 113 139 114 140 bool 115 rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, 141 rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 142 const Elf_Rel* rel, 143 const rtems_rtl_obj_sect* sect, 144 const char* symname, 145 const Elf_Byte syminfo, 146 const Elf_Word symvalue) 147 { 148 (void) obj; 149 (void) rel; 150 (void) sect; 151 (void) symname; 152 (void) syminfo; 153 (void) symvalue; 154 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 155 return false; 156 } 157 158 bool 159 rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 116 160 const Elf_Rel* rel, 117 161 const rtems_rtl_obj_sect* sect, … … 120 164 const Elf_Word symvalue) 121 165 { 166 (void) obj; 167 (void) rel; 168 (void) sect; 169 (void) symname; 170 (void) syminfo; 171 (void) symvalue; 122 172 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 123 173 return false; -
cpukit/libdl/rtl-mdreloc-h8300.c
r4408603 rd8c70ba6 26 26 } 27 27 28 size_t 29 rtems_rtl_elf_relocate_tramp_max_size (void) 30 { 31 /* 32 * Disable by returning 0. 33 */ 34 return 0; 35 } 36 28 37 bool 29 rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, 38 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 39 const Elf_Rela* rela, 40 const rtems_rtl_obj_sect* sect, 41 const char* symname, 42 const Elf_Byte syminfo, 43 const Elf_Word symvalue) 44 { 45 (void) obj; 46 (void) rela; 47 (void) sect; 48 (void) symname; 49 (void) syminfo; 50 (void) symvalue; 51 return true; 52 } 53 54 bool 55 rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 30 56 const Elf_Rela* rela, 31 57 const rtems_rtl_obj_sect* sect, … … 99 125 100 126 bool 101 rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, 127 rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 128 const Elf_Rel* rel, 129 const rtems_rtl_obj_sect* sect, 130 const char* symname, 131 const Elf_Byte syminfo, 132 const Elf_Word symvalue) 133 { 134 (void) obj; 135 (void) rel; 136 (void) sect; 137 (void) symname; 138 (void) syminfo; 139 (void) symvalue; 140 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 141 return false; 142 } 143 144 bool 145 rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 102 146 const Elf_Rel* rel, 103 147 const rtems_rtl_obj_sect* sect, … … 106 150 const Elf_Word symvalue) 107 151 { 152 (void) obj; 153 (void) rel; 154 (void) sect; 155 (void) symname; 156 (void) syminfo; 157 (void) symvalue; 108 158 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 109 159 return false; -
cpukit/libdl/rtl-mdreloc-i386.c
r4408603 rd8c70ba6 32 32 } 33 33 34 size_t 35 rtems_rtl_elf_relocate_tramp_max_size (void) 36 { 37 /* 38 * Disable by returning 0. 39 */ 40 return 0; 41 } 42 34 43 bool 35 rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, 44 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 45 const Elf_Rela* rela, 46 const rtems_rtl_obj_sect* sect, 47 const char* symname, 48 const Elf_Byte syminfo, 49 const Elf_Word symvalue) 50 { 51 (void) obj; 52 (void) rela; 53 (void) sect; 54 (void) symname; 55 (void) syminfo; 56 (void) symvalue; 57 rtems_rtl_set_error (EINVAL, "rela type record not supported"); 58 return false; 59 } 60 61 bool 62 rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 36 63 const Elf_Rela* rel, 37 64 const rtems_rtl_obj_sect* sect, … … 40 67 const Elf_Word symvalue) 41 68 { 69 (void) obj; 70 (void) rela; 71 (void) sect; 72 (void) symname; 73 (void) syminfo; 74 (void) symvalue; 42 75 rtems_rtl_set_error (EINVAL, "rela type record not supported"); 43 76 return false; … … 45 78 46 79 bool 47 rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, 80 rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 81 const Elf_Rel* rel, 82 const rtems_rtl_obj_sect* sect, 83 const char* symname, 84 const Elf_Byte syminfo, 85 const Elf_Word symvalue) 86 { 87 (void) obj; 88 (void) rel; 89 (void) sect; 90 (void) symname; 91 (void) syminfo; 92 (void) symvalue; 93 return true; 94 } 95 96 bool 97 rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 48 98 const Elf_Rel* rel, 49 99 const rtems_rtl_obj_sect* sect, -
cpukit/libdl/rtl-mdreloc-lm32.c
r4408603 rd8c70ba6 26 26 } 27 27 28 size_t 29 rtems_rtl_elf_relocate_tramp_max_size (void) 30 { 31 /* 32 * Disable by returning 0. 33 */ 34 return 0; 35 } 36 28 37 bool 29 rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, 38 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 39 const Elf_Rela* rela, 40 const rtems_rtl_obj_sect* sect, 41 const char* symname, 42 const Elf_Byte syminfo, 43 const Elf_Word symvalue) 44 { 45 (void) obj; 46 (void) rela; 47 (void) sect; 48 (void) symname; 49 (void) syminfo; 50 (void) symvalue; 51 return true; 52 } 53 54 bool 55 rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 30 56 const Elf_Rela* rela, 31 57 const rtems_rtl_obj_sect* sect, … … 118 144 119 145 bool 120 rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, 146 rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 147 const Elf_Rel* rel, 148 const rtems_rtl_obj_sect* sect, 149 const char* symname, 150 const Elf_Byte syminfo, 151 const Elf_Word symvalue) 152 { 153 (void) obj; 154 (void) rela; 155 (void) sect; 156 (void) symname; 157 (void) syminfo; 158 (void) symvalue; 159 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 160 return false; 161 } 162 163 bool 164 rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 121 165 const Elf_Rel* rel, 122 166 const rtems_rtl_obj_sect* sect, … … 125 169 const Elf_Word symvalue) 126 170 { 171 (void) obj; 172 (void) rela; 173 (void) sect; 174 (void) symname; 175 (void) syminfo; 176 (void) symvalue; 127 177 rtems_rtl_set_error (EINVAL, "rela type record not supported"); 128 178 return false; -
cpukit/libdl/rtl-mdreloc-m68k.c
r4408603 rd8c70ba6 46 46 } 47 47 48 bool 49 rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, 48 size_t 49 rtems_rtl_elf_relocate_tramp_max_size (void) 50 { 51 /* 52 * Disable by returning 0. 53 */ 54 return 0; 55 } 56 57 bool 58 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 59 const Elf_Rela* rela, 60 const rtems_rtl_obj_sect* sect, 61 const char* symname, 62 const Elf_Byte syminfo, 63 const Elf_Word symvalue) 64 { 65 (void) obj; 66 (void) rela; 67 (void) sect; 68 (void) symname; 69 (void) syminfo; 70 (void) symvalue; 71 return true; 72 } 73 74 bool 75 rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 50 76 const Elf_Rela* rela, 51 77 const rtems_rtl_obj_sect* sect, … … 146 172 147 173 bool 148 rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, 174 rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 175 const Elf_Rel* rel, 176 const rtems_rtl_obj_sect* sect, 177 const char* symname, 178 const Elf_Byte syminfo, 179 const Elf_Word symvalue) 180 { 181 (void) obj; 182 (void) rel; 183 (void) sect; 184 (void) symname; 185 (void) syminfo; 186 (void) symvalue; 187 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 188 return false; 189 } 190 191 bool 192 rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 149 193 const Elf_Rel* rel, 150 194 const rtems_rtl_obj_sect* sect, … … 153 197 const Elf_Word symvalue) 154 198 { 199 (void) obj; 200 (void) rel; 201 (void) sect; 202 (void) symname; 203 (void) syminfo; 204 (void) symvalue; 155 205 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 156 206 return false; -
cpukit/libdl/rtl-mdreloc-mips.c
r4408603 rd8c70ba6 26 26 } 27 27 28 bool 29 rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, 28 size_t 29 rtems_rtl_elf_relocate_tramp_max_size (void) 30 { 31 /* 32 * Disable by returning 0. 33 */ 34 return 0; 35 } 36 37 bool 38 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 39 const Elf_Rela* rela, 40 const rtems_rtl_obj_sect* sect, 41 const char* symname, 42 const Elf_Byte syminfo, 43 const Elf_Word symvalue) 44 { 45 (void) obj; 46 (void) rela; 47 (void) sect; 48 (void) symname; 49 (void) syminfo; 50 (void) symvalue; 51 rtems_rtl_set_error (EINVAL, "rela type record not supported"); 52 return false; 53 } 54 55 bool 56 rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 30 57 const Elf_Rela* rela, 31 58 const rtems_rtl_obj_sect* sect, … … 34 61 const Elf_Word symvalue) 35 62 { 63 (void) obj; 64 (void) rela; 65 (void) sect; 66 (void) symname; 67 (void) syminfo; 68 (void) symvalue; 36 69 rtems_rtl_set_error (EINVAL, "rela type record not supported"); 37 70 return false; 71 } 72 73 bool 74 rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 75 const Elf_Rel* rel, 76 const rtems_rtl_obj_sect* sect, 77 const char* symname, 78 const Elf_Byte syminfo, 79 const Elf_Word symvalue) 80 { 81 (void) obj; 82 (void) rel; 83 (void) sect; 84 (void) symname; 85 (void) syminfo; 86 (void) symvalue; 87 return true; 38 88 } 39 89 … … 47 97 */ 48 98 bool 49 rtems_rtl_elf_relocate_rel ( const rtems_rtl_obj*obj,99 rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 50 100 const Elf_Rel* rel, 51 101 const rtems_rtl_obj_sect* sect, … … 184 234 break; 185 235 186 187 printf ("rtl: reloc unknown: sym = %lu, type = %lu, offset = %p, "188 "contents = %p\n",236 default: 237 printf ("rtl: reloc unknown: sym = %lu, type = %lu, offset = %p, " 238 "contents = %p\n", 189 239 ELF_R_SYM(rel->r_info), (uint32_t) ELF_R_TYPE(rel->r_info), 190 240 (void *)rel->r_offset, (void *)*where); 191 rtems_rtl_set_error (EINVAL,192 "%s: Unsupported relocation type %ld "193 "in non-PLT relocations",194 sect->name, (uint32_t) ELF_R_TYPE(rel->r_info));195 return false;241 rtems_rtl_set_error (EINVAL, 242 "%s: Unsupported relocation type %ld " 243 "in non-PLT relocations", 244 sect->name, (uint32_t) ELF_R_TYPE(rel->r_info)); 245 return false; 196 246 } 197 247 -
cpukit/libdl/rtl-mdreloc-moxie.c
r4408603 rd8c70ba6 27 27 } 28 28 29 size_t 30 rtems_rtl_elf_relocate_tramp_max_size (void) 31 { 32 /* 33 * Disable by returning 0. 34 */ 35 return 0; 36 } 37 29 38 bool 30 rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, 39 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 40 const Elf_Rela* rela, 41 const rtems_rtl_obj_sect* sect, 42 const char* symname, 43 const Elf_Byte syminfo, 44 const Elf_Word symvalue) 45 { 46 (void) obj; 47 (void) rela; 48 (void) sect; 49 (void) symname; 50 (void) syminfo; 51 (void) symvalue; 52 return true; 53 } 54 55 bool 56 rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 31 57 const Elf_Rela* rela, 32 58 const rtems_rtl_obj_sect* sect, … … 86 112 87 113 bool 88 rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, 114 rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 115 const Elf_Rel* rel, 116 const rtems_rtl_obj_sect* sect, 117 const char* symname, 118 const Elf_Byte syminfo, 119 const Elf_Word symvalue) 120 { 121 (void) obj; 122 (void) rel; 123 (void) sect; 124 (void) symname; 125 (void) syminfo; 126 (void) symvalue; 127 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 128 return false; 129 } 130 131 bool 132 rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 89 133 const Elf_Rel* rel, 90 134 const rtems_rtl_obj_sect* sect, … … 93 137 const Elf_Word symvalue) 94 138 { 139 (void) obj; 140 (void) rel; 141 (void) sect; 142 (void) symname; 143 (void) syminfo; 144 (void) symvalue; 95 145 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 96 146 return false; -
cpukit/libdl/rtl-mdreloc-powerpc.c
r4408603 rd8c70ba6 37 37 } 38 38 39 bool 40 rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, 39 size_t 40 rtems_rtl_elf_relocate_tramp_max_size (void) 41 { 42 /* 43 * Disable by returning 0. 44 */ 45 return 0; 46 } 47 48 bool 49 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 50 const Elf_Rela* rela, 51 const rtems_rtl_obj_sect* sect, 52 const char* symname, 53 const Elf_Byte syminfo, 54 const Elf_Word symvalue) 55 { 56 (void) obj; 57 (void) rela; 58 (void) sect; 59 (void) symname; 60 (void) syminfo; 61 (void) symvalue; 62 return true; 63 } 64 65 bool 66 rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 41 67 const Elf_Rela* rela, 42 68 const rtems_rtl_obj_sect* sect, … … 199 225 200 226 bool 201 rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, 227 rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 228 const Elf_Rel* rel, 229 const rtems_rtl_obj_sect* sect, 230 const char* symname, 231 const Elf_Byte syminfo, 232 const Elf_Word symvalue) 233 { 234 (void) obj; 235 (void) rel; 236 (void) sect; 237 (void) symname; 238 (void) syminfo; 239 (void) symvalue; 240 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 241 return false; 242 } 243 244 bool 245 rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 202 246 const Elf_Rel* rel, 203 247 const rtems_rtl_obj_sect* sect, … … 206 250 const Elf_Word symvalue) 207 251 { 208 printf ("rtl: rel type record not supported; please report\n"); 252 (void) obj; 253 (void) rel; 254 (void) sect; 255 (void) symname; 256 (void) syminfo; 257 (void) symvalue; 258 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 209 259 return false; 210 260 } -
cpukit/libdl/rtl-mdreloc-sparc.c
r4408603 rd8c70ba6 145 145 } 146 146 147 bool 148 rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, 147 size_t 148 rtems_rtl_elf_relocate_tramp_max_size (void) 149 { 150 /* 151 * Disable by returning 0. 152 */ 153 return 0; 154 } 155 156 bool 157 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 158 const Elf_Rela* rela, 159 const rtems_rtl_obj_sect* sect, 160 const char* symname, 161 const Elf_Byte syminfo, 162 const Elf_Word symvalue) 163 { 164 (void) obj; 165 (void) rela; 166 (void) sect; 167 (void) symname; 168 (void) syminfo; 169 (void) symvalue; 170 return true; 171 } 172 173 bool 174 rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 149 175 const Elf_Rela* rela, 150 176 const rtems_rtl_obj_sect* sect, … … 262 288 263 289 bool 264 rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, 290 rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 291 const Elf_Rel* rel, 292 const rtems_rtl_obj_sect* sect, 293 const char* symname, 294 const Elf_Byte syminfo, 295 const Elf_Word symvalue) 296 { 297 (void) obj; 298 (void) rel; 299 (void) sect; 300 (void) symname; 301 (void) syminfo; 302 (void) symvalue; 303 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 304 return false; 305 } 306 307 bool 308 rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 265 309 const Elf_Rel* rel, 266 310 const rtems_rtl_obj_sect* sect, … … 269 313 const Elf_Word symvalue) 270 314 { 315 (void) obj; 316 (void) rel; 317 (void) sect; 318 (void) symname; 319 (void) syminfo; 320 (void) symvalue; 271 321 printf ("rtl: rel type record not supported; please report\n"); 272 322 return false; -
cpukit/libdl/rtl-mdreloc-v850.c
r4408603 rd8c70ba6 27 27 } 28 28 29 size_t 30 rtems_rtl_elf_relocate_tramp_max_size (void) 31 { 32 /* 33 * Disable by returning 0. 34 */ 35 return 0; 36 } 37 29 38 bool 30 rtems_rtl_elf_relocate_rela (const rtems_rtl_obj* obj, 39 rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj, 40 const Elf_Rela* rela, 41 const rtems_rtl_obj_sect* sect, 42 const char* symname, 43 const Elf_Byte syminfo, 44 const Elf_Word symvalue) 45 { 46 (void) obj; 47 (void) rela; 48 (void) sect; 49 (void) symname; 50 (void) syminfo; 51 (void) symvalue; 52 return true; 53 } 54 55 bool 56 rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj, 31 57 const Elf_Rela* rela, 32 58 const rtems_rtl_obj_sect* sect, … … 95 121 96 122 bool 97 rtems_rtl_elf_relocate_rel (const rtems_rtl_obj* obj, 123 rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj, 124 const Elf_Rel* rel, 125 const rtems_rtl_obj_sect* sect, 126 const char* symname, 127 const Elf_Byte syminfo, 128 const Elf_Word symvalue) 129 { 130 (void) obj; 131 (void) rel; 132 (void) sect; 133 (void) symname; 134 (void) syminfo; 135 (void) symvalue; 136 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 137 return false; 138 } 139 140 bool 141 rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj, 98 142 const Elf_Rel* rel, 99 143 const rtems_rtl_obj_sect* sect, … … 102 146 const Elf_Word symvalue) 103 147 { 148 (void) obj; 149 (void) rel; 150 (void) sect; 151 (void) symname; 152 (void) syminfo; 153 (void) symvalue; 104 154 rtems_rtl_set_error (EINVAL, "rel type record not supported"); 105 155 return false; -
cpukit/libdl/rtl-obj.c
r4408603 rd8c70ba6 119 119 rtems_rtl_obj_erase_dependents (obj); 120 120 rtems_rtl_symbol_obj_erase (obj); 121 rtems_rtl_obj_erase_trampoline (obj); 121 122 rtems_rtl_obj_free_names (obj); 122 123 if (obj->sec_num != NULL) … … 558 559 559 560 bool 561 rtems_rtl_obj_alloc_trampoline (rtems_rtl_obj* obj) 562 { 563 if (obj->tramp_size == 0) 564 return true; 565 obj->trampoline = rtems_rtl_alloc_new (RTEMS_RTL_ALLOC_OBJECT, 566 obj->tramp_size, 567 true); 568 if (obj->trampoline == NULL) 569 rtems_rtl_set_error (ENOMEM, "no memory for the trampoline"); 570 obj->tramp_brk = obj->trampoline; 571 return obj->trampoline != NULL; 572 } 573 574 void 575 rtems_rtl_obj_erase_trampoline (rtems_rtl_obj* obj) 576 { 577 rtems_rtl_alloc_del (RTEMS_RTL_ALLOC_OBJECT, obj->trampoline); 578 } 579 580 bool 560 581 rtems_rtl_obj_alloc_dependents (rtems_rtl_obj* obj, size_t dependents) 561 582 { … … 838 859 &sync_ctx); 839 860 840 if (sync_ctx.end_va != sync_ctx.start_va) { 861 if (sync_ctx.end_va != sync_ctx.start_va) 862 { 863 size_t size = sync_ctx.end_va - sync_ctx.start_va; 841 864 rtems_cache_instruction_sync_after_code_change(sync_ctx.start_va, 842 sync_ctx.end_va - sync_ctx.start_va); 865 size); 866 } 867 868 if (obj->trampoline != NULL) 869 { 870 rtems_cache_instruction_sync_after_code_change(obj->trampoline, 871 obj->tramp_size); 843 872 } 844 873 } -
testsuites/libtests/Makefile.am
r4408603 rd8c70ba6 441 441 dl05/init.c: dl05-tar.o 442 442 dl05.pre: $(dl05_OBJECTS) $(dl05_DEPENDENCIES) 443 @rm -f dl05.pre 443 @rm -f dl05.pre dl05-sym.o 444 444 $(AM_V_CXXLD)$(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ 445 445 dl05-o5.o: dl05/dl-o5.cpp … … 485 485 -DDL06_PRE -c -o $@ $(srcdir)/dl06/init.c 486 486 dl06.pre: dl06-pre-init.o dl06/dl06-dl-load.o dl06-pre-tar.o 487 @rm -f $@ 487 @rm -f $@ dl06-sym.o 488 488 $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ $(LDADD) 489 489 dl06-o1.o: dl06/dl06-o1.c Makefile … … 523 523 dl07/init.c: dl07-tar.o 524 524 dl07.pre: $(dl07_OBJECTS) $(dl07_DEPENDENCIES) 525 @rm -f dl07.pre 525 @rm -f dl07.pre dl07-sym.o 526 526 $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ 527 527 dl07-o1.o: dl07/dl-o1.c Makefile … … 563 563 dl08/init.c: dl08-tar.o 564 564 dl08.pre: $(dl08_OBJECTS) $(dl08_DEPENDENCIES) 565 @rm -f dl08.pre 565 @rm -f dl08.pre dl08-syms.o 566 566 $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ 567 567 dl08-o1.o: dl08/dl-o1.c Makefile … … 603 603 dl08-o3.o dl08-o4.o dl08-o5.o dl08-o6-123456789-123456789.o \ 604 604 dl08.tar dl08-tar.h etc/rtl-libs.conf 605 endif 606 endif 607 608 if DLTESTS 609 if TEST_dl09 610 lib_tests += dl09 611 lib_screens += dl09/dl09.scn 612 lib_docs += dl09/dl09.doc 613 dl09_SOURCES = dl09/init.c dl09/dl-load.c dl09-tar.c dl09-tar.h 614 dl09_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl09) $(support_includes) 615 dl09/init.c: dl09-tar.o 616 dl09.pre: $(dl09_OBJECTS) $(dl09_DEPENDENCIES) 617 @rm -f dl09.pre dl09-syms.o 618 $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ 619 dl09-o1.o: dl09/dl-o1.c Makefile 620 $(AM_V_CC)$(COMPILE) -c -o $@ $< 621 dl09-o2.o: dl09/dl-o2.c Makefile 622 $(AM_V_CC)$(COMPILE) -c -o $@ $< 623 dl09-o3.o: dl09/dl-o3.c Makefile 624 $(AM_V_CC)$(COMPILE) -c -o $@ $< 625 dl09-o4.o: dl09/dl-o4.c Makefile 626 $(AM_V_CC)$(COMPILE) -c -o $@ $< 627 dl09-o5.o: dl09/dl-o5.c Makefile 628 $(AM_V_CC)$(COMPILE) -c -o $@ $< 629 dl09.tar: dl09-o1.o dl09-o2.o dl09-o3.o dl09-o4.o dl09-o5.o 630 @rm -f $@ 631 $(AM_V_GEN)$(PAX) -w -f $@ $+ 632 dl09-tar.c: dl09.tar 633 $(AM_V_GEN)$(BIN2C) -C $< $@ 634 dl09-tar.h: dl09.tar 635 $(AM_V_GEN)$(BIN2C) -H $< $@ 636 dl09-tar.o: dl09-tar.c dl09-tar.h 637 $(AM_V_CC)$(COMPILE) -c -o $@ $< 638 dl09-sym.o: dl09.pre 639 $(AM_V_GEN)rtems-syms -e -C $(CC) -c "$(CFLAGS)" -o $@ $< 640 dl09$(EXEEXT): $(dl09_OBJECTS) $(dl09_DEPENDENCIES) dl09-sym.o 641 @rm -f $@ 642 $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ 643 CLEANFILES += dl09.pre dl09-sym.o dl09-o1.o dl09-o2.o dl09-o3.o dl09-o4.o \ 644 dl09-o5.o dl09.tar dl09-tar.h 605 645 endif 606 646 endif -
testsuites/libtests/configure.ac
r4408603 rd8c70ba6 134 134 RTEMS_TEST_CHECK([dl07]) 135 135 RTEMS_TEST_CHECK([dl08]) 136 RTEMS_TEST_CHECK([dl09]) 136 137 RTEMS_TEST_CHECK([dumpbuf01]) 137 138 RTEMS_TEST_CHECK([dup2]) -
testsuites/libtests/dl01/dl-load.c
r4408603 rd8c70ba6 13 13 #include "dl-load.h" 14 14 15 #include <rtems/rtl/rtl-shell.h> 16 #include <rtems/rtl/rtl-trace.h> 17 18 #define TEST_TRACE 0 19 #if TEST_TRACE 20 #define DEBUG_TRACE (RTEMS_RTL_TRACE_DETAIL | \ 21 RTEMS_RTL_TRACE_WARNING | \ 22 RTEMS_RTL_TRACE_LOAD | \ 23 RTEMS_RTL_TRACE_UNLOAD | \ 24 RTEMS_RTL_TRACE_SYMBOL | \ 25 RTEMS_RTL_TRACE_RELOC | \ 26 RTEMS_RTL_TRACE_ALLOCATOR | \ 27 RTEMS_RTL_TRACE_UNRESOLVED | \ 28 RTEMS_RTL_TRACE_ARCHIVES | \ 29 RTEMS_RTL_TRACE_DEPENDENCY) 30 #define DL_DEBUG_TRACE DEBUG_TRACE /* RTEMS_RTL_TRACE_ALL */ 31 #define DL_RTL_CMDS 1 32 #else 33 #define DL_DEBUG_TRACE 0 34 #define DL_RTL_CMDS 0 35 #endif 36 37 static void dl_load_dump (void) 38 { 39 #if DL_RTL_CMDS 40 char* list[] = { "rtl", "list", NULL }; 41 char* sym[] = { "rtl", "sym", NULL }; 42 printf ("RTL List:\n"); 43 rtems_rtl_shell_command (2, list); 44 printf ("RTL Sym:\n"); 45 rtems_rtl_shell_command (2, sym); 46 #endif 47 } 48 15 49 typedef int (*call_t)(int argc, const char* argv[]); 16 17 50 18 51 static const char* call_1[] = { "Line 1", "Line 2" }; … … 28 61 int unresolved; 29 62 char* message = "loaded"; 63 64 #if DL_DEBUG_TRACE 65 rtems_rtl_trace_set_mask (DL_DEBUG_TRACE); 66 #endif 30 67 31 68 printf("load: /dl01-o1.o\n"); … … 44 81 45 82 printf ("handle: %p %s\n", handle, message); 83 84 dl_load_dump (); 46 85 47 86 call = dlsym (handle, "rtems_main"); -
testsuites/libtests/dl08/dl-load.c
r4408603 rd8c70ba6 8 8 */ 9 9 10 #define ARCHIVE_TRACE (RTEMS_RTL_TRACE_DETAIL | \ 11 RTEMS_RTL_TRACE_WARNING | \ 12 RTEMS_RTL_TRACE_LOAD | \ 13 RTEMS_RTL_TRACE_UNLOAD | \ 14 RTEMS_RTL_TRACE_SYMBOL | \ 15 RTEMS_RTL_TRACE_RELOC | \ 16 RTEMS_RTL_TRACE_ALLOCATOR | \ 17 RTEMS_RTL_TRACE_UNRESOLVED | \ 18 RTEMS_RTL_TRACE_ARCHIVES | \ 19 RTEMS_RTL_TRACE_DEPENDENCY) 20 #define DL08_DEBUG_TRACE 0 /* RTEMS_RTL_TRACE_ALL */ 21 #define DL08_RTL_CMDS 0 10 #define TEST_TRACE 0 11 #if TEST_TRACE 12 #define DEBUG_TRACE (RTEMS_RTL_TRACE_DETAIL | \ 13 RTEMS_RTL_TRACE_WARNING | \ 14 RTEMS_RTL_TRACE_LOAD | \ 15 RTEMS_RTL_TRACE_UNLOAD | \ 16 RTEMS_RTL_TRACE_SYMBOL | \ 17 RTEMS_RTL_TRACE_RELOC | \ 18 RTEMS_RTL_TRACE_ALLOCATOR | \ 19 RTEMS_RTL_TRACE_UNRESOLVED | \ 20 RTEMS_RTL_TRACE_ARCHIVES | \ 21 RTEMS_RTL_TRACE_DEPENDENCY) 22 #define DL_DEBUG_TRACE DEBUG_TRACE /* RTEMS_RTL_TRACE_ALL */ 23 #define DL_RTL_CMDS 1 24 #else 25 #define DL_DEBUG_TRACE 0 26 #define DL_RTL_CMDS 0 27 #endif 22 28 23 29 #include <dlfcn.h> … … 34 40 static void dl_load_dump (void) 35 41 { 36 #if DL 08_RTL_CMDS42 #if DL_RTL_CMDS 37 43 char* list[] = { "rtl", "list", NULL }; 38 44 char* sym[] = { "rtl", "sym", NULL }; … … 115 121 printf ("Test source (link in strstr): %s\n", dl_localise_file (__FILE__)); 116 122 117 #if DL 08_DEBUG_TRACE118 rtems_rtl_trace_set_mask (DL 08_DEBUG_TRACE);123 #if DL_DEBUG_TRACE 124 rtems_rtl_trace_set_mask (DL_DEBUG_TRACE); 119 125 #endif 120 126
Note: See TracChangeset
for help on using the changeset viewer.