compilers targeting armv7 may be configured to produce thumb2 code
instead of arm code by default, and in the future we may wish to
support targets where only the thumb instruction set is available.
the instructions this patch omits in thumb mode are needed only for
non-thumb versions of armv4 or earlier, which are not supported by any
current compilers/toolchains and thus rather pointless to have. at
some point these compatibility return sequences may be removed from
all asm source files, and in that case it would make sense to remove
them here too and remove the ifdef.
#define REL_TPOFF R_ARM_TLS_TPOFF32
//#define REL_TLSDESC R_ARM_TLS_DESC
+#ifdef __thumb__
+#define CRTJMP(pc,sp) __asm__ __volatile__( \
+ "mov sp,%1 ; bx %0" : : "r"(pc), "r"(sp) : "memory" )
+#else
#define CRTJMP(pc,sp) __asm__ __volatile__( \
"mov sp,%1 ; tst %0,#1 ; moveq pc,%0 ; bx %0" : : "r"(pc), "r"(sp) : "memory" )
+#endif