Statistics
| Branch: | Revision:

root / ppc64.ld @ bf4f74c0

History | View | Annotate | Download (8.2 kB)

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