]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/services/loader/v2_0/src/dynamic.ld
Initial revision
[karo-tx-redboot.git] / packages / services / loader / v2_0 / src / dynamic.ld
1 #define CYG_LOADER_DYNAMIC_LD
2
3 #include <cyg/loader/loader.hxx>
4
5 CYG_LOADER_DYNAMIC_PREFIX
6
7 /* Do we need any of these for elf?
8    __DYNAMIC = 0;    */
9 SECTIONS
10 {
11   /* Read-only sections, merged into text segment: */
12   . = 0 + SIZEOF_HEADERS;
13   .hash          : { *(.hash)           }
14   .dynsym        : { *(.dynsym)         }
15   .dynstr        : { *(.dynstr)         }
16   .gnu.version   : { *(.gnu.version)    }
17   .gnu.version_d   : { *(.gnu.version_d)        }
18   .gnu.version_r   : { *(.gnu.version_r)        }
19   .rel.init      : { *(.rel.init)       }
20   .rela.init     : { *(.rela.init)      }
21   .rel.text      :
22     {
23       *(.rel.text)
24       *(.rel.text.*)
25       *(.rel.gnu.linkonce.t*)
26     }
27   .rela.text     :
28     {
29       *(.rela.text)
30       *(.rela.text.*)
31       *(.rela.gnu.linkonce.t*)
32     }
33   .rel.fini      : { *(.rel.fini)       }
34   .rela.fini     : { *(.rela.fini)      }
35   .rel.rodata    :
36     {
37       *(.rel.rodata)
38       *(.rel.rodata.*)
39       *(.rel.gnu.linkonce.r*)
40     }
41   .rela.rodata   :
42     {
43       *(.rela.rodata)
44       *(.rela.rodata.*)
45       *(.rela.gnu.linkonce.r*)
46     }
47   .rel.data      :
48     {
49       *(.rel.data)
50       *(.rel.data.*)
51       *(.rel.gnu.linkonce.d*)
52     }
53   .rela.data     :
54     {
55       *(.rela.data)
56       *(.rela.data.*)
57       *(.rela.gnu.linkonce.d*)
58     }
59   .rel.ctors     : { *(.rel.ctors)      }
60   .rela.ctors    : { *(.rela.ctors)     }
61   .rel.dtors     : { *(.rel.dtors)      }
62   .rela.dtors    : { *(.rela.dtors)     }
63   .rel.got       : { *(.rel.got)                }
64   .rela.got      : { *(.rela.got)               }
65   .rel.sdata     :
66     {
67       *(.rel.sdata)
68       *(.rel.sdata.*)
69       *(.rel.gnu.linkonce.s*)
70     }
71   .rela.sdata     :
72     {
73       *(.rela.sdata)
74       *(.rela.sdata.*)
75       *(.rela.gnu.linkonce.s*)
76     }
77   .rel.sbss      : { *(.rel.sbss)               }
78   .rela.sbss     : { *(.rela.sbss)      }
79   .rel.bss       : { *(.rel.bss)                }
80   .rela.bss      : { *(.rela.bss)               }
81   .rel.plt       : { *(.rel.plt)                }
82   .rela.plt      : { *(.rela.plt)               }
83   .init          : 
84   { 
85     KEEP (*(.init))
86   } =0x9090
87   .plt      : { *(.plt) }
88   .text      :
89   {
90     *(.text)
91     *(.text.*)
92     *(.stub)
93     /* .gnu.warning sections are handled specially by elf32.em.  */
94     *(.gnu.warning)
95     *(.gnu.linkonce.t*)
96   } =0x9090
97   _etext = .;
98   PROVIDE (etext = .);
99   .fini      :
100   {
101     KEEP (*(.fini))
102   } =0x9090
103   .rodata   : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) }
104   .rodata1   : { *(.rodata1) }
105 #ifdef CYG_LOADER_DYNAMIC_DATA_ALIGN
106   CYG_LOADER_DYNAMIC_DATA_ALIGN
107 #else
108   . = ALIGN(0x1000);
109 #endif
110   .data    :
111   {
112     *(.data)
113     *(.data.*)
114     *(.gnu.linkonce.d*)
115     SORT(CONSTRUCTORS)
116   }
117   .data1   : { *(.data1) }
118   .eh_frame : { KEEP (*(.eh_frame)) }
119   .gcc_except_table : { *(.gcc_except_table) }
120   .ctors   : 
121   {
122     /* gcc uses crtbegin.o to find the start of
123        the constructors, so we make sure it is
124        first.  Because this is a wildcard, it
125        doesn't matter if the user does not
126        actually link against crtbegin.o; the
127        linker won't look for a file to match a
128        wildcard.  The wildcard also means that it
129        doesn't matter which directory crtbegin.o
130        is in.  */
131     KEEP (*crtbegin.o(.ctors))
132     /* We don't want to include the .ctor section from
133        from the crtend.o file until after the sorted ctors.
134        The .ctor section from the crtend file contains the
135        end of ctors marker and it must be last */
136     KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
137     KEEP (*(SORT(.ctors.*)))
138     KEEP (*(.ctors))
139   }
140    .dtors         :
141   {
142     KEEP (*crtbegin.o(.dtors))
143     KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
144     KEEP (*(SORT(.dtors.*)))
145     KEEP (*(.dtors))
146   }
147   .got            : { *(.got.plt) *(.got) }
148   .dynamic       : { *(.dynamic) }
149   /* We want the small data sections together, so single-instruction offsets
150      can access them all, and initialized data all before uninitialized, so
151      we can shorten the on-disk segment size.  */
152   .sdata     : 
153   {
154     *(.sdata) 
155     *(.sdata.*)
156     *(.gnu.linkonce.s.*)
157   }
158   _edata = .;
159   PROVIDE (edata = .);
160   __bss_start = .;
161   .sbss      :
162   {
163     *(.dynsbss)
164     *(.sbss)
165     *(.sbss.*)
166     *(.scommon)
167   }
168   .bss       :
169   {
170    *(.dynbss)
171    *(.bss)
172    *(.bss.*)
173    *(COMMON)
174    /* Align here to ensure that the .bss section occupies space up to
175       _end.  Align after .bss to ensure correct alignment even if the
176       .bss section disappears because there are no input sections.  */
177    . = ALIGN(32 / 8);
178   }
179   . = ALIGN(32 / 8);
180   _end = .;
181   PROVIDE (end = .);
182   /* Stabs debugging sections.  */
183   .stab 0 : { *(.stab) }
184   .stabstr 0 : { *(.stabstr) }
185   .stab.excl 0 : { *(.stab.excl) }
186   .stab.exclstr 0 : { *(.stab.exclstr) }
187   .stab.index 0 : { *(.stab.index) }
188   .stab.indexstr 0 : { *(.stab.indexstr) }
189   .comment 0 : { *(.comment) }
190   /* DWARF debug sections.
191      Symbols in the DWARF debugging sections are relative to the beginning
192      of the section so we begin them at 0.  */
193   /* DWARF 1 */
194   .debug          0 : { *(.debug) }
195   .line           0 : { *(.line) }
196   /* GNU DWARF 1 extensions */
197   .debug_srcinfo  0 : { *(.debug_srcinfo) }
198   .debug_sfnames  0 : { *(.debug_sfnames) }
199   /* DWARF 1.1 and DWARF 2 */
200   .debug_aranges  0 : { *(.debug_aranges) }
201   .debug_pubnames 0 : { *(.debug_pubnames) }
202   /* DWARF 2 */
203   .debug_info     0 : { *(.debug_info) }
204   .debug_abbrev   0 : { *(.debug_abbrev) }
205   .debug_line     0 : { *(.debug_line) }
206   .debug_frame    0 : { *(.debug_frame) }
207   .debug_str      0 : { *(.debug_str) }
208   .debug_loc      0 : { *(.debug_loc) }
209   .debug_macinfo  0 : { *(.debug_macinfo) }
210   /* SGI/MIPS DWARF 2 extensions */
211   .debug_weaknames 0 : { *(.debug_weaknames) }
212   .debug_funcnames 0 : { *(.debug_funcnames) }
213   .debug_typenames 0 : { *(.debug_typenames) }
214   .debug_varnames  0 : { *(.debug_varnames) }
215   /* These must appear regardless of  .  */
216 }