| OLD | NEW |
| 1 #include <stddef.h> | 1 #include <stddef.h> |
| 2 #include "dynlink.h" | 2 #include "dynlink.h" |
| 3 | 3 |
| 4 #ifdef SHARED | |
| 5 | |
| 6 #ifndef START | 4 #ifndef START |
| 7 #define START "_dlstart" | 5 #define START "_dlstart" |
| 8 #endif | 6 #endif |
| 9 | 7 |
| 10 #include "crt_arch.h" | 8 #include "crt_arch.h" |
| 11 | 9 |
| 12 #ifndef GETFUNCSYM | 10 #ifndef GETFUNCSYM |
| 13 #define GETFUNCSYM(fp, sym, got) do { \ | 11 #define GETFUNCSYM(fp, sym, got) do { \ |
| 14 __attribute__((__visibility__("hidden"))) void sym(); \ | 12 __attribute__((__visibility__("hidden"))) void sym(); \ |
| 15 static void (*static_func_ptr)() = sym; \ | 13 static void (*static_func_ptr)() = sym; \ |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 if (!IS_RELATIVE(rel[1], 0)) continue; | 137 if (!IS_RELATIVE(rel[1], 0)) continue; |
| 140 size_t *rel_addr = (void *)(base + rel[0]); | 138 size_t *rel_addr = (void *)(base + rel[0]); |
| 141 *rel_addr = base + rel[2]; | 139 *rel_addr = base + rel[2]; |
| 142 } | 140 } |
| 143 #endif | 141 #endif |
| 144 | 142 |
| 145 stage2_func dls2; | 143 stage2_func dls2; |
| 146 GETFUNCSYM(&dls2, __dls2, base+dyn[DT_PLTGOT]); | 144 GETFUNCSYM(&dls2, __dls2, base+dyn[DT_PLTGOT]); |
| 147 dls2((void *)base, sp); | 145 dls2((void *)base, sp); |
| 148 } | 146 } |
| 149 | |
| 150 #endif | |
| OLD | NEW |