summaryrefslogtreecommitdiff
path: root/ldso/ldso/mips/dl-sysdep.h
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-12-22 09:58:25 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-12-22 09:58:25 +0000
commit7f07b8deffa7eaea0cbab9e84503b7644a6b6f8e (patch)
tree9522982b9b2fa18bfecf8f2b90d7e6aec8f6078e /ldso/ldso/mips/dl-sysdep.h
parentee5c521918299702920667f4a2c1a6916791d421 (diff)
- non-pic support for MIPS (Catherine Moore, clm at codesourcery com)
Diffstat (limited to 'ldso/ldso/mips/dl-sysdep.h')
-rw-r--r--ldso/ldso/mips/dl-sysdep.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/ldso/ldso/mips/dl-sysdep.h b/ldso/ldso/mips/dl-sysdep.h
index 728779250..8f303fba1 100644
--- a/ldso/ldso/mips/dl-sysdep.h
+++ b/ldso/ldso/mips/dl-sysdep.h
@@ -93,10 +93,11 @@ typedef struct
#include <link.h>
-#define ARCH_NUM 3
+#define ARCH_NUM 4
#define DT_MIPS_GOTSYM_IDX (DT_NUM + OS_NUM)
#define DT_MIPS_LOCAL_GOTNO_IDX (DT_NUM + OS_NUM +1)
#define DT_MIPS_SYMTABNO_IDX (DT_NUM + OS_NUM +2)
+#define DT_MIPS_PLTGOT_IDX (DT_NUM + OS_NUM +3)
#define ARCH_DYNAMIC_INFO(dpnt, dynamic, debug_addr) \
do { \
@@ -106,6 +107,8 @@ else if (dpnt->d_tag == DT_MIPS_LOCAL_GOTNO) \
dynamic[DT_MIPS_LOCAL_GOTNO_IDX] = dpnt->d_un.d_val; \
else if (dpnt->d_tag == DT_MIPS_SYMTABNO) \
dynamic[DT_MIPS_SYMTABNO_IDX] = dpnt->d_un.d_val; \
+else if (dpnt->d_tag == DT_MIPS_PLTGOT) \
+ dynamic[DT_MIPS_PLTGOT_IDX] = dpnt->d_un.d_val; \
else if (dpnt->d_tag == DT_MIPS_RLD_MAP) \
*(ElfW(Addr) *)(dpnt->d_un.d_ptr) = (ElfW(Addr)) debug_addr; \
} while (0)
@@ -114,6 +117,7 @@ else if (dpnt->d_tag == DT_MIPS_RLD_MAP) \
#define INIT_GOT(GOT_BASE,MODULE) \
do { \
unsigned long idx; \
+ unsigned long *pltgot; \
\
/* Check if this is the dynamic linker itself */ \
if (MODULE->libtype == program_interpreter) \
@@ -123,6 +127,12 @@ do { \
GOT_BASE[0] = (unsigned long) _dl_runtime_resolve; \
GOT_BASE[1] = (unsigned long) MODULE; \
\
+ pltgot = MODULE->dynamic_info[DT_MIPS_PLTGOT_IDX]; \
+ if (pltgot) { \
+ pltgot[0] = (unsigned long) _dl_runtime_pltresolve; \
+ pltgot[1] = (unsigned long) MODULE; \
+ } \
+ \
/* Add load address displacement to all local GOT entries */ \
idx = 2; \
while (idx < MODULE->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX]) \
@@ -151,9 +161,9 @@ void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy)
#define OFFS_ALIGN (0x10000000000UL-0x1000)
#endif /* O32 || N32 */
-#define elf_machine_type_class(type) ELF_RTYPE_CLASS_PLT
-/* MIPS does not have COPY relocs */
-#define DL_NO_COPY_RELOCS
+#define elf_machine_type_class(type) \
+ ((((type) == R_MIPS_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
+ | (((type) == R_MIPS_COPY) * ELF_RTYPE_CLASS_COPY))
#define OFFSET_GP_GOT 0x7ff0