[ARC] Use long jumps for CRT calls
authorClaudiu Zissulescu <claziss@synopsys.com>
Fri, 14 Apr 2017 11:41:04 +0000 (13:41 +0200)
committerClaudiu Zissulescu <claziss@gcc.gnu.org>
Fri, 14 Apr 2017 11:41:04 +0000 (13:41 +0200)
gcc/
2017-04-17  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.h (CRT_CALL_STATIC_FUNCTION): Use long calls.

From-SVN: r246927

gcc/ChangeLog
gcc/config/arc/arc.h

index 312ef8d..5cf927d 100644 (file)
@@ -1,5 +1,9 @@
 2017-04-14  Claudiu Zissulescu  <claziss@synopsys.com>
 
+       * config/arc/arc.h (CRT_CALL_STATIC_FUNCTION): Use long calls.
+
+2017-04-14  Claudiu Zissulescu  <claziss@synopsys.com>
+
        * config/arc/arc-protos.h (arc_decl_pretend_args): Remove.
        * config/arc/arc.c (arc_decl_pretend_args): Likewise.
        * config/arc/arc.h (CFA_FRAME_BASE_OFFSET): Likewise.
index 2706a85..1ffb5de 100644 (file)
@@ -1515,10 +1515,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.  */