summaryrefslogtreecommitdiff
path: root/ldso/ldso/frv/dl-sysdep.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-12-11 12:23:37 +0000
committerEric Andersen <andersen@codepoet.org>2004-12-11 12:23:37 +0000
commita56073a28beba540347846a193d25fd61584c2af (patch)
tree5c22cb4bc0d147e50df51730aa27adf172c15ae7 /ldso/ldso/frv/dl-sysdep.h
parentfb6f30cabdaa0ed74d0f7ec9d1feb137260e37aa (diff)
Partial commit of a patch from Alexandre Oliva:
Here's an updated version of the patch I posted about a month ago. It leaves -nostdinc alone, and uses -print-file-name=include instead of -print-search-dirs to figure out where GCC's internal headers are. Please let me know whether there are any portions of this patch you'd like me to break into smaller pieces, to rework, or to give up trying to get into uClibc :-) Thanks,
Diffstat (limited to 'ldso/ldso/frv/dl-sysdep.h')
-rw-r--r--ldso/ldso/frv/dl-sysdep.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/ldso/ldso/frv/dl-sysdep.h b/ldso/ldso/frv/dl-sysdep.h
index 32d540caf..158f6af04 100644
--- a/ldso/ldso/frv/dl-sysdep.h
+++ b/ldso/ldso/frv/dl-sysdep.h
@@ -129,6 +129,16 @@ struct funcdesc_ht;
#define DL_ADDR_IN_LOADADDR(ADDR, TPNT, TFROM) \
(! (TFROM) && __dl_addr_in_loadaddr ((void*)(ADDR), (TPNT)->loadaddr))
+/* Make sure we only load libraries that use the same number of
+ general-purpose and floating-point registers the dynamic loader was
+ compiled for. */
+#define DL_CHECK_REG_COUNT(flags) \
+ (((flags & EF_FRV_GPR_MASK) == EF_FRV_GPR_32 ? __FRV_GPR__ == 32 : 1) \
+ && ((flags & EF_FRV_GPR_MASK) == EF_FRV_GPR_64 ? __FRV_GPR__ == 64 : 1) \
+ && ((flags & EF_FRV_FPR_MASK) == EF_FRV_FPR_32 ? __FRV_FPR__ == 32 : 1) \
+ && ((flags & EF_FRV_FPR_MASK) == EF_FRV_FPR_64 ? __FRV_FPR__ == 64 : 1) \
+ && ((flags & EF_FRV_FPR_MASK) == EF_FRV_FPR_NONE ? __FRV_FPR__ == 0 : 1))
+
/* We only support loading FDPIC independently-relocatable shared
libraries. It probably wouldn't be too hard to support loading
shared libraries that require relocation by the same amount, but we
@@ -149,6 +159,14 @@ do \
_dl_close(infile); \
return NULL; \
} \
+\
+ if (! DL_CHECK_REG_COUNT ((epnt)->e_flags)) \
+ { \
+ _dl_internal_error_number = LD_ERROR_NOTDYN; \
+ _dl_dprintf(2, "%s: '%s' assumes different register counts" \
+ "\n", (_dl_progname), (libname)); \
+ _dl_close(infile); \
+ } \
} \
while (0)
@@ -172,6 +190,14 @@ while (0)
(TPNT)->loadaddr.got_value) \
: DL_RELOC_ADDR ((SYM)->st_value, (TPNT)->loadaddr))
+#define DL_GET_READY_TO_RUN_EXTRA_PARMS \
+ , struct elf32_fdpic_loadmap *dl_boot_progmap
+#define DL_GET_READY_TO_RUN_EXTRA_ARGS \
+ , dl_boot_progmap
+
+
+
+
#ifdef __USE_GNU
# include <link.h>
#else