summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2015-02-19 19:13:59 +0530
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-02-20 11:30:20 +0100
commitafab56958f1cbb47b831ee3ebff231dfbae74af2 (patch)
treec6fdf19ecb770319d72048c7c56bd71964d52948 /ldso
parent89b63496e88c31c2714e42656212078388718b78 (diff)
ARCv2 ISA support
This is next gen Instruction Set Architecture from Synopsys and basis for the ARC HS family of processors. http://www.synopsys.com/dw/ipdir.php?ds=arc-hs38-processor&elq_mid=5732&elq_cid=458802 http://www.synopsys.com/IP/ProcessorIP/ARCProcessors/arc-hs/Pages/default.aspx Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/arc/dl-sysdep.h15
-rw-r--r--ldso/ldso/arc/elfinterp.c4
2 files changed, 17 insertions, 2 deletions
diff --git a/ldso/ldso/arc/dl-sysdep.h b/ldso/ldso/arc/dl-sysdep.h
index 08b3bade8..ca62a2c04 100644
--- a/ldso/ldso/arc/dl-sysdep.h
+++ b/ldso/ldso/arc/dl-sysdep.h
@@ -69,11 +69,16 @@ do { \
} while(0)
/* Here we define the magic numbers that this dynamic loader should accept */
+#ifdef __A7__
#define MAGIC1 EM_ARCOMPACT
+#define ELF_TARGET "ARCompact" /* For error messages */
+#elif defined(__HS__)
+#define MAGIC1 EM_ARCV2
+#define ELF_TARGET "ARCv2" /* For error messages */
+#endif
+
#undef MAGIC2
-/* Used for error messages */
-#define ELF_TARGET "ARC"
struct elf_resolve;
extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt,
@@ -81,6 +86,8 @@ extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt,
extern unsigned __udivmodsi4(unsigned, unsigned) attribute_hidden;
+#ifdef __A7__
+/* using "C" causes an indirection via __umodsi3 -> __udivmodsi4 */
#define do_rem(result, n, base) ((result) = \
\
__builtin_constant_p (base) ? (n) % (unsigned) (base) : \
@@ -95,6 +102,10 @@ extern unsigned __udivmodsi4(unsigned, unsigned) attribute_hidden;
r1; \
}) \
)
+#elif defined(__HS__)
+/* ARCv2 has hardware assisted divide/mod */
+#define do_rem(result, n, base) ((result) = (n) % (unsigned) (base))
+#endif
/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
TLS variable so PLT entries should not be allowed to define the value.
diff --git a/ldso/ldso/arc/elfinterp.c b/ldso/ldso/arc/elfinterp.c
index d26c94705..7c31d3ac7 100644
--- a/ldso/ldso/arc/elfinterp.c
+++ b/ldso/ldso/arc/elfinterp.c
@@ -11,7 +11,11 @@
*/
#include "ldso.h"
+#ifdef __A7__
#define ARC_PLT_SIZE 12
+#else
+#define ARC_PLT_SIZE 16
+#endif
unsigned long
_dl_linux_resolver(struct elf_resolve *tpnt, unsigned int plt_pc)