History

add R_ARM_GOT_PREL for clang

herman ten brugge committed 5 years ago

Commit 0352c411 parent 9f6b6522 files · +9 −0Browse files

Unified · Split

2 files
  1. arm-link.c +8 −0
  2. elf.h +1 −0
arm-link.c+8−0
@@ -41,6 +41,7 @@ int code_reloc (int reloc_type) · 40 unmodified lines
41 case R_ARM_GOTPC:41 case R_ARM_GOTPC:
42 case R_ARM_GOTOFF:42 case R_ARM_GOTOFF:
43 case R_ARM_GOT32:43 case R_ARM_GOT32:
44 case R_ARM_GOT_PREL:
44 case R_ARM_COPY:45 case R_ARM_COPY:
45 case R_ARM_GLOB_DAT:46 case R_ARM_GLOB_DAT:
46 case R_ARM_NONE:47 case R_ARM_NONE:
@@ -93,6 +94,7 @@ int gotplt_entry_type (int reloc_type) · 46 unmodified lines
93 return BUILD_GOT_ONLY;94 return BUILD_GOT_ONLY;
94 95
95 case R_ARM_GOT32:96 case R_ARM_GOT32:
97 case R_ARM_GOT_PREL:
96 return ALWAYS_GOTPLT_ENTRY;98 return ALWAYS_GOTPLT_ENTRY;
97 }99 }
98 return -1;100 return -1;
@@ -384,6 +386,12 @@ void relocate(TCCState *s1, ElfW_Rel *rel, int type, unsigned char *ptr, addr_t · 285 unmodified lines
384 /* we load the got offset */386 /* we load the got offset */
385 *(int *)ptr += get_sym_attr(s1, sym_index, 0)->got_offset;387 *(int *)ptr += get_sym_attr(s1, sym_index, 0)->got_offset;
386 return;388 return;
389 case R_ARM_GOT_PREL:
390 /* we load the pc relative got offset */
391 *(int *)ptr += s1->got->sh_addr +
392 get_sym_attr(s1, sym_index, 0)->got_offset -
393 addr;
394 return;
387 case R_ARM_COPY:395 case R_ARM_COPY:
388 return;396 return;
389 case R_ARM_V4BX:397 case R_ARM_V4BX:
elf.h+1−0
@@ -2511,6 +2511,7 @@ typedef Elf32_Addr Elf32_Conflict; · 2510 unmodified lines
2511#define R_ARM_TLS_CALL 912511#define R_ARM_TLS_CALL 91
2512#define R_ARM_TLS_DESCSEQ 922512#define R_ARM_TLS_DESCSEQ 92
2513#define R_ARM_THM_TLS_CALL 932513#define R_ARM_THM_TLS_CALL 93
2514#define R_ARM_GOT_PREL 96
2514#define R_ARM_GNU_VTENTRY 1002515#define R_ARM_GNU_VTENTRY 100
2515#define R_ARM_GNU_VTINHERIT 1012516#define R_ARM_GNU_VTINHERIT 101
2516#define R_ARM_THM_PC11 102 /* thumb unconditional branch */2517#define R_ARM_THM_PC11 102 /* thumb unconditional branch */

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