37ee46cf74b325db6c4c504f4887d5a4ed6ad83d
[profile/ivi/syslinux.git] / com32 / lib / com32.ld
1 /*
2  * Linker script for COM32 binaries using libcom32
3  */
4
5 /* Script for -z combreloc: combine and sort reloc sections */
6 OUTPUT_FORMAT("elf32-i386", "elf32-i386",
7               "elf32-i386")
8 OUTPUT_ARCH(i386)
9 EXTERN(_start)
10 ENTRY(_start)
11 SECTIONS
12 {
13   /* Read-only sections, merged into text segment: */
14   . = 0;
15   PROVIDE (__executable_start = .);
16   PROVIDE (_stext = .);
17
18   .init           :
19   {
20     KEEP (*(.init))
21   } =0x90909090
22   .text           :
23   {
24     *(.text .stub .text.* .gnu.linkonce.t.*)
25     /* .gnu.warning sections are handled specially by elf32.em.  */
26     *(.gnu.warning)
27   } =0x90909090
28   .fini           :
29   {
30     KEEP (*(.fini))
31   } =0x90909090
32   PROVIDE (_etext = .);
33
34   __rodata_start = .;
35   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
36   .rodata1        : { *(.rodata1) }
37   __rodata_end = .;
38
39   /* Ensure the __preinit_array_start label is properly aligned.  We
40      could instead move the label definition inside the section, but
41      the linker would then create the section even if it turns out to
42      be empty, which isn't pretty.  */
43   . = ALIGN(4);
44   .preinit_array     : {
45     PROVIDE (__preinit_array_start = .);
46     *(.preinit_array)
47     PROVIDE (__preinit_array_end = .);
48   }
49   .init_array     : {
50     PROVIDE (__init_array_start = .);
51     *(.init_array)
52     PROVIDE (__init_array_end = .);
53   }
54   .fini_array     : {
55     PROVIDE (__fini_array_start = .);
56     *(.fini_array)
57     PROVIDE (__fini_array_end = .);
58   }
59   .ctors          : {
60     PROVIDE (__ctors_start = .);
61     KEEP (*(SORT(.ctors.*)))
62     KEEP (*(.ctors))
63     PROVIDE (__ctors_end = .);
64   }
65   .dtors          : {
66     PROVIDE (__dtors_start = .);
67     KEEP (*(SORT(.dtors.*)))
68     KEEP (*(.dtors))
69     PROVIDE (__dtors_end = .);
70   }
71
72   .got            : {
73     PROVIDE (__got_start = .);
74     KEEP (*(.got.plt))
75     KEEP (*(.got))
76     PROVIDE (__got_end = .);
77   }
78
79   /* Adjust the address for the data segment.  Avoid mixing code and
80      data within same 128-byte chunk. */
81   . = ALIGN(128);
82
83   .data           :
84   {
85     _sdata = .;
86     KEEP(*(.data .data.* .gnu.linkonce.d.*))
87     SORT(CONSTRUCTORS)
88     *(.data1)
89     . = ALIGN(4);
90     _edata = .;
91   }
92
93   __bss_start = .;
94   .bss            :
95   {
96    *(.dynbss)
97    *(.bss .bss.* .gnu.linkonce.b.*)
98    *(COMMON)
99    /* Align here to ensure that the .bss section occupies space up to
100       _end.  Align after .bss to ensure correct alignment even if the
101       .bss section disappears because there are no input sections.  */
102    . = ALIGN(4);
103   }
104   . = ALIGN(4);
105   _end = .;
106
107   /* Stabs debugging sections.  */
108   .stab          0 : { *(.stab) }
109   .stabstr       0 : { *(.stabstr) }
110   .stab.excl     0 : { *(.stab.excl) }
111   .stab.exclstr  0 : { *(.stab.exclstr) }
112   .stab.index    0 : { *(.stab.index) }
113   .stab.indexstr 0 : { *(.stab.indexstr) }
114   .comment       0 : { *(.comment) }
115   /* DWARF debug sections.
116      Symbols in the DWARF debugging sections are relative to the beginning
117      of the section so we begin them at 0.  */
118   /* DWARF 1 */
119   .debug          0 : { *(.debug) }
120   .line           0 : { *(.line) }
121   /* GNU DWARF 1 extensions */
122   .debug_srcinfo  0 : { *(.debug_srcinfo) }
123   .debug_sfnames  0 : { *(.debug_sfnames) }
124   /* DWARF 1.1 and DWARF 2 */
125   .debug_aranges  0 : { *(.debug_aranges) }
126   .debug_pubnames 0 : { *(.debug_pubnames) }
127   /* DWARF 2 */
128   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
129   .debug_abbrev   0 : { *(.debug_abbrev) }
130   .debug_line     0 : { *(.debug_line) }
131   .debug_frame    0 : { *(.debug_frame) }
132   .debug_str      0 : { *(.debug_str) }
133   .debug_loc      0 : { *(.debug_loc) }
134   .debug_macinfo  0 : { *(.debug_macinfo) }
135   /* SGI/MIPS DWARF 2 extensions */
136   .debug_weaknames 0 : { *(.debug_weaknames) }
137   .debug_funcnames 0 : { *(.debug_funcnames) }
138   .debug_typenames 0 : { *(.debug_typenames) }
139   .debug_varnames  0 : { *(.debug_varnames) }
140   /DISCARD/ : { *(.note.GNU-stack) }
141 }