Statistics
| Branch: | Revision:

root / i386.ld @ a74cdab4

History | View | Annotate | Download (4.7 kB)

1 31e31b8a bellard
/* ld script to make i386 Linux kernel
2 31e31b8a bellard
 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
3 31e31b8a bellard
 */
4 31e31b8a bellard
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
5 31e31b8a bellard
OUTPUT_ARCH(i386)
6 31e31b8a bellard
ENTRY(_start)
7 31e31b8a bellard
SECTIONS
8 31e31b8a bellard
{
9 31e31b8a bellard
  /* Read-only sections, merged into text segment: */
10 31e31b8a bellard
  . = 0x60000000 + SIZEOF_HEADERS;
11 31e31b8a bellard
  .interp     : { *(.interp) 	}
12 31e31b8a bellard
  .hash          : { *(.hash)		}
13 31e31b8a bellard
  .dynsym        : { *(.dynsym)		}
14 31e31b8a bellard
  .dynstr        : { *(.dynstr)		}
15 31e31b8a bellard
  .gnu.version   : { *(.gnu.version)	}
16 31e31b8a bellard
  .gnu.version_d   : { *(.gnu.version_d)	}
17 31e31b8a bellard
  .gnu.version_r   : { *(.gnu.version_r)	}
18 31e31b8a bellard
  .rel.text      :
19 31e31b8a bellard
    { *(.rel.text) *(.rel.gnu.linkonce.t*) }
20 31e31b8a bellard
  .rela.text     :
21 31e31b8a bellard
    { *(.rela.text) *(.rela.gnu.linkonce.t*) }
22 31e31b8a bellard
  .rel.data      :
23 31e31b8a bellard
    { *(.rel.data) *(.rel.gnu.linkonce.d*) }
24 31e31b8a bellard
  .rela.data     :
25 31e31b8a bellard
    { *(.rela.data) *(.rela.gnu.linkonce.d*) }
26 31e31b8a bellard
  .rel.rodata    :
27 31e31b8a bellard
    { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
28 31e31b8a bellard
  .rela.rodata   :
29 31e31b8a bellard
    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
30 31e31b8a bellard
  .rel.got       : { *(.rel.got)		}
31 31e31b8a bellard
  .rela.got      : { *(.rela.got)		}
32 31e31b8a bellard
  .rel.ctors     : { *(.rel.ctors)	}
33 31e31b8a bellard
  .rela.ctors    : { *(.rela.ctors)	}
34 31e31b8a bellard
  .rel.dtors     : { *(.rel.dtors)	}
35 31e31b8a bellard
  .rela.dtors    : { *(.rela.dtors)	}
36 31e31b8a bellard
  .rel.init      : { *(.rel.init)	}
37 31e31b8a bellard
  .rela.init     : { *(.rela.init)	}
38 31e31b8a bellard
  .rel.fini      : { *(.rel.fini)	}
39 31e31b8a bellard
  .rela.fini     : { *(.rela.fini)	}
40 31e31b8a bellard
  .rel.bss       : { *(.rel.bss)		}
41 31e31b8a bellard
  .rela.bss      : { *(.rela.bss)		}
42 845f2c28 Loïc Minier
  .rel.plt      :
43 845f2c28 Loïc Minier
  {
44 845f2c28 Loïc Minier
    *(.rel.plt)
45 845f2c28 Loïc Minier
    PROVIDE_HIDDEN (__rel_iplt_start = .);
46 845f2c28 Loïc Minier
    *(.rel.iplt)
47 845f2c28 Loïc Minier
    PROVIDE_HIDDEN (__rel_iplt_end = .);
48 845f2c28 Loïc Minier
  }
49 845f2c28 Loïc Minier
  .rela.plt       :
50 845f2c28 Loïc Minier
  {
51 845f2c28 Loïc Minier
    *(.rela.plt)
52 845f2c28 Loïc Minier
    PROVIDE_HIDDEN (__rela_iplt_start = .);
53 845f2c28 Loïc Minier
    *(.rela.iplt)
54 845f2c28 Loïc Minier
    PROVIDE_HIDDEN (__rela_iplt_end = .);
55 845f2c28 Loïc Minier
  }
56 31e31b8a bellard
  .init          : { *(.init)	} =0x47ff041f
57 31e31b8a bellard
  .text      :
58 31e31b8a bellard
  {
59 31e31b8a bellard
    *(.text)
60 31e31b8a bellard
    /* .gnu.warning sections are handled specially by elf32.em.  */
61 31e31b8a bellard
    *(.gnu.warning)
62 31e31b8a bellard
    *(.gnu.linkonce.t*)
63 31e31b8a bellard
  } =0x47ff041f
64 31e31b8a bellard
  _etext = .;
65 31e31b8a bellard
  PROVIDE (etext = .);
66 31e31b8a bellard
  .fini      : { *(.fini)    } =0x47ff041f
67 b1f64575 bellard
  . = ALIGN(32 / 8);
68 b1f64575 bellard
  PROVIDE (__preinit_array_start = .);
69 b1f64575 bellard
  .preinit_array     : { *(.preinit_array) }
70 b1f64575 bellard
  PROVIDE (__preinit_array_end = .);
71 b1f64575 bellard
  PROVIDE (__init_array_start = .);
72 b1f64575 bellard
  .init_array     : { *(.init_array) }
73 b1f64575 bellard
  PROVIDE (__init_array_end = .);
74 b1f64575 bellard
  PROVIDE (__fini_array_start = .);
75 b1f64575 bellard
  .fini_array     : { *(.fini_array) }
76 b1f64575 bellard
  PROVIDE (__fini_array_end = .);
77 31e31b8a bellard
  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
78 31e31b8a bellard
  .rodata1   : { *(.rodata1) }
79 31e31b8a bellard
  .reginfo : { *(.reginfo) }
80 31e31b8a bellard
  /* Adjust the address for the data segment.  We want to adjust up to
81 31e31b8a bellard
     the same address within the page on the next page up.  */
82 31e31b8a bellard
  . = ALIGN(0x100000) + (. & (0x100000 - 1));
83 1090e7a2 pbrook
  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
84 1090e7a2 pbrook
  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
85 31e31b8a bellard
  .data    :
86 31e31b8a bellard
  {
87 31e31b8a bellard
    *(.data)
88 31e31b8a bellard
    *(.gnu.linkonce.d*)
89 31e31b8a bellard
    CONSTRUCTORS
90 31e31b8a bellard
  }
91 31e31b8a bellard
  .data1   : { *(.data1) }
92 31e31b8a bellard
  .ctors         :
93 31e31b8a bellard
  {
94 31e31b8a bellard
    *(.ctors)
95 31e31b8a bellard
  }
96 31e31b8a bellard
  .dtors         :
97 31e31b8a bellard
  {
98 31e31b8a bellard
    *(.dtors)
99 31e31b8a bellard
  }
100 31e31b8a bellard
  .plt      : { *(.plt)	}
101 31e31b8a bellard
  .got           : { *(.got.plt) *(.got) }
102 31e31b8a bellard
  .dynamic       : { *(.dynamic) }
103 31e31b8a bellard
  /* We want the small data sections together, so single-instruction offsets
104 31e31b8a bellard
     can access them all, and initialized data all before uninitialized, so
105 31e31b8a bellard
     we can shorten the on-disk segment size.  */
106 31e31b8a bellard
  .sdata     : { *(.sdata) }
107 31e31b8a bellard
  _edata  =  .;
108 31e31b8a bellard
  PROVIDE (edata = .);
109 31e31b8a bellard
  __bss_start = .;
110 31e31b8a bellard
  .sbss      : { *(.sbss) *(.scommon) }
111 31e31b8a bellard
  .bss       :
112 31e31b8a bellard
  {
113 31e31b8a bellard
   *(.dynbss)
114 31e31b8a bellard
   *(.bss)
115 31e31b8a bellard
   *(COMMON)
116 31e31b8a bellard
  }
117 31e31b8a bellard
  _end = . ;
118 31e31b8a bellard
  PROVIDE (end = .);
119 31e31b8a bellard
  /* Stabs debugging sections.  */
120 31e31b8a bellard
  .stab 0 : { *(.stab) }
121 31e31b8a bellard
  .stabstr 0 : { *(.stabstr) }
122 31e31b8a bellard
  .stab.excl 0 : { *(.stab.excl) }
123 31e31b8a bellard
  .stab.exclstr 0 : { *(.stab.exclstr) }
124 31e31b8a bellard
  .stab.index 0 : { *(.stab.index) }
125 31e31b8a bellard
  .stab.indexstr 0 : { *(.stab.indexstr) }
126 31e31b8a bellard
  .comment 0 : { *(.comment) }
127 31e31b8a bellard
  /* DWARF debug sections.
128 31e31b8a bellard
     Symbols in the DWARF debugging sections are relative to the beginning
129 31e31b8a bellard
     of the section so we begin them at 0.  */
130 31e31b8a bellard
  /* DWARF 1 */
131 31e31b8a bellard
  .debug          0 : { *(.debug) }
132 31e31b8a bellard
  .line           0 : { *(.line) }
133 31e31b8a bellard
  /* GNU DWARF 1 extensions */
134 31e31b8a bellard
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
135 31e31b8a bellard
  .debug_sfnames  0 : { *(.debug_sfnames) }
136 31e31b8a bellard
  /* DWARF 1.1 and DWARF 2 */
137 31e31b8a bellard
  .debug_aranges  0 : { *(.debug_aranges) }
138 31e31b8a bellard
  .debug_pubnames 0 : { *(.debug_pubnames) }
139 31e31b8a bellard
  /* DWARF 2 */
140 31e31b8a bellard
  .debug_info     0 : { *(.debug_info) }
141 31e31b8a bellard
  .debug_abbrev   0 : { *(.debug_abbrev) }
142 31e31b8a bellard
  .debug_line     0 : { *(.debug_line) }
143 31e31b8a bellard
  .debug_frame    0 : { *(.debug_frame) }
144 31e31b8a bellard
  .debug_str      0 : { *(.debug_str) }
145 31e31b8a bellard
  .debug_loc      0 : { *(.debug_loc) }
146 31e31b8a bellard
  .debug_macinfo  0 : { *(.debug_macinfo) }
147 31e31b8a bellard
  /* SGI/MIPS DWARF 2 extensions */
148 31e31b8a bellard
  .debug_weaknames 0 : { *(.debug_weaknames) }
149 31e31b8a bellard
  .debug_funcnames 0 : { *(.debug_funcnames) }
150 31e31b8a bellard
  .debug_typenames 0 : { *(.debug_typenames) }
151 31e31b8a bellard
  .debug_varnames  0 : { *(.debug_varnames) }
152 31e31b8a bellard
  /* These must appear regardless of  .  */
153 31e31b8a bellard
}