import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / mips / ld.script.in
1 OUTPUT_ARCH(mips)
2 ENTRY(kernel_entry)
3 SECTIONS
4 {
5   /* Read-only sections, merged into text segment: */
6   . = @@LOADADDR@@;
7   .init          : { *(.init)           } =0
8   .text      :
9   {
10     _ftext = . ;
11     *(.text)
12     *(.rodata)
13     *(.rodata.*)
14     *(.rodata1)
15     /* .gnu.warning sections are handled specially by elf32.em.  */
16     *(.gnu.warning)
17   } =0
18   .kstrtab : { *(.kstrtab) }
19
20   . = ALIGN(16);                /* Exception table */
21   __start___ex_table = .;
22   __ex_table : { *(__ex_table) }
23   __stop___ex_table = .;
24
25   __start___dbe_table = .;      /* Exception table for data bus errors */
26   __dbe_table : { *(__dbe_table) }
27   __stop___dbe_table = .;
28
29   __start___ksymtab = .;        /* Kernel symbol table */
30   __ksymtab : { *(__ksymtab) }
31   __stop___ksymtab = .;
32
33   _etext = .;
34
35   . = ALIGN(8192);
36   .data.init_task : { *(.data.init_task) }
37
38   /* Startup code */
39   . = ALIGN(4096);
40   __init_begin = .;
41   .text.init : { *(.text.init) }
42   .data.init : { *(.data.init) }
43   . = ALIGN(16);
44   __setup_start = .;
45   .setup.init : { *(.setup.init) }
46   __setup_end = .;
47   __initcall_start = .;
48   .initcall.init : { *(.initcall.init) }
49   __initcall_end = .;
50   . = ALIGN(4096);      /* Align double page for init_task_union */
51   __init_end = .;
52
53   . = ALIGN(32);
54   .data.cacheline_aligned : { *(.data.cacheline_aligned) }
55
56   .fini      : { *(.fini)    } =0
57   .reginfo : { *(.reginfo) }
58   /* Adjust the address for the data segment.  We want to adjust up to
59      the same address within the page on the next page up.  It would
60      be more correct to do this:
61        . = .;
62      The current expression does not correctly handle the case of a
63      text segment ending precisely at the end of a page; it causes the
64      data segment to skip a page.  The above expression does not have
65      this problem, but it will currently (2/95) cause BFD to allocate
66      a single segment, combining both text and data, for this case.
67      This will prevent the text segment from being shared among
68      multiple executions of the program; I think that is more
69      important than losing a page of the virtual address space (note
70      that no actual memory is lost; the page which is skipped can not
71      be referenced).  */
72   . = .;
73   .data    :
74   {
75     _fdata = . ;
76     *(.data)
77
78    /* Align the initial ramdisk image (INITRD) on page boundaries. */
79    . = ALIGN(4096);
80    __rd_start = .;
81    *(.initrd)
82    . = ALIGN(4096);
83    __rd_end = .;
84
85     CONSTRUCTORS
86   }
87   .data1   : { *(.data1) }
88   _gp = . + 0x8000;
89   .lit8 : { *(.lit8) }
90   .lit4 : { *(.lit4) }
91   .ctors         : { *(.ctors)   }
92   .dtors         : { *(.dtors)   }
93   .got           : { *(.got.plt) *(.got) }
94   .dynamic       : { *(.dynamic) }
95   /* We want the small data sections together, so single-instruction offsets
96      can access them all, and initialized data all before uninitialized, so
97      we can shorten the on-disk segment size.  */
98   .sdata     : { *(.sdata) }
99   . = ALIGN(4);
100   _edata  =  .;
101   PROVIDE (edata = .);
102
103   __bss_start = .;
104   _fbss = .;
105   .sbss      : { *(.sbss) *(.scommon) }
106   .bss       :
107   {
108    *(.dynbss)
109    *(.bss)
110    *(COMMON)
111    .  = ALIGN(4);
112   _end = . ;
113   PROVIDE (end = .);
114   }
115
116   /* Sections to be discarded */
117   /DISCARD/ :
118   {
119         *(.text.exit)
120         *(.data.exit)
121         *(.exitcall.exit)
122   }
123
124   /* This is the MIPS specific mdebug section.  */
125   .mdebug : { *(.mdebug) }
126   /* These are needed for ELF backends which have not yet been
127      converted to the new style linker.  */
128   .stab 0 : { *(.stab) }
129   .stabstr 0 : { *(.stabstr) }
130   /* DWARF debug sections.
131      Symbols in the .debug DWARF section are relative to the beginning of the
132      section so we begin .debug at 0.  It's not clear yet what needs to happen
133      for the others.   */
134   .debug          0 : { *(.debug) }
135   .debug_srcinfo  0 : { *(.debug_srcinfo) }
136   .debug_aranges  0 : { *(.debug_aranges) }
137   .debug_pubnames 0 : { *(.debug_pubnames) }
138   .debug_sfnames  0 : { *(.debug_sfnames) }
139   .line           0 : { *(.line) }
140   /* These must appear regardless of  .  */
141   .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
142   .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
143   .comment : { *(.comment) }
144   .note : { *(.note) }
145 }