| @@ -660,6 +660,11 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 659 unmodified lines |
| 660 | break; | 660 | break; |
| 661 | case R_ARM_COPY: | 661 | case R_ARM_COPY: |
| 662 | break; | 662 | break; |
| | 663 | case R_ARM_V4BX: |
| | 664 | /* trade Thumb support for ARMv4 support */ |
| | 665 | if ((0x0ffffff0 & *(int*)ptr) == 0x012FFF10) |
| | 666 | *(int*)ptr ^= 0xE12FFF10 ^ 0xE1A0F000; /* BX Rm -> MOV PC, Rm */ |
| | 667 | break; |
| 663 | default: | 668 | default: |
| 664 | fprintf(stderr,"FIXME: handle reloc type %x at %lx [%.8x] to %lx\n", | 669 | fprintf(stderr,"FIXME: handle reloc type %x at %lx [%.8x] to %lx\n", |
| 665 | type,addr,(unsigned int)(long)ptr,val); | 670 | type,addr,(unsigned int)(long)ptr,val); |
| @@ -2474,7 +2479,11 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, · 1808 unmodified lines |
| 2474 | goto invalid_reloc; | 2479 | goto invalid_reloc; |
| 2475 | sym_index = old_to_new_syms[sym_index]; | 2480 | sym_index = old_to_new_syms[sym_index]; |
| 2476 | /* ignore link_once in rel section. */ | 2481 | /* ignore link_once in rel section. */ |
| 2477 | if (!sym_index && !sm->link_once) { | 2482 | if (!sym_index && !sm->link_once |
| | 2483 | #ifdef TCC_TARGET_ARM |
| | 2484 | && type != R_ARM_V4BX |
| | 2485 | #endif |
| | 2486 | ) { |
| 2478 | invalid_reloc: | 2487 | invalid_reloc: |
| 2479 | error_noabort("Invalid relocation entry [%2d] '%s' @ %.8x", | 2488 | error_noabort("Invalid relocation entry [%2d] '%s' @ %.8x", |
| 2480 | i, strsec + sh->sh_name, rel->r_offset); | 2489 | i, strsec + sh->sh_name, rel->r_offset); |