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