gdb/testsuite/
authorThomas Schwinge <tschwinge@gnu.org>
Mon, 16 Apr 2012 08:02:09 +0000 (08:02 +0000)
committerThomas Schwinge <tschwinge@gnu.org>
Mon, 16 Apr 2012 08:02:09 +0000 (08:02 +0000)
* gdb.asm/sh.inc (gdbasm_startup): Only set up the stack pointer if the
symbol _stack is defined.  Get rid of a hard-coded constant for _stack.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.asm/sh.inc

index c47160e..a4acfd8 100644 (file)
@@ -1,5 +1,8 @@
 2012-04-16  Thomas Schwinge  <thomas@codesourcery.com>
 
+       * gdb.asm/sh.inc (gdbasm_startup): Only set up the stack pointer if the
+       symbol _stack is defined.  Get rid of a hard-coded constant for _stack.
+
        * gdb.asm/sh.inc (gdbasm_end) <.size>: Refer to the function's name.
 
 2012-04-14  Anton Gorenkov <xgsa@yandex.ru>
index 8816cb4..a4a5fc5 100644 (file)
 
        comment "crt0 startup"
        .macro gdbasm_startup
-       mov.l   .stackaddr,r15
+       comment "If there is a _stack symbol, use it for setting up the stack"
+       comment "pointer.  In hosted mode (when there is no _stack symbol),"
+       comment "the operating system will have initialized it already."
+       mov.l   .stackaddr, r0
+       tst     r0, r0
+       bt      .afterstackaddr
+       mov     r0, r15
        bra     .afterstackaddr
        nop
-       nop
        .align 2
 .stackaddr:
-       .long   196608          ! 0x30000
+       .weak   _stack
+       .long   _stack
        .align  1
 .afterstackaddr:
        .endm