Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 138655
Collapse All | Expand All

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

Return to bug 138655