Statistics
| Branch: | Revision:

root / ppc64.ld @ 810260a8

History | View | Annotate | Download (8.3 kB)

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