1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #ifdef __FRV_FDPIC__
- #include <sys/types.h>
- #include <link.h>
- static __always_inline void ***
- reloc_range_indirect (void ***p, void ***e,
- const struct elf32_fdpic_loadmap *map)
- {
- while (p < e)
- {
- void *ptr = __reloc_pointer (*p, map);
- if (ptr)
- {
- void *pt;
- if ((long)ptr & 3)
- __builtin_memcpy(&pt, ptr, sizeof(pt));
- else
- pt = *(void**)ptr;
- pt = __reloc_pointer (pt, map);
- if ((long)ptr & 3)
- __builtin_memcpy(ptr, &pt, sizeof(pt));
- else
- *(void**)ptr = pt;
- }
- p++;
- }
- return p;
- }
- attribute_hidden void*
- __self_reloc (const struct elf32_fdpic_loadmap *map,
- void ***p, void ***e)
- {
- p = reloc_range_indirect (p, e-1, map);
- if (p >= e)
- return (void*)-1;
- return __reloc_pointer (*p, map);
- }
- #endif
|