about summary refs log tree commit diff
path: root/arch/x86_64/reloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/reloc.h')
-rw-r--r--arch/x86_64/reloc.h43
1 files changed, 13 insertions, 30 deletions
diff --git a/arch/x86_64/reloc.h b/arch/x86_64/reloc.h
index 9bc58496..84c075c3 100644
--- a/arch/x86_64/reloc.h
+++ b/arch/x86_64/reloc.h
@@ -1,32 +1,15 @@
-#include <stdint.h>
-#include <string.h>
-#include <elf.h>
-
 #define LDSO_ARCH "x86_64"
 
-static int remap_rel(int type)
-{
-	switch(type) {
-	case R_X86_64_64:
-		return REL_SYMBOLIC;
-	case R_X86_64_PC32:
-		return REL_OFFSET32;
-	case R_X86_64_GLOB_DAT:
-		return REL_GOT;
-	case R_X86_64_JUMP_SLOT:
-		return REL_PLT;
-	case R_X86_64_RELATIVE:
-		return REL_RELATIVE;
-	case R_X86_64_COPY:
-		return REL_COPY;
-	case R_X86_64_DTPMOD64:
-		return REL_DTPMOD;
-	case R_X86_64_DTPOFF64:
-		return REL_DTPOFF;
-	case R_X86_64_TPOFF64:
-		return REL_TPOFF;
-	case R_X86_64_TLSDESC:
-		return REL_TLSDESC;
-	}
-	return 0;
-}
+#define REL_SYMBOLIC    R_X86_64_64
+#define REL_OFFSET32    R_X86_64_PC32
+#define REL_GOT         R_X86_64_GLOB_DAT
+#define REL_PLT         R_X86_64_JUMP_SLOT
+#define REL_RELATIVE    R_X86_64_RELATIVE
+#define REL_COPY        R_X86_64_COPY
+#define REL_DTPMOD      R_X86_64_DTPMOD64
+#define REL_DTPOFF      R_X86_64_DTPOFF64
+#define REL_TPOFF       R_X86_64_TPOFF64
+#define REL_TLSDESC     R_X86_64_TLSDESC
+
+#define CRTJMP(pc,sp) __asm__ __volatile__( \
+	"mov %1,%%rsp ; jmp *%0" : : "r"(pc), "r"(sp) : "memory" )