do not expose "ra" to cpp because it muddles up the .c code above.
authorderaadt <deraadt@openbsd.org>
Tue, 23 Dec 2014 16:27:18 +0000 (16:27 +0000)
committerderaadt <deraadt@openbsd.org>
Tue, 23 Dec 2014 16:27:18 +0000 (16:27 +0000)
instead handle it internally as $ra
solution from kettenis, ok guenther

lib/csu/mips64/md_init.h

index d57144b..2bc75ae 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.6 2014/02/22 18:10:39 miod Exp $ */
+/* $OpenBSD: md_init.h,v 1.7 2014/12/23 16:27:18 deraadt Exp $ */
 
 /*-
  * Copyright (c) 2001 Ross Harvey
@@ -34,8 +34,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define ra      "$31"
-
 /*
  * Allocate 32 bytes for the stack frame.  Store GP at SP+16 (since
  * this is where code generated by the compiler for fallthru processing
        "       .set    reorder                 \n"     \
        "       dsubu    $sp,$sp,32             \n"     \
        "       .cpsetup $25, 16, "#entry_pt"   \n"     \
-       "       sd      "ra",24($sp)            \n"
+       "       sd      $ra ,24($sp)            \n"
 #else
 #define MD_FUNCTION_PROLOGUE(entry_pt)                 \
        "       dsubu   $sp,$sp,32              \n"     \
-       "       sd      "ra",24($sp)            \n"
+       "       sd      $ra ,24($sp)            \n"
 #endif
 
 
 #define MD_SECTION_EPILOGUE(sect)                       \
        __asm (                                         \
        ".section "#sect",\"ax\",@progbits      \n"     \
-       "       ld      "ra",24($sp)            \n"     \
+       "       ld      $ra ,24($sp)            \n"     \
        " # next should have been a .cpreturn   \n"     \
        "       ld      $gp,16($sp)             \n"     \
        "       .set    noreorder               \n"     \
-       "       j       "ra"                    \n"     \
+       "       j       $ra                     \n"     \
        "       daddu   $sp,$sp,32              \n"     \
        "       .set    reorder                 \n"     \
        ".previous")