X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=arch%2Fmips%2Freloc.h;h=07fa10a7e8ec2879e9427d0f94e3cd58f7c802bc;hb=dbed392410e333fde86c14ea17a46d1ad9c760f1;hp=f5e9c77b0c63f4e9754b8fee95661d71c87e4b67;hpb=9ec4283b28cf676292fd5c6f681bef1e90e30c18;p=musl diff --git a/arch/mips/reloc.h b/arch/mips/reloc.h index f5e9c77b..07fa10a7 100644 --- a/arch/mips/reloc.h +++ b/arch/mips/reloc.h @@ -1,7 +1,14 @@ #include #include +#include -#define ETC_LDSO_PATH "/etc/ld-musl-mips.path" +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define ENDIAN_SUFFIX "el" +#else +#define ENDIAN_SUFFIX "" +#endif + +#define LDSO_ARCH "mips" ENDIAN_SUFFIX #define IS_COPY(x) ((x)==R_MIPS_COPY) #define IS_PLT(x) 1 @@ -44,7 +51,7 @@ void __reloc_self(int c, size_t *a, size_t *dynv, size_t *got) for (a+=c+1; *a; a++); for (a++; *a; a+=2) if (*a<20) t[*a] = a[1]; base = (char *)t[AT_BASE]; - if (!base) base = (char *)(t[AT_PHDR] & -4096); + if (!base) base = (char *)(t[AT_PHDR] & -t[AT_PAGESZ]); for (a=dynv; *a; a+=2) if (*a-0x70000000UL<20) t[*a&31] = a[1]; n = t[DT_MIPS_LOCAL_GOTNO - 0x70000000]; for (a=got; n; a++, n--) *a += (size_t)base;