Index: gdb/testsuite/gdb.asm/sh.inc |
diff --git a/gdb/testsuite/gdb.asm/sh.inc b/gdb/testsuite/gdb.asm/sh.inc |
index 9ea1b676c049770a9e2c98c5a35df64d426f4e97..a4a5fc545e498c5ebd61a1afb079b93e81ce1f34 100644 |
--- a/gdb/testsuite/gdb.asm/sh.inc |
+++ b/gdb/testsuite/gdb.asm/sh.inc |
@@ -31,7 +31,7 @@ |
comment "subroutine end" |
.purgem gdbasm_end |
.macro gdbasm_end name |
- .size \name, .-_foo1 |
+ .size \name, . - \name |
.align 1 |
.endm |
@@ -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 |