annotate src/ppc.ldscript @ 260:052205f7dd5f

Added tag r20-5b28 for changeset 11cf20601dec
author cvs
date Mon, 13 Aug 2007 10:23:05 +0200
parents e70b3a057e12
children 6330739388db
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
247
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
1 OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
2 "elf32-powerpc")
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
3 OUTPUT_ARCH(powerpc)
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
4 ENTRY(_start)
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
5 SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/ppc-linux-elf/lib);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
6 /* Do we need any of these for elf?
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
7 __DYNAMIC = 0; */
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
8 PROVIDE (__stack = 0);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
9 SECTIONS
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
10 {
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
11 /* Read-only sections, merged into text segment: */
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
12 . = 0x200000 + SIZEOF_HEADERS;
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
13 .interp : { *(.interp) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
14 .hash : { *(.hash) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
15 .dynsym : { *(.dynsym) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
16 .dynstr : { *(.dynstr) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
17 .rela.text : { *(.rela.text) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
18 .rela.data : { *(.rela.data) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
19 .rela.rodata : { *(.rela.rodata) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
20 .rela.got : { *(.rela.got) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
21 .rela.got1 : { *(.rela.got1) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
22 .rela.got2 : { *(.rela.got2) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
23 .rela.ctors : { *(.rela.ctors) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
24 .rela.dtors : { *(.rela.dtors) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
25 .rela.init : { *(.rela.init) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
26 .rela.fini : { *(.rela.fini) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
27 .rela.bss : { *(.rela.bss) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
28 .rela.plt : { *(.rela.plt) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
29 .rela.sdata : { *(.rela.sdata2) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
30 .rela.sbss : { *(.rela.sbss2) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
31 .rela.sdata2 : { *(.rela.sdata2) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
32 .rela.sbss2 : { *(.rela.sbss2) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
33 .text :
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
34 {
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
35 *(.text)
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
36 /* .gnu.warning sections are handled specially by elf32.em. */
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
37 *(.gnu.warning)
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
38 } =0
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
39 .init : { *(.init) } =0
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
40 .fini : { *(.fini) } =0
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
41 .rodata : { *(.rodata) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
42 .rodata1 : { *(.rodata1) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
43 _etext = .;
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
44 PROVIDE (etext = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
45 .sdata2 : { *(.sdata2) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
46 .sbss2 : { *(.sbss2) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
47 /* Adjust the address for the data segment. We want to adjust up to
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
48 the same address within the page on the next page up. It would
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
49 be more correct to do this:
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
50 . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
51 The current expression does not correctly handle the case of a
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
52 text segment ending precisely at the end of a page; it causes the
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
53 data segment to skip a page. The above expression does not have
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
54 this problem, but it will currently (2/95) cause BFD to allocate
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
55 a single segment, combining both text and data, for this case.
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
56 This will prevent the text segment from being shared among
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
57 multiple executions of the program; I think that is more
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
58 important than losing a page of the virtual address space (note
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
59 that no actual memory is lost; the page which is skipped can not
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
60 be referenced). */
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
61 . = ALIGN(8) + 0x40000;
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
62 .data :
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
63 {
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
64 *(.data)
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
65 CONSTRUCTORS
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
66 }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
67 .data1 : { *(.data1) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
68 .got1 : { *(.got1) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
69 .plt : { *(.plt) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
70 .dynamic : { *(.dynamic) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
71 /* Put .ctors and .dtors next to the .got2 section, so that the pointers
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
72 get relocated with -mrelocatable. Also put in the .fixup pointers.
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
73 The current compiler no longer needs this, but keep it around for 2.7.2 */
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
74 PROVIDE (_GOT2_START_ = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
75 .got2 : { *(.got2) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
76 PROVIDE (__CTOR_LIST__ = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
77 .ctors : { *(.ctors) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
78 PROVIDE (__CTOR_END__ = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
79 PROVIDE (__DTOR_LIST__ = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
80 .dtors : { *(.dtors) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
81 PROVIDE (__DTOR_END__ = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
82 PROVIDE (_FIXUP_START_ = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
83 .fixup : { *(.fixup) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
84 PROVIDE (_FIXUP_END_ = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
85 PROVIDE (_GOT2_END_ = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
86 PROVIDE (_GOT_START_ = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
87 .got : { *(.got) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
88 .got.plt : { *(.got.plt) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
89 PROVIDE (_GOT_END_ = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
90 /* We want the small data sections together, so single-instruction offsets
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
91 can access them all, and initialized data all before uninitialized, so
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
92 we can shorten the on-disk segment size. */
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
93 .sdata : { *(.sdata) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
94 _edata = .;
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
95 PROVIDE (edata = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
96 .sbss :
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
97 {
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
98 }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
99 .bss :
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
100 {
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
101 PROVIDE (__sbss_start = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
102 *(.sbss)
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
103 *(.scommon)
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
104 PROVIDE (__sbss_end = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
105 PROVIDE (__bss_start = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
106 *(.dynbss)
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
107 *(.bss)
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
108 *(COMMON)
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
109 }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
110 _end = . ;
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
111 PROVIDE (end = .);
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
112 /* These are needed for ELF backends which have not yet been
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
113 converted to the new style linker. */
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
114 .stab 0 : { *(.stab) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
115 .stabstr 0 : { *(.stabstr) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
116 /* DWARF debug sections.
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
117 Symbols in the .debug DWARF section are relative to the beginning of the
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
118 section so we begin .debug at 0. It's not clear yet what needs to happen
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
119 for the others. */
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
120 .debug 0 : { *(.debug) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
121 .debug_srcinfo 0 : { *(.debug_srcinfo) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
122 .debug_aranges 0 : { *(.debug_aranges) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
123 .debug_pubnames 0 : { *(.debug_pubnames) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
124 .debug_sfnames 0 : { *(.debug_sfnames) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
125 .line 0 : { *(.line) }
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
126 /* These must appear regardless of . */
e70b3a057e12 Import from CVS: tag r20-5b22
cvs
parents:
diff changeset
127 }