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
4141 case R_ARM_GOTPC:
4242 case R_ARM_GOTOFF:
4343 case R_ARM_GOT32:
44+ case R_ARM_GOT_PREL:
4445 case R_ARM_COPY:
4546 case R_ARM_GLOB_DAT:
4647 case R_ARM_NONE:
@@ -93,6 +94,7 @@ int gotplt_entry_type (int reloc_type) · 46 unmodified lines
9394 return BUILD_GOT_ONLY;
9495
9596 case R_ARM_GOT32:
97+ case R_ARM_GOT_PREL:
9698 return ALWAYS_GOTPLT_ENTRY;
9799 }
98100 return -1;
@@ -384,6 +386,12 @@ void relocate(TCCState *s1, ElfW_Rel *rel, int type, unsigned char *ptr, addr_t · 285 unmodified lines
384386 /* we load the got offset */
385387 *(int *)ptr += get_sym_attr(s1, sym_index, 0)->got_offset;
386388 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;
387395 case R_ARM_COPY:
388396 return;
389397 case R_ARM_V4BX:
elf.h+1−0
@@ -2511,6 +2511,7 @@ typedef Elf32_Addr Elf32_Conflict; · 2510 unmodified lines
25112511 #define R_ARM_TLS_CALL 91
25122512 #define R_ARM_TLS_DESCSEQ 92
25132513 #define R_ARM_THM_TLS_CALL 93
2514+#define R_ARM_GOT_PREL 96
25142515 #define R_ARM_GNU_VTENTRY 100
25152516 #define R_ARM_GNU_VTINHERIT 101
25162517 #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