[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 312ef8d7ba491d26e3b54d8c80b0e06a2fd990eb..5cf927dac7b3f2c4865c339c9132394bfe9e7ac1 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 2706a85f023adfb7cf7beb484b392f3829c11343..1ffb5dec51e39a7110627ed6166d742ee30c0a3c 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.  */