new dlstart stage-2 chaining for x86_64 and x32
authorRich Felker <dalias@aerifal.cx>
Thu, 17 Sep 2015 07:28:44 +0000 (07:28 +0000)
committerRich Felker <dalias@aerifal.cx>
Thu, 17 Sep 2015 07:28:44 +0000 (07:28 +0000)
arch/x32/reloc.h
arch/x86_64/reloc.h

index 574f44a..dc039ad 100644 (file)
@@ -24,3 +24,8 @@
 
 #define CRTJMP(pc,sp) __asm__ __volatile__( \
        "mov %1,%%esp ; jmp *%0" : : "r"((uint64_t)(uintptr_t)pc), "r"(sp) : "memory" )
+
+#define GETFUNCSYM(fp, sym, got) __asm__ ( \
+       ".hidden " #sym "\n" \
+       "       lea " #sym "(%%rip),%0\n" \
+       : "=r"(*fp) : : "memory" )
index 84c075c..fac0c0a 100644 (file)
@@ -13,3 +13,8 @@
 
 #define CRTJMP(pc,sp) __asm__ __volatile__( \
        "mov %1,%%rsp ; jmp *%0" : : "r"(pc), "r"(sp) : "memory" )
+
+#define GETFUNCSYM(fp, sym, got) __asm__ ( \
+       ".hidden " #sym "\n" \
+       "       lea " #sym "(%%rip),%0\n" \
+       : "=r"(*fp) : : "memory" )