OSDN Git Service

Re-autconf configure script after Mike Frysinger's recent AC_ERROR
[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 W_RODAT         *(.gnu.linkonce.r*)
29
30                 /* This is special code area at the end of the normal
31                    text section.  It contains a small lookup table at
32                    the start followed by the code pointed to by entries
33                    in the lookup table.  */
34                 . = ALIGN (4) ;
35                 PROVIDE(__ctbp = .);
36                 *(.call_table_data)
37                 *(.call_table_text)
38
39                 . = ALIGN(0x20) ;
40                 _etext = . ;
41         } > flatmem
42
43         .data : {
44                 . = ALIGN(0x4) ;
45                 _sdata = . ;
46                 __data_start = . ;
47                 data_start = . ;
48                 *(.got.plt)
49                 *(.got)
50                 FILL(0) ;
51                 . = ALIGN(0x20) ; 
52                 LONG(-1)
53                 . = ALIGN(0x20) ; 
54 R_RODAT         *(.rodata)
55 R_RODAT         *(.rodata1)
56 R_RODAT         *(.rodata.*)
57 R_RODAT         *(.gnu.linkonce.r*)
58                 *(.data)
59                 *(.data1)
60                 *(.data.*)
61                 *(.gnu.linkonce.d*)
62                 *(.data1)
63                 *(.eh_frame)
64                 *(.gcc_except_table)
65
66                 /* Microblaze has .sdata and .sbss (small bss).  They must
67                    be contiguous, so please don't move any of this. JW */
68                 _ssrw = . ;                     
69                 *(.sdata) 
70                 *(.sdata.*)
71                 *(.sbss)                        /* Don't move this! */
72                 _essrw = . ;
73
74                 _ssrw_size = _essrw - _ssrw;
75                 PROVIDE(_SDA_BASE_ = _ssrw + (_ssrw_size / 2));
76
77                 *(.gnu.linkonce.s.*)
78                 *(__libc_atexit)
79                 *(__libc_subinit)
80                 *(__libc_subfreeres)
81                 *(.note.ABI-tag)
82
83                 /* microblaze-specific read-only small data area
84                    and associated locating symbols */
85                 _ssro = . ;
86                 *(.sdata2)
87                 _essro = . ;
88                 _ssro_size = _essro - _ssro;
89                 PROVIDE(_SDA2_BASE_ = _ssro + (_ssro_size / 2));
90
91                 . = ALIGN(4) ;
92                 __CTOR_LIST__ = .;
93                 LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
94 SINGLE_LINK:    /* gcc uses crtbegin.o to find the start of
95 SINGLE_LINK:       the constructors, so we make sure it is
96 SINGLE_LINK:       first.  Because this is a wildcard, it
97 SINGLE_LINK:       doesn't matter if the user does not
98 SINGLE_LINK:       actually link against crtbegin.o; the
99 SINGLE_LINK:       linker won't look for a file to match a
100 SINGLE_LINK:       wildcard.  The wildcard also means that it
101 SINGLE_LINK:       doesn't matter which directory crtbegin.o
102 SINGLE_LINK:       is in.  */
103 SINGLE_LINK:    KEEP (*crtbegin*.o(.ctors))
104 SINGLE_LINK:    /* We don't want to include the .ctor section from
105 SINGLE_LINK:       from the crtend.o file until after the sorted ctors.
106 SINGLE_LINK:       The .ctor section from the crtend file contains the
107 SINGLE_LINK:       end of ctors marker and it must be last */
108 SINGLE_LINK:    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
109 SINGLE_LINK:    KEEP (*(SORT(.ctors.*)))
110                 KEEP (*(.ctors))
111                 LONG(0)
112                 __CTOR_END__ = .;
113                 __DTOR_LIST__ = .;
114                 LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
115 SINGLE_LINK:    KEEP (*crtbegin*.o(.dtors))
116 SINGLE_LINK:    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
117 SINGLE_LINK:    KEEP (*(SORT(.dtors.*)))
118                 KEEP (*(.dtors))
119                 LONG(0)
120                 __DTOR_END__ = .;
121
122                 PROVIDE (__preinit_array_start = .);
123                 KEEP (*(.preinit_array))
124                 PROVIDE (__preinit_array_end = .);
125
126                 PROVIDE (__init_array_start = .);
127                 KEEP (*(SORT(.init_array.*)))
128                 KEEP (*(.init_array))
129                 PROVIDE (__init_array_end = .);
130
131                 PROVIDE (__fini_array_start = .);
132                 KEEP (*(.fini_array))
133                 KEEP (*(SORT(.fini_array.*)))
134                 PROVIDE (__fini_array_end = .);
135
136                 . = ALIGN(0x10) ; 
137                 _edata = . ;
138         } > flatmem
139
140         .bss : {
141                 . = ALIGN(0x4) ;
142                 _sbss = ALIGN(0x4) ;
143                 __bss_start = . ;
144                 *(.dynsbss)
145                 *(.sbss)
146                 *(.sbss.*)
147                 *(.scommon)
148                 *(.dynbss)
149                 *(.bss)
150                 *(.bss.*)
151                 *(.bss*)
152                 *(.gnu.linkonce.b*)
153                 *(COMMON)
154                 . = ALIGN(0x10) ;
155                 _ebss = . ;
156                 _end = . ;
157                 end = . ;
158         } > flatmem
159
160         .stack : {
161                 . = ALIGN(0x4);
162                 __stack_start = .;
163         }
164
165         .junk 0 : { *(.rel*) *(.rela*) }
166         /* Stabs debugging sections.    */
167         .stab 0 : { *(.stab) }
168         .stabstr 0 : { *(.stabstr) }
169         .stab.excl 0 : { *(.stab.excl) }
170         .stab.exclstr 0 : { *(.stab.exclstr) }
171         .stab.index 0 : { *(.stab.index) }
172         .stab.indexstr 0 : { *(.stab.indexstr) }
173         .comment 0 : { *(.comment) }
174         .debug_abbrev 0 : { *(.debug_abbrev) }
175         .debug_info 0 : { *(.debug_info) }
176         .debug_line 0 : { *(.debug_line) }
177         .debug_pubnames 0 : { *(.debug_pubnames) }
178         .debug_aranges 0 : { *(.debug_aranges) }
179 }