source: rtems/c/src/lib/libbsp/powerpc/psim/startup/linkcmds @ 20f54e9

4.104.114.84.95
Last change on this file since 20f54e9 was 3c87bb9c, checked in by Joel Sherrill <joel.sherrill@…>, on 04/14/99 at 22:33:30

Minor corrections from Jay Kulpinski <jskulpin@…>.

This first one below looked like it only belonged in a
virtual memory environment. The second one was causing
problems without the PROVIDE() - I don't know why.

  • Property mode set to 100644
File size: 6.1 KB
Line 
1/*
2 *
3 *  COPYRIGHT (c) 1989-1998.
4 *  On-Line Applications Research Corporation (OAR).
5 *  Copyright assigned to U.S. Government, 1994.
6 *
7 *  The license and distribution terms for this file may be
8 *  found in found in the file LICENSE in this distribution or at
9 *  http://www.OARcorp.com/rtems/license.html.
10 *
11 *  $Id$
12 */
13
14OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
15              "elf32-powerpc")
16OUTPUT_ARCH(powerpc)
17ENTRY(_start)
18 /*SEARCH_DIR(/usr1/gnu/cross/powerpc-unknown-eabi//powerpc-unknown-eabi/lib); */
19/* Do we need any of these for elf?
20   __DYNAMIC = 0;    */
21PROVIDE (PSIM_INSTRUCTIONS_PER_MICROSECOND = 100);
22PROVIDE (CPU_PPC_CLICKS_PER_MS = 16667);
23MEMORY
24  {
25        RAM : ORIGIN = 0, LENGTH = 8M
26        EPROM : ORIGIN = 0xFFF00000, LENGTH = 0x20000
27  }
28
29SECTIONS
30{
31  .vectors 0xFFF00100 :
32  {
33    *(.vectors)
34  } >EPROM
35
36  /* Read-only sections, merged into text segment: */
37  /* . = 0x40000 + SIZEOF_HEADERS; */
38  . = 0x4000;
39  .interp         : { *(.interp) }
40  .hash           : { *(.hash)          }
41  .dynsym         : { *(.dynsym)                }
42  .dynstr         : { *(.dynstr)                }
43  .rela.text      : { *(.rela.text)     }
44  .rela.data      : { *(.rela.data)     }
45  .rela.rodata    : { *(.rela.rodata)   }
46  .rela.got       : { *(.rela.got)      }
47  .rela.got1      : { *(.rela.got1)     }
48  .rela.got2      : { *(.rela.got2)     }
49  .rela.ctors     : { *(.rela.ctors)    }
50  .rela.dtors     : { *(.rela.dtors)    }
51  .rela.init      : { *(.rela.init)     }
52  .rela.fini      : { *(.rela.fini)     }
53  .rela.bss       : { *(.rela.bss)      }
54  .rela.plt       : { *(.rela.plt)      }
55  .rela.sdata     : { *(.rela.sdata2)   }
56  .rela.sbss      : { *(.rela.sbss2)    }
57  .rela.sdata2    : { *(.rela.sdata2)   }
58  .rela.sbss2     : { *(.rela.sbss2)    }
59  .plt            : { *(.plt)           }
60  .text      :
61  {
62    *(.text)
63    *(.gnu.linkonce.t.*)
64    *(.descriptors)
65    /* .gnu.warning sections are handled specially by elf32.em.  */
66    *(.gnu.warning)
67  } >RAM
68  .init           : { *(.init)          } >RAM
69  .fini           : { *(.fini)          } >RAM
70  .rodata         : { *(.rodata) *(.gnu.linkonce.r*) } >RAM
71  .rodata1        : { *(.rodata1)       } >RAM
72  PROVIDE (_etext = .);
73  PROVIDE (etext = .);
74  PROVIDE (__SDATA2_START__ = .);
75  .sdata2         : { *(.sdata2)        } >RAM
76  .sbss2          : { *(.sbss2)         } >RAM
77  PROVIDE (__SBSS2_END__ = .);
78  /* Adjust the address for the data segment.  We want to adjust up to
79     the same address within the page on the next page up.  It would
80     be more correct to do this:
81       . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
82     The current expression does not correctly handle the case of a
83     text segment ending precisely at the end of a page; it causes the
84     data segment to skip a page.  The above expression does not have
85     this problem, but it will currently (2/95) cause BFD to allocate
86     a single segment, combining both text and data, for this case.
87     This will prevent the text segment from being shared among
88     multiple executions of the program; I think that is more
89     important than losing a page of the virtual address space (note
90     that no actual memory is lost; the page which is skipped can not
91     be referenced).  */
92  /* . =  ALIGN(8) + 0x40000; */
93  .data    :
94  {
95    *(.data)
96    *(.gnu.linkonce.d.*)
97    CONSTRUCTORS
98  } >RAM
99  PROVIDE (__EXCEPT_START__ = .);
100  .gcc_except_table   : { *(.gcc_except_table) } >RAM
101  PROVIDE (__EXCEPT_END__ = .);
102
103  .data1          : { *(.data1)         } >RAM
104  .got1           : { *(.got1)          } >RAM
105  .dynamic        : { *(.dynamic)       } >RAM
106  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
107     get relocated with -mrelocatable. Also put in the .fixup pointers.
108     The current compiler no longer needs this, but keep it around for 2.7.2  */
109   PROVIDE (__GOT2_START__ = .);
110   PROVIDE (_GOT2_START_ = .);
111  .got2           :  { *(.got2)         } >RAM
112  PROVIDE (__GOT2_END__ = .);
113  PROVIDE (_GOT2_END_ = .);
114
115  PROVIDE (__CTOR_LIST__ = .);
116  .ctors          : { *(.ctors)         } >RAM
117  PROVIDE (__CTOR_END__ = .);
118
119  PROVIDE (__DTOR_LIST__ = .);
120  .dtors          : { *(.dtors)         } >RAM
121  PROVIDE (__DTOR_END__ = .);
122
123  PROVIDE (__FIXUP_START__ = .);
124  PROVIDE (_FIXUP_START_ = .);
125  .fixup          : { *(.fixup)         } >RAM
126  PROVIDE (_FIXUP_END_ = .);
127  PROVIDE (__FIXUP_END__ = .);
128
129  PROVIDE (__GOT_START__ = .);
130  PROVIDE (_GOT_START_ = .);
131  s.got = .;
132  .got            : { *(.got)           } >RAM
133  .got.plt        : { *(.got.plt)       } >RAM
134  PROVIDE (_GOT_END_ = .);
135  PROVIDE (__GOT_END__ = .);
136
137  /* We want the small data sections together, so single-instruction offsets
138     can access them all, and initialized data all before uninitialized, so
139     we can shorten the on-disk segment size.  */
140  PROVIDE (__SDATA_START__ = .);
141  .sdata          : { *(.sdata)         } >RAM
142  _edata  =  .;
143  PROVIDE (edata = .);
144
145  PROVIDE (RAM_END = 0x7f0000);
146  .sbss      :
147  {
148    PROVIDE (__sbss_start = .);
149    *(.sbss)
150    *(.scommon)
151    PROVIDE (__sbss_end = .);
152  } >RAM
153  PROVIDE (__SBSS_END__ = .);
154
155  .bss       :
156  {
157   PROVIDE (__bss_start = .);
158   *(.dynbss)
159   *(.bss)
160   *(COMMON)
161  } >RAM
162  . =  ALIGN(8) + 0x8000;
163  PROVIDE(__stack = .);
164  PROVIDE(_end = .);
165  PROVIDE(end = .);
166
167  /* These are needed for ELF backends which have not yet been
168     converted to the new style linker.  */
169  .stab 0 : { *(.stab) }
170  .stabstr 0 : { *(.stabstr) }
171  /* DWARF debug sections.
172     Symbols in the DWARF debugging sections are relative to the beginning
173     of the section so we begin them at 0.  */
174  /* DWARF 1 */
175  .debug          0 : { *(.debug) }
176  .line           0 : { *(.line) }
177  /* GNU DWARF 1 extensions */
178  .debug_srcinfo  0 : { *(.debug_srcinfo) }
179  .debug_sfnames  0 : { *(.debug_sfnames) }
180  /* DWARF 1.1 and DWARF 2 */
181  .debug_aranges  0 : { *(.debug_aranges) }
182  .debug_pubnames 0 : { *(.debug_pubnames) }
183  /* DWARF 2 */
184  .debug_info     0 : { *(.debug_info) }
185  .debug_abbrev   0 : { *(.debug_abbrev) }
186  .debug_line     0 : { *(.debug_line) }
187  .debug_frame    0 : { *(.debug_frame) }
188  .debug_str      0 : { *(.debug_str) }
189  .debug_loc      0 : { *(.debug_loc) }
190  .debug_macinfo  0 : { *(.debug_macinfo) }
191  /* SGI/MIPS DWARF 2 extensions */
192  .debug_weaknames 0 : { *(.debug_weaknames) }
193  .debug_funcnames 0 : { *(.debug_funcnames) }
194  .debug_typenames 0 : { *(.debug_typenames) }
195  .debug_varnames  0 : { *(.debug_varnames) }
196  /* These must appear regardless of  .  */
197}
Note: See TracBrowser for help on using the repository browser.