Statistics
| Branch: | Revision:

root / ppc.ld @ 8733f609

History | View | Annotate | Download (8.3 kB)

1
/* ld script to make i386 Linux kernel
2
 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
3
 */
4
OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
5
OUTPUT_ARCH(powerpc:common)
6
ENTRY(_start)
7
SECTIONS
8
{
9
  /* Read-only sections, merged into text segment: */
10
  . = 0x60000000 + SIZEOF_HEADERS;
11
  .interp     : { *(.interp) 	}
12
  .hash          : { *(.hash)		}
13
  .dynsym        : { *(.dynsym)		}
14
  .dynstr        : { *(.dynstr)		}
15
  .gnu.version   : { *(.gnu.version)	}
16
  .gnu.version_d   : { *(.gnu.version_d)	}
17
  .gnu.version_r   : { *(.gnu.version_r)	}
18
  .rel.init       : { *(.rel.init) }
19
  .rela.init      : { *(.rela.init) }
20
  .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
21
  .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
22
  .rel.fini       : { *(.rel.fini) }
23
  .rela.fini      : { *(.rela.fini) }
24
  .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
25
  .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
26
  .rel.data.rel.ro   : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
27
  .rela.data.rel.ro   : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
28
  .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
29
  .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
30
  .rel.tdata	  : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
31
  .rela.tdata	  : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
32
  .rel.tbss	  : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
33
  .rela.tbss	  : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
34
  .rel.ctors      : { *(.rel.ctors) }
35
  .rela.ctors     : { *(.rela.ctors) }
36
  .rel.dtors      : { *(.rel.dtors) }
37
  .rela.dtors     : { *(.rela.dtors) }
38
  .rel.got        : { *(.rel.got) }
39
  .rela.got       : { *(.rela.got) }
40
  .rela.got1           : { *(.rela.got1) }
41
  .rela.got2           : { *(.rela.got2) }
42
  .rel.sdata      : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
43
  .rela.sdata     : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
44
  .rel.sbss       : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
45
  .rela.sbss      : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
46
  .rel.sdata2     : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
47
  .rela.sdata2    : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
48
  .rel.sbss2      : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
49
  .rela.sbss2     : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
50
  .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
51
  .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
52
  .rel.plt        : { *(.rel.plt) }
53
  .rela.plt       : { *(.rela.plt) }
54
  .init           :
55
  {
56
    KEEP (*(.init))
57
  } =0
58
  .text           :
59
  {
60
    *(.text .stub .text.* .gnu.linkonce.t.*)
61
    KEEP (*(.text.*personality*))
62
    /* .gnu.warning sections are handled specially by elf32.em.  */
63
    *(.gnu.warning)
64
    *(.glink)
65
  } =0x47ff041f
66
  .fini           :
67
  {
68
    KEEP (*(.fini))
69
  } =0x47ff041f
70
  PROVIDE (__etext = .);
71
  PROVIDE (_etext = .);
72
  PROVIDE (etext = .);
73
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
74
  .rodata1        : { *(.rodata1) }
75
  .sdata2         :
76
  {
77
    PROVIDE (_SDA2_BASE_ = 32768);
78
    *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
79
  }
80
  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
81
  .eh_frame_hdr : { *(.eh_frame_hdr) }
82
  /* Adjust the address for the data segment.  We want to adjust up to
83
     the same address within the page on the next page up.  */
84
  . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
85
  /* Exception handling  */
86
  .eh_frame       : { KEEP (*(.eh_frame)) }
87
  .gcc_except_table   : { *(.gcc_except_table .gcc_except_table.*) }
88
  /* Thread Local Storage sections  */
89
  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
90
  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
91
  .preinit_array     :
92
  {
93
    PROVIDE (__preinit_array_start = .);
94
    KEEP (*(.preinit_array))
95
    PROVIDE (__preinit_array_end = .);
96
  }
97
  .init_array     :
98
  {
99
     PROVIDE (__init_array_start = .);
100
     KEEP (*(SORT(.init_array.*)))
101
     KEEP (*(.init_array))
102
     PROVIDE (__init_array_end = .);
103
  }
104
  .fini_array     :
105
  {
106
    PROVIDE (__fini_array_start = .);
107
    KEEP (*(.fini_array))
108
    KEEP (*(SORT(.fini_array.*)))
109
    PROVIDE (__fini_array_end = .);
110
  }
111
  .ctors          :
112
  {
113
    /* gcc uses crtbegin.o to find the start of
114
       the constructors, so we make sure it is
115
       first.  Because this is a wildcard, it
116
       doesn't matter if the user does not
117
       actually link against crtbegin.o; the
118
       linker won't look for a file to match a
119
       wildcard.  The wildcard also means that it
120
       doesn't matter which directory crtbegin.o
121
       is in.  */
122
    KEEP (*crtbegin*.o(.ctors))
123
    /* We don't want to include the .ctor section from
124
       the crtend.o file until after the sorted ctors.
125
       The .ctor section from the crtend file contains the
126
       end of ctors marker and it must be last */
127
    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
128
    KEEP (*(SORT(.ctors.*)))
129
    KEEP (*(.ctors))
130
  }
131
  .dtors          :
132
  {
133
    KEEP (*crtbegin*.o(.dtors))
134
    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
135
    KEEP (*(SORT(.dtors.*)))
136
    KEEP (*(.dtors))
137
  }
138
  .jcr            : { KEEP (*(.jcr)) }
139
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
140
  .got1           : { *(.got1) }
141
  .got2           : { *(.got2) }
142
  .dynamic        : { *(.dynamic) }
143
  .got            : SPECIAL { *(.got) }
144
  . = DATA_SEGMENT_RELRO_END (0, .);
145
  .plt            : SPECIAL { *(.plt) }
146
  .data           :
147
  {
148
    *(.data .data.* .gnu.linkonce.d.*)
149
    KEEP (*(.gnu.linkonce.d.*personality*))
150
    SORT(CONSTRUCTORS)
151
  }
152
  .data1          : { *(.data1) }
153
  .got            : SPECIAL { *(.got) }
154
  /* We want the small data sections together, so single-instruction offsets
155
     can access them all, and initialized data all before uninitialized, so
156
     we can shorten the on-disk segment size.  */
157
  .sdata          :
158
  {
159
    PROVIDE (_SDA_BASE_ = 32768);
160
    *(.sdata .sdata.* .gnu.linkonce.s.*)
161
  }
162
  _edata = .; PROVIDE (edata = .);
163
  __bss_start = .;
164
  .sbss           :
165
  {
166
    PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
167
    *(.dynsbss)
168
    *(.sbss .sbss.* .gnu.linkonce.sb.*)
169
    *(.scommon)
170
    PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
171
  }
172
  .plt            : SPECIAL { *(.plt) }
173
  .bss            :
174
  {
175
   *(.dynbss)
176
   *(.bss .bss.* .gnu.linkonce.b.*)
177
   *(COMMON)
178
   /* Align here to ensure that the .bss section occupies space up to
179
      _end.  Align after .bss to ensure correct alignment even if the
180
      .bss section disappears because there are no input sections.
181
      FIXME: Why do we need it? When there is no .bss section, we don't
182
      pad the .data section.  */
183
   . = ALIGN(. != 0 ? 32 / 8 : 1);
184
  }
185
  . = ALIGN(32 / 8);
186
  . = ALIGN(32 / 8);
187
  _end = .; PROVIDE (end = .);
188
  . = DATA_SEGMENT_END (.);
189
  /* Stabs debugging sections.  */
190
  .stab 0 : { *(.stab) }
191
  .stabstr 0 : { *(.stabstr) }
192
  .stab.excl 0 : { *(.stab.excl) }
193
  .stab.exclstr 0 : { *(.stab.exclstr) }
194
  .stab.index 0 : { *(.stab.index) }
195
  .stab.indexstr 0 : { *(.stab.indexstr) }
196
  .comment 0 : { *(.comment) }
197
  /* DWARF debug sections.
198
     Symbols in the DWARF debugging sections are relative to the beginning
199
     of the section so we begin them at 0.  */
200
  /* DWARF 1 */
201
  .debug          0 : { *(.debug) }
202
  .line           0 : { *(.line) }
203
  /* GNU DWARF 1 extensions */
204
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
205
  .debug_sfnames  0 : { *(.debug_sfnames) }
206
  /* DWARF 1.1 and DWARF 2 */
207
  .debug_aranges  0 : { *(.debug_aranges) }
208
  .debug_pubnames 0 : { *(.debug_pubnames) }
209
  /* DWARF 2 */
210
  .debug_info     0 : { *(.debug_info) }
211
  .debug_abbrev   0 : { *(.debug_abbrev) }
212
  .debug_line     0 : { *(.debug_line) }
213
  .debug_frame    0 : { *(.debug_frame) }
214
  .debug_str      0 : { *(.debug_str) }
215
  .debug_loc      0 : { *(.debug_loc) }
216
  .debug_macinfo  0 : { *(.debug_macinfo) }
217
  /* SGI/MIPS DWARF 2 extensions */
218
  .debug_weaknames 0 : { *(.debug_weaknames) }
219
  .debug_funcnames 0 : { *(.debug_funcnames) }
220
  .debug_typenames 0 : { *(.debug_typenames) }
221
  .debug_varnames  0 : { *(.debug_varnames) }
222
  /* These must appear regardless of  .  */
223
  /DISCARD/    : { *(.fixup) }
224
  /DISCARD/ : { *(.note.GNU-stack) }
225
}