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
1673#define R_ARM_PLT32 27 /* 32 bit PLT address */1673#define R_ARM_PLT32 27 /* 32 bit PLT address */
1674#define R_ARM_CALL 281674#define R_ARM_CALL 28
1675#define R_ARM_JUMP24 291675#define R_ARM_JUMP24 29
1676#define R_ARM_V4BX 40
1676#define R_ARM_PREL31 421677#define R_ARM_PREL31 42
1677#define R_ARM_GNU_VTENTRY 1001678#define R_ARM_GNU_VTENTRY 100
1678#define R_ARM_GNU_VTINHERIT 1011679#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
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);

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