]> rtime.felk.cvut.cz Git - sysless.git/blob - board/h8300/h8eurobot/libs/h8canusb.ld-boot
h8300: correct broken ld-scipts for h8eurobot and h8canusb boards.
[sysless.git] / board / h8300 / h8eurobot / libs / h8canusb.ld-boot
1 /* linker script for inteligent boot block (for user-program-mode boot-loader in flash) */
2
3 INCLUDE "h8canusb.ld-cfg"
4
5 PROVIDE( ___stack_top = ( __iram0_end & ~ 3 ) - 4 );
6 /*PROVIDE( ___setup_board = _start);*/
7
8 STARTUP(crt0.o)
9 INPUT(bsp0common.o)
10 INPUT(bsp0hwinit.o setup_board.o)
11
12 SECTIONS
13 {
14         .fvector :
15         {
16           ___flashbb_vector = . ;
17           LONG( ABSOLUTE( ___setup_board ) )
18           *(.fvector)
19         } > flashvec
20         
21         .shadreg (NOLOAD) :
22         {
23           *(.shadreg)
24           . = ALIGN( 0x4 ) ;
25         } > iram0
26
27         .text.boot_fn ALIGN(4) :
28         {
29           . = ALIGN( 0x4 ) ;
30           KEEP (boot_fn.o(.text))
31           KEEP (boot_fn.o(.rodata))
32           KEEP (boot_fn.o(.strings))
33           . = ALIGN( 4 ) ;
34         } > iram0 AT>flashbb
35         ___boot_fn_start = ADDR(.text.boot_fn);
36         ___boot_fn_end   = ADDR(.text.boot_fn) + SIZEOF(.text.boot_fn);
37         ___boot_fn_load  = LOADADDR(.text.boot_fn);
38
39         .text :
40         {
41           text_start = . ;
42           KEEP (crt0.o(.text))
43           *(.text)
44           *(.rodata)                            
45           *(.text .stub .text.* .gnu.linkonce.t.*)
46           *(.rodata .rodata.* .gnu.linkonce.r.*)
47           *(.strings)
48           . = ALIGN( 0x4 ) ;
49           _etext = ALIGN( 0x4 ) ;
50         } > flashbb
51         .tors : 
52         {
53           ___ctors = . ;
54           *(.ctors)
55           ___ctors_end = . ;
56           ___dtors = . ;
57           *(.dtors)
58           ___dtors_end = . ;
59           . = ALIGN( 0x4 ) ;
60           ___data_lma = ALIGN( 0x4 ) ;
61         }  > flashbb /*at> flashusr*/
62
63         .data :
64           AT ( ADDR( .tors ) + SIZEOF( .tors ) )
65         {
66           . = ALIGN( 0x4 ) ;
67           _data_start = ALIGN( 0x4 ) ;
68           *(.data)
69           . = ALIGN( 0x4 ) ;
70           _edata = ALIGN( 0x4 ) ;
71         } > iram1
72
73         /* ___data_lma = LOADADDR(.data) ; */
74         
75         .bss :
76         {
77           . = ALIGN( 0x4 ) ;
78           _bss_start = ALIGN( 0x4 ) ;
79           *(.bss)
80           *(COMMON)
81           . = ALIGN( 0x4 ) ;
82           _end = . ;
83         } > iram0
84         
85         .flashusr :
86         {
87           _usrprog_start = . ;
88         } > flashusr
89
90         /* Stabs debugging sections.  */
91         .stab          0 (NOLOAD): { *(.stab) }
92         .stabstr       0 (NOLOAD): { *(.stabstr) }
93         .stab.excl     0 (NOLOAD): { *(.stab.excl) }
94         .stab.exclstr  0 (NOLOAD): { *(.stab.exclstr) }
95         .stab.index    0 (NOLOAD): { *(.stab.index) }
96         .stab.indexstr 0 (NOLOAD): { *(.stab.indexstr) }
97         .comment       0 (NOLOAD): { *(.comment) }
98         /* DWARF debug sections.
99            Symbols in the DWARF debugging sections are relative to the beginning
100            of the section so we begin them at 0.  */
101         /* DWARF 1 */
102         .debug          0 (NOLOAD): { *(.debug) }
103         .line           0 (NOLOAD): { *(.line) }
104         /* GNU DWARF 1 extensions */
105         .debug_srcinfo  0 (NOLOAD): { *(.debug_srcinfo) }
106         .debug_sfnames  0 (NOLOAD): { *(.debug_sfnames) }
107         /* DWARF 1.1 and DWARF 2 */
108         .debug_aranges  0 (NOLOAD): { *(.debug_aranges) }
109         .debug_pubnames 0 (NOLOAD): { *(.debug_pubnames) }
110         /* DWARF 2 */
111         .debug_info     0 (NOLOAD): { *(.debug_info .gnu.linkonce.wi.*) }
112         .debug_abbrev   0 (NOLOAD): { *(.debug_abbrev) }
113         .debug_line     0 (NOLOAD): { *(.debug_line) }
114         .debug_frame    0 (NOLOAD): { *(.debug_frame) }
115         .debug_str      0 (NOLOAD): { *(.debug_str) }
116         .debug_loc      0 (NOLOAD): { *(.debug_loc) }
117         .debug_macinfo  0 (NOLOAD): { *(.debug_macinfo) }
118         /* SGI/MIPS DWARF 2 extensions */
119         .debug_weaknames 0 (NOLOAD): { *(.debug_weaknames) }
120         .debug_funcnames 0 (NOLOAD): { *(.debug_funcnames) }
121         .debug_typenames 0 (NOLOAD): { *(.debug_typenames) }
122         .debug_varnames  0 (NOLOAD): { *(.debug_varnames) }
123         /* DWARF 3 */
124         .debug_pubtypes 0 (NOLOAD): { *(.debug_pubtypes) }
125         .debug_ranges   0 (NOLOAD): { *(.debug_ranges) }
126         .gnu.attributes 0 (NOLOAD): { KEEP (*(.gnu.attributes)) }
127 }