source: rtems/c/src/lib/libbsp/powerpc/helas403/startup/linkcmds @ 4cb5d29

4.104.114.84.95
Last change on this file since 4cb5d29 was 4cb5d29, checked in by Joel Sherrill <joel.sherrill@…>, on 09/29/00 at 13:33:23

2000-09-29 Charles-Antoine Gauthier <charles.gauthier@…>

  • startup/linkcmds: Added lines so DWARF debug information would be available. Otherwise gdb complains that the offsets for the debug info are incorrect and doesn't load the files.
  • Property mode set to 100644
File size: 5.2 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the helas-403
4 *  This file is intended to be used together with flashentry.s
5 *  it will generate a ROM that can be started directly after powerup reset
6 *  $Id$
7 */
8
9OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
10              "elf32-powerpc")
11OUTPUT_ARCH(powerpc)
12 SEARCH_DIR(/usr/local/powerpc-rtems/lib);
13 
14ENTRY(flash_entry)
15 
16MEMORY
17  {
18        RAM : ORIGIN = 0, LENGTH = 8M
19        FLASH : ORIGIN = 0xFFF00000, LENGTH = 512K
20  }
21
22  /* DIRTY TRICK: repeat addresses here, so we can work with them... */
23  flash.start = 0xFFF00000;
24  flash.size  = 512K;
25
26SECTIONS
27{
28  .entry :
29  {
30     *(.entry)
31  } > FLASH /* this is ROM for flash_entry */
32  .text :
33  {
34     text.start = . ;
35     *(.entry2)
36     *(.text)
37     *(.rodata)
38     *(.rodata1)
39     *(.descriptors)
40     *(rom_ver)
41     etext = ALIGN(0x10);
42     _etext = .;
43
44
45     __CTOR_LIST__ = .;
46     LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
47     *(.ctors)
48     LONG(0)
49     __CTOR_END__ = .;
50
51     __DTOR_LIST__ = .;
52     LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
53     *(.dtors)
54     LONG(0)
55     __DTOR_END__ = .;
56
57     *(.lit)
58     *(.shdata)
59     *(.init)
60     *(.fini)
61     . = ALIGN(0x10);
62     _endtext = .;
63     text.end = .;
64     copy.src = .;
65     copy.tmptop.txt = .;
66  } > FLASH /* this is ROM for flash_entry */
67
68  text.size = text.end - text.start;
69
70  /* R/W Data */
71  /* place vectors to start at offset 0x100... */
72  /* IMPORTANT: sections ".fill" and ".vectors" must be the first in RAM!!*/
73  .fill 0x00010000 :
74  {
75    . = . + 0x0100;
76  } > RAM
77 
78  .vectors :              AT (copy.src)
79  {
80    copy.dest = .;
81    *(.vectors)
82    . = ALIGN(0x10);
83    copy.tmptop.vec = .;
84  } > RAM
85
86  .data :                 AT (copy.tmptop.vec - copy.dest + copy.src)
87  {
88    *(.data)
89    *(.data1)
90    PROVIDE (__SDATA_START__ = .);
91    *(.sdata)
92    . = ALIGN(0x10);
93    copy.tmptop.dat = .;
94  } > RAM
95 
96  PROVIDE (__EXCEPT_START__ = .);
97  .gcc_except_table   :   AT (copy.tmptop.dat - copy.dest + copy.src)
98  {
99    *(.gcc_except_table)
100    . = ALIGN(0x10);
101    copy.tmptop.exc = .;
102  } >RAM
103  PROVIDE (__EXCEPT_END__ = .);
104
105  __GOT_START__ = .;
106  .got :                  AT (copy.tmptop.exc - copy.dest + copy.src)
107  {
108    s.got = .;
109    *(.got.plt) *(.got)
110    . = ALIGN(0x10);
111    copy.tmptop.got = .;
112  } > RAM
113  __GOT_END__ = .;
114
115  .got1 :                 AT (copy.tmptop.got - copy.dest + copy.src)
116  {
117    *(.got1)           
118    . = ALIGN(0x10);
119    copy.tmptop.gt1 = .;
120  } >RAM
121
122  PROVIDE (__GOT2_START__ = .);
123  PROVIDE (_GOT2_START_ = .);
124  .got2           :       AT (copy.tmptop.gt1 - copy.dest + copy.src)
125  {
126    *(.got2)   
127    . = ALIGN(0x10);
128    copy.tmptop.gt2 = .;
129  } >RAM
130  PROVIDE (__GOT2_END__ = .);
131  PROVIDE (_GOT2_END_ = .);
132
133  PROVIDE (__FIXUP_START__ = .);
134  PROVIDE (_FIXUP_START_ = .);
135  .fixup          :       AT (copy.tmptop.gt2 - copy.dest + copy.src)
136  {
137    *(.fixup)   
138    . = ALIGN(0x10);
139    copy.tmptop.fix = .;
140  } >RAM
141  PROVIDE (_FIXUP_END_ = .);
142  PROVIDE (__FIXUP_END__ = .);
143 
144  PROVIDE (__SDATA2_START__ = .);
145  .sdata2         :       AT (copy.tmptop.fix - copy.dest + copy.src)
146  {
147    *(.sdata2) 
148    . = ALIGN(0x10);
149    copy.tmptop.sda = .;
150  } >RAM
151
152  copy.size = copy.tmptop.sda - copy.dest;
153
154  .sbss2          :
155  {
156    *(.sbss2)   
157  } >RAM
158  PROVIDE (__SBSS2_END__ = .);
159
160  __SBSS_START__ = .;
161  .bss :
162  {
163    bss.start = .;
164    *(.bss) *(.sbss) *(COMMON)
165    bss.end = ALIGN(4);
166  } > RAM
167  __SBSS_END__ = .;
168 
169  bss.size = bss.end - bss.start;
170
171  /* reserve 16KByte for stack... */
172  stack.end = bss.end + 16K;
173  PROVIDE(_end = stack.end);
174
175
176  /* Stabs debugging sections.  */
177  .stab 0 : { *(.stab) }
178  .stabstr 0 : { *(.stabstr) }
179  .stab.excl 0 : { *(.stab.excl) }
180  .stab.exclstr 0 : { *(.stab.exclstr) }
181  .stab.index 0 : { *(.stab.index) }
182  .stab.indexstr 0 : { *(.stab.indexstr) }
183  .comment 0 : { *(.comment) }
184
185  /* DWARF debug sections.
186     Symbols in the DWARF debugging sections are relative to the beginning
187     of the section so we begin them at 0.  */
188  /* DWARF 1 */
189  .debug          0 : { *(.debug) }
190  .line           0 : { *(.line) }
191 
192  /* GNU DWARF 1 extensions */
193  .debug_srcinfo  0 : { *(.debug_srcinfo) }
194  .debug_sfnames  0 : { *(.debug_sfnames) }
195 
196  /* DWARF 1.1 and DWARF 2 */
197  .debug_aranges  0 : { *(.debug_aranges) }
198  .debug_pubnames 0 : { *(.debug_pubnames) }
199 
200  /* DWARF 2 */
201  .debug_info     0 : { *(.debug_info) }
202  .debug_abbrev   0 : { *(.debug_abbrev) }
203  .debug_line     0 : { *(.debug_line) }
204  .debug_frame    0 : { *(.debug_frame) }
205  .debug_str      0 : { *(.debug_str) }
206  .debug_loc      0 : { *(.debug_loc) }
207  .debug_macinfo  0 : { *(.debug_macinfo) }
208 
209  /* SGI/MIPS DWARF 2 extensions */
210  .debug_weaknames 0 : { *(.debug_weaknames) }
211  .debug_funcnames 0 : { *(.debug_funcnames) }
212  .debug_typenames 0 : { *(.debug_typenames) }
213  .debug_varnames  0 : { *(.debug_varnames) }
214
215  /* These must appear regardless of  .  */
216  /*
217   * place reset instruction into last word of FLASH
218   * NOTE: after reset, PPC403 starts executing from address
219   * 0xFFFFFFFC
220   * The reset section is placed in ROM at 0xF7FFFFFC instead,
221   * but a mirror of this address exists at 0xFFFFFFFC due to
222   * the initial memory controller setup
223   */
224  .reset  flash.start - 4 + flash.size :
225  {
226    *(.reset)
227  } > FLASH
228}
229
230
Note: See TracBrowser for help on using the repository browser.