xref: /freebsd/sys/conf/ldscript.powerpc64 (revision 62cfcf62f627e5093fb37026a6d8c98e4d2ef04c)
1/* $FreeBSD$ */
2
3OUTPUT_FORMAT("elf64-powerpc-freebsd", "elf64-powerpc-freebsd",
4	      "elf64-powerpc-freebsd")
5OUTPUT_ARCH(powerpc:common64)
6ENTRY(__start)
7SEARCH_DIR(/usr/lib);
8PROVIDE (__stack = 0);
9PHDRS
10{
11	kernel PT_LOAD;
12	dynamic PT_DYNAMIC;
13}
14SECTIONS
15{
16
17  /* Low-address wrapper for bootloaders (kexec/kboot) that can't parse ELF */
18  . = kernbase - 0x100;
19  .kboot : { *(.text.kboot) } :kernel
20
21  /* Read-only sections, merged into text segment: */
22  . = kernbase;
23  PROVIDE (begin = .);
24
25  .text      :
26  {
27    *(.glink)
28    *(.text)
29    *(.stub)
30    /* .gnu.warning sections are handled specially by elf32.em.  */
31    *(.gnu.warning)
32    *(.gnu.linkonce.t*)
33  } =0
34  _etext = .;
35  PROVIDE (etext = .);
36
37  /* Do not emit PT_INTERP section, which confuses some loaders (kexec-lite) */
38  /DISCARD/   : { *(.interp)	}
39
40  .hash          : { *(.hash)		}
41  .dynsym        : { *(.dynsym)		}
42  .dynstr        : { *(.dynstr)		}
43  .gnu.version   : { *(.gnu.version)	}
44  .gnu.version_d   : { *(.gnu.version_d)	}
45  .gnu.version_r   : { *(.gnu.version_r)	}
46  .note.gnu.build-id : {
47    PROVIDE (__build_id_start = .);
48    *(.note.gnu.build-id)
49    PROVIDE (__build_id_end = .);
50  }
51
52  /* Do not emit any additional notes. */
53  /DISCARD/   : { *(.note.*)	}
54
55  .rela.text     :
56    { *(.rela.text) *(.rela.gnu.linkonce.t*) }
57  .rela.data     :
58    { *(.rela.data) *(.rela.gnu.linkonce.d*) }
59  .rela.rodata   :
60    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
61  .rela.got      : { *(.rela.got)		}
62  .rela.got1     : { *(.rela.got1)		}
63  .rela.got2     : { *(.rela.got2)		}
64  .rela.ctors    : { *(.rela.ctors)	}
65  .rela.dtors    : { *(.rela.dtors)	}
66  .rela.init     : { *(.rela.init)	}
67  .rela.fini     : { *(.rela.fini)	}
68  .rela.bss      : { *(.rela.bss)		}
69  .rela.plt      : { *(.rela.plt)		}
70  .rela.sdata    : { *(.rela.sdata)		}
71  .rela.sbss     : { *(.rela.sbss)		}
72  .rela.sdata2   : { *(.rela.sdata2)		}
73  .rela.sbss2    : { *(.rela.sbss2)		}
74
75  .init      : { *(.init)    } =0
76  .fini      : { *(.fini)    } =0
77  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
78  .rodata1   : { *(.rodata1) }
79  .sdata2    : { *(.sdata2)  }
80  .sbss2     : { *(.sbss2)   }
81  /* Adjust the address for the data segment to the next page up. */
82  . = ALIGN(4096);
83  .data.read_frequently :
84  {
85    *(SORT_BY_ALIGNMENT(.data.read_frequently))
86  }
87  .data.read_mostly :
88  {
89    *(.data.read_mostly)
90  }
91  . = ALIGN(128);
92  .data.exclusive_cache_line :
93  {
94    *(.data.exclusive_cache_line)
95  }
96  . = ALIGN(128);
97  .data    :
98  {
99    *(.data)
100    *(.gnu.linkonce.d*)
101  }
102  .data1     : { *(.data1) }
103  .toc1      : ALIGN(8) { *(.toc1) }
104  .opd       : ALIGN(8) { KEEP (*(.opd)) }
105  .branch_lt : ALIGN(8) { *(.branch_lt) }
106  . = ALIGN(4096);
107  .got       : ALIGN(8) { __tocbase = .; *(.got) }
108  .toc       : ALIGN(8) { *(.toc) }
109
110  .dynamic        : { *(.dynamic) } :kernel :dynamic
111  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
112     get relocated with -mrelocatable. Also put in the .fixup pointers.
113     The current compiler no longer needs this, but keep it around for 2.7.2  */
114                PROVIDE (_GOT2_START_ = .);
115  .got2           :  { *(.got2) }
116                PROVIDE (__CTOR_LIST__ = .);
117  .ctors          : { *(.ctors) }
118                PROVIDE (__CTOR_END__ = .);
119                PROVIDE (__DTOR_LIST__ = .);
120  .dtors          : { *(.dtors) }
121                PROVIDE (__DTOR_END__ = .);
122                PROVIDE (_FIXUP_START_ = .);
123  .fixup          : { *(.fixup) }
124                PROVIDE (_FIXUP_END_ = .);
125                PROVIDE (_GOT2_END_ = .);
126  /* We want the small data sections together, so single-instruction offsets
127     can access them all, and initialized data all before uninitialized, so
128     we can shorten the on-disk segment size.  */
129  .sdata     : { *(.sdata) } :kernel
130  _edata  =  .;
131  PROVIDE (edata = .);
132  .sbss      :
133  {
134    PROVIDE (__sbss_start = .);
135    *(.sbss)
136    *(.scommon)
137    *(.dynsbss)
138    PROVIDE (__sbss_end = .);
139  }
140  .plt   : { *(.plt) }
141  .bss       :
142  {
143   PROVIDE (__bss_start = .);
144   *(.dynbss)
145   *(.bss)
146   *(COMMON)
147  }
148  _end = . ;
149  PROVIDE (end = .);
150  /* Stabs debugging sections.  */
151  .stab 0 : { *(.stab) }
152  .stabstr 0 : { *(.stabstr) }
153  /* DWARF debug sections.
154     Symbols in the DWARF debugging sections are relative to the beginning
155     of the section so we begin them at 0.  */
156  /* DWARF 1 */
157  .debug          0 : { *(.debug) }
158  .line           0 : { *(.line) }
159  /* GNU DWARF 1 extensions */
160  .debug_srcinfo  0 : { *(.debug_srcinfo) }
161  .debug_sfnames  0 : { *(.debug_sfnames) }
162  /* DWARF 1.1 and DWARF 2 */
163  .debug_aranges  0 : { *(.debug_aranges) }
164  .debug_pubnames 0 : { *(.debug_pubnames) }
165  /* DWARF 2 */
166  .debug_info     0 : { *(.debug_info) }
167  .debug_abbrev   0 : { *(.debug_abbrev) }
168  .debug_line     0 : { *(.debug_line) }
169  .debug_frame    0 : { *(.debug_frame) }
170  .debug_str      0 : { *(.debug_str) }
171  .debug_loc      0 : { *(.debug_loc) }
172  .debug_macinfo  0 : { *(.debug_macinfo) }
173  /* SGI/MIPS DWARF 2 extensions */
174  .debug_weaknames 0 : { *(.debug_weaknames) }
175  .debug_funcnames 0 : { *(.debug_funcnames) }
176  .debug_typenames 0 : { *(.debug_typenames) }
177  .debug_varnames  0 : { *(.debug_varnames) }
178  /* These must appear regardless of  .  */
179}
180
181