From dd6d3b70d9310dafd66594a909158381b4b3f2b0 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 16 Apr 2012 08:02:09 +0000 Subject: [PATCH] gdb/testsuite/ * 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 | 3 +++ gdb/testsuite/gdb.asm/sh.inc | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c47160e..a4acfd8 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2012-04-16 Thomas Schwinge + * 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 diff --git a/gdb/testsuite/gdb.asm/sh.inc b/gdb/testsuite/gdb.asm/sh.inc index 8816cb4..a4a5fc5 100644 --- a/gdb/testsuite/gdb.asm/sh.inc +++ b/gdb/testsuite/gdb.asm/sh.inc @@ -65,13 +65,19 @@ 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 -- 2.7.4