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