aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAron BARATH <baratharon@caesar.elte.hu>2017-05-16 07:03:26 +0200
committerAron BARATH <baratharon@caesar.elte.hu>2017-05-16 07:03:26 +0200
commit307b7b183d4ee56e74090b0e525d6a587840e31f (patch)
tree78d78f3b950348d8c5d7f25f6dad0b796fd2d0f7
parent28435ec58c2ef9bb571cad5f8a1129aea3ecc204 (diff)
downloadtinycc-307b7b183d4ee56e74090b0e525d6a587840e31f.tar.gz
tinycc-307b7b183d4ee56e74090b0e525d6a587840e31f.tar.bz2
the R_X86_64_GOTOFF64 relocation was missing
-rw-r--r--x86_64-link.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/x86_64-link.c b/x86_64-link.c
index 1eff97e..c0c5e13 100644
--- a/x86_64-link.c
+++ b/x86_64-link.c
@@ -41,6 +41,7 @@ int code_reloc (int reloc_type)
case R_X86_64_GLOB_DAT:
case R_X86_64_COPY:
case R_X86_64_RELATIVE:
+ case R_X86_64_GOTOFF64:
return 0;
case R_X86_64_PC32:
@@ -84,6 +85,7 @@ int gotplt_entry_type (int reloc_type)
case R_X86_64_GOT64:
case R_X86_64_GOTPC32:
case R_X86_64_GOTPC64:
+ case R_X86_64_GOTOFF64:
case R_X86_64_GOTPCREL:
case R_X86_64_GOTPCRELX:
case R_X86_64_REX_GOTPCRELX:
@@ -281,6 +283,9 @@ void relocate(TCCState *s1, ElfW_Rel *rel, int type, unsigned char *ptr, addr_t
/* we load the got offset */
add64le(ptr, s1->sym_attrs[sym_index].got_offset);
break;
+ case R_X86_64_GOTOFF64:
+ add64le(ptr, val - s1->got->sh_addr);
+ break;
case R_X86_64_RELATIVE:
/* do nothing */
break;