History

ARM: add support for R_ARM_V4BX

Daniel Glöckner committed 16 years ago

Commit 128e46f1 parent 20a1cba2 files · +11 −1Browse files

Unified · Split

2 files
  1. elf.h +1 −0
  2. tccelf.c +10 −1
elf.h+1−0
@@ -1673,6 +1673,7 @@ typedef Elf32_Addr Elf32_Conflict; · 1672 unmodified lines
16731673 #define R_ARM_PLT32 27 /* 32 bit PLT address */
16741674 #define R_ARM_CALL 28
16751675 #define R_ARM_JUMP24 29
1676+#define R_ARM_V4BX 40
16761677 #define R_ARM_PREL31 42
16771678 #define R_ARM_GNU_VTENTRY 100
16781679 #define R_ARM_GNU_VTINHERIT 101
tccelf.c+10−1
@@ -660,6 +660,11 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 659 unmodified lines
660660 break;
661661 case R_ARM_COPY:
662662 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;
663668 default:
664669 fprintf(stderr,"FIXME: handle reloc type %x at %lx [%.8x] to %lx\n",
665670 type,addr,(unsigned int)(long)ptr,val);
@@ -2474,7 +2479,11 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, · 1808 unmodified lines
24742479 goto invalid_reloc;
24752480 sym_index = old_to_new_syms[sym_index];
24762481 /* 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+ ) {
24782487 invalid_reloc:
24792488 error_noabort("Invalid relocation entry [%2d] '%s' @ %.8x",
24802489 i, strsec + sh->sh_name, rel->r_offset);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t