summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/linker.cfg9
-rw-r--r--gdb/sh-stub.c18
-rw-r--r--gdb/start.s4
3 files changed, 16 insertions, 15 deletions
diff --git a/gdb/linker.cfg b/gdb/linker.cfg
index 621492afd3..5d5334b92f 100644
--- a/gdb/linker.cfg
+++ b/gdb/linker.cfg
@@ -10,14 +10,15 @@ SECTIONS
10 *(.rodata) 10 *(.rodata)
11 } 11 }
12 12
13 .bss : 13 .text :
14 { 14 {
15 _stack = . + 0x1000; 15 *(.text)
16 } 16 }
17 17
18 .text : 18 .bss :
19 { 19 {
20 *(.text) 20 _stack = . + 0x1000;
21 _stub_stack = _stack + 0x1000;
21 } 22 }
22 23
23 .pad 0x0900C800 : 24 .pad 0x0900C800 :
diff --git a/gdb/sh-stub.c b/gdb/sh-stub.c
index 4def26b797..2eb6a5d750 100644
--- a/gdb/sh-stub.c
+++ b/gdb/sh-stub.c
@@ -358,12 +358,11 @@ void catch_exception_127 (void);
358void breakpoint (void); 358void breakpoint (void);
359 359
360 360
361#define init_stack_size 2*1024 /* if you change this you should also modify BINIT */ 361//#define stub_stack_size 2*1024
362#define stub_stack_size 2*1024
363 362
364int init_stack[init_stack_size] __attribute__ ((section ("stack"))) = {0}; 363//int stub_stack[stub_stack_size] __attribute__ ((section (".stack"))) = {0};
365int stub_stack[stub_stack_size] __attribute__ ((section ("stack"))) = {0};
366 364
365extern int stub_stack[];
367 366
368void INIT (void); 367void INIT (void);
369void start (void); 368void start (void);
@@ -934,6 +933,8 @@ void breakpoint (void)
934/**** Processor-specific routines start here ****/ 933/**** Processor-specific routines start here ****/
935/**** Processor-specific routines start here ****/ 934/**** Processor-specific routines start here ****/
936 935
936extern int stack[];
937
937/* SH1/SH2 exception vector table format */ 938/* SH1/SH2 exception vector table format */
938typedef struct 939typedef struct
939{ 940{
@@ -949,13 +950,12 @@ typedef struct
949** Note that we only define the first 128 vectors, since the Jukebox 950** Note that we only define the first 128 vectors, since the Jukebox
950** firmware has its entry point at 0x200 951** firmware has its entry point at 0x200
951*/ 952*/
952
953const vec_type vectable __attribute__ ((section (".vectors"))) = 953const vec_type vectable __attribute__ ((section (".vectors"))) =
954{ 954{
955 &start, /* 0: Power-on reset PC */ 955 &start, /* 0: Power-on reset PC */
956 init_stack + init_stack_size, /* 1: Power-on reset SP */ 956 stack, /* 1: Power-on reset SP */
957 &start, /* 2: Manual reset PC */ 957 &start, /* 2: Manual reset PC */
958 init_stack + init_stack_size, /* 3: Manual reset SP */ 958 stack, /* 3: Manual reset SP */
959 { 959 {
960 &catch_exception_4, /* 4: General invalid instruction */ 960 &catch_exception_4, /* 4: General invalid instruction */
961 &catch_exception_5, /* 5: Reserved for system */ 961 &catch_exception_5, /* 5: Reserved for system */
@@ -1097,7 +1097,7 @@ void INIT (void)
1097 dofault = 1; 1097 dofault = 1;
1098 stepped = 0; 1098 stepped = 0;
1099 1099
1100 stub_sp = stub_stack + stub_stack_size; 1100 stub_sp = stub_stack;
1101 breakpoint (); 1101 breakpoint ();
1102 1102
1103 /* We should never come here */ 1103 /* We should never come here */
@@ -1115,7 +1115,7 @@ void sr(void)
1115 " bra _INIT\n" 1115 " bra _INIT\n"
1116 " nop\n" 1116 " nop\n"
1117 " .align 2\n" 1117 " .align 2\n"
1118 "L_sp: .long _init_stack + 8000"); 1118 "L_sp: .long _stack");
1119 1119
1120 asm("saveRegisters:\n"); 1120 asm("saveRegisters:\n");
1121 asm(" mov.l @(L_reg, pc), r0\n" 1121 asm(" mov.l @(L_reg, pc), r0\n"
diff --git a/gdb/start.s b/gdb/start.s
index 88ad906b70..e902db7ad6 100644
--- a/gdb/start.s
+++ b/gdb/start.s
@@ -23,7 +23,7 @@
23 .section .text 23 .section .text
24 .extern _INIT 24 .extern _INIT
25 .extern _vectable 25 .extern _vectable
26 .extern _init_stack 26 .extern _stack
27 .global _start 27 .global _start
28 .align 2 28 .align 2
29 29
@@ -36,6 +36,6 @@ _start:
36 nop 36 nop
37 37
381: .long _vectable 381: .long _vectable
392: .long _init_stack+2*1024*4 392: .long _stack
403: .long _INIT 403: .long _INIT
41 .type _start,@function 41 .type _start,@function