OSDN Git Service

nios/nios2 support by Wentao Xu <wentao@microtronix.com>
[uclinux-h8/elf2flt.git] / elf2flt.ld
1
2 ENTRY (_start)
3
4 MEMORY {
5         flatmem : ORIGIN = 0x0, LENGTH = 0xfffffff
6 }
7
8 SECTIONS {
9
10         .text 0x0 : {
11                 . = . + 4;
12                 . = ALIGN(0x4) ;
13                 _stext = . ;
14                 *(.text)
15                 *(.text.*)
16                 *(.gnu.warning)
17                 *(.stub)
18                 *(.gnu.linkonce.t*)
19                 *(.glue_7t)
20                 *(.glue_7)
21                 *(.jcr)
22                 *(.init)
23                 *(.fini)
24
25 W_RODAT         *(.rodata)
26 W_RODAT         *(.rodata1)
27 W_RODAT         *(.rodata.*)
28
29                 /* This is special code area at the end of the normal
30                    text section.  It contains a small lookup table at
31                    the start followed by the code pointed to by entries
32                    in the lookup table.  */
33                 . = ALIGN (4) ;
34                 PROVIDE(__ctbp = .);
35                 *(.call_table_data)
36                 *(.call_table_text)
37
38                 . = ALIGN(0x20) ;
39                 _etext = . ;
40         } > flatmem
41
42         .data : {
43                 . = ALIGN(0x4) ;
44                 _sdata = . ;
45                 __data_start = . ;
46                 data_start = . ;
47                 *(.got.plt)
48                 *(.got)
49                 FILL(0) ;
50                 . = ALIGN(0x20) ; 
51                 LONG(-1)
52                 . = ALIGN(0x20) ; 
53 R_RODAT         *(.rodata)
54 R_RODAT         *(.rodata1)
55 R_RODAT         *(.rodata.*)
56                 *(.gnu.linkonce.r*)
57                 *(.data)
58                 *(.data1)
59                 *(.data.*)
60                 *(.gnu.linkonce.d*)
61                 *(.data1)
62                 *(.eh_frame)
63                 *(.gcc_except_table)
64
65                 /* Microblaze has .sdata and .sbss (small bss).  They must
66                    be contiguous, so please don't move any of this. JW */
67                 _ssrw = . ;                     
68                 *(.sdata) 
69                 *(.sdata.*)
70                 *(.sbss)                        /* Don't move this! */
71                 _essrw = . ;
72
73                 _ssrw_size = _essrw - _ssrw;
74                 PROVIDE(_SDA_BASE_ = _ssrw + (_ssrw_size / 2));
75
76                 *(.gnu.linkonce.s.*)
77                 *(__libc_atexit)
78                 *(__libc_subinit)
79                 *(__libc_subfreeres)
80                 *(.note.ABI-tag)
81
82                 /* microblaze-specific read-only small data area
83                    and associated locating symbols */
84                 _ssro = . ;
85                 *(.sdata2)
86                 _essro = . ;
87                 _ssro_size = _essro - _ssro;
88                 PROVIDE(_SDA2_BASE_ = _ssro + (_ssro_size / 2));
89
90                 . = ALIGN(4) ;
91                 __CTOR_LIST__ = .;
92                 LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
93                 *(.ctors)
94                 LONG(0)
95                 __CTOR_END__ = .;
96                 __DTOR_LIST__ = .;
97                 LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
98                 *(.dtors)
99                 LONG(0)
100                 __DTOR_END__ = .;
101
102                 . = ALIGN(0x10) ; 
103                 _edata = . ;
104         } > flatmem
105
106         .bss : {
107                 . = ALIGN(0x4) ;
108                 _sbss = ALIGN(0x4) ;
109                 __bss_start = . ;
110                 *(.dynsbss)
111                 *(.sbss)
112                 *(.sbss.*)
113                 *(.scommon)
114                 *(.dynbss)
115                 *(.bss)
116                 *(.bss.*)
117                 *(.bss*)
118                 *(.gnu.linkonce.b*)
119                 *(COMMON)
120                 . = ALIGN(0x10) ;
121                 _ebss = . ;
122                 _end = . ;
123                 end = . ;
124         } > flatmem
125
126         .stack : {
127                 . = ALIGN(0x4);
128                 __stack_start = .;
129         }
130
131         .junk 0 : { *(.rel*) *(.rela*) }
132         /* Stabs debugging sections.    */
133         .stab 0 : { *(.stab) }
134         .stabstr 0 : { *(.stabstr) }
135         .stab.excl 0 : { *(.stab.excl) }
136         .stab.exclstr 0 : { *(.stab.exclstr) }
137         .stab.index 0 : { *(.stab.index) }
138         .stab.indexstr 0 : { *(.stab.indexstr) }
139         .comment 0 : { *(.comment) }
140         .debug_abbrev 0 : { *(.debug_abbrev) }
141         .debug_info 0 : { *(.debug_info) }
142         .debug_line 0 : { *(.debug_line) }
143         .debug_pubnames 0 : { *(.debug_pubnames) }
144         .debug_aranges 0 : { *(.debug_aranges) }
145 }