This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 3/3] [ARC] Use long jumps for CRT calls
- From: Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <Claudiu dot Zissulescu at synopsys dot com>, <Francois dot Bedard at synopsys dot com>, <andrew dot burgess at embecosm dot com>
- Date: Tue, 4 Apr 2017 11:59:01 +0200
- Subject: [PATCH 3/3] [ARC] Use long jumps for CRT calls
- Authentication-results: sourceware.org; auth=none
- References: <1491299941-3908-1-git-send-email-claziss@synopsys.com>
There are situations when the range offered by the bl instruction is
not sufficient to reach CRT routines. Thus, use a long jump
construction.
gcc/
2016-04-21 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.h (CRT_CALL_STATIC_FUNCTION): Use long calls.
---
gcc/config/arc/arc.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 0237e66..0c7e561 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -1518,10 +1518,11 @@ extern enum arc_function_type arc_compute_function_type (struct function *);
/* Called by crtstuff.c to make calls to function FUNCTION that are defined in
SECTION_OP, and then to switch back to text section. */
#undef CRT_CALL_STATIC_FUNCTION
-#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
- asm (SECTION_OP "\n\t" \
- "bl @" USER_LABEL_PREFIX #FUNC "\n" \
- TEXT_SECTION_ASM_OP);
+#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
+ asm (SECTION_OP "\n\t" \
+ "add r12,pcl,@" USER_LABEL_PREFIX #FUNC "@pcl\n\t" \
+ "jl [r12]\n" \
+ TEXT_SECTION_ASM_OP);
/* This macro expands to the name of the scratch register r12, used for
temporary calculations according to the ABI. */
--
1.9.1