提交 c0f10cf0 编写于 作者: R Rich Felker

make arm reloc.h CRTJMP macro compatible with thumb

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.
上级 83340c7a
......@@ -28,5 +28,10 @@
#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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册