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