source: mainline/uspace/lib/c/arch/ia32/_link.ld.in@ 38d8849

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 38d8849 was 2eadda9, checked in by Jiří Zárevúcky <jiri.zarevucky@…>, 7 years ago

Remove undefined references to main program from shared libc.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1#ifndef SHLIB
2ENTRY(_start)
3#endif
4
5PHDRS {
6#if defined(DLEXE)
7 interp PT_INTERP;
8#endif
9 text PT_LOAD FILEHDR PHDRS FLAGS(5);
10 data PT_LOAD FLAGS(6);
11 tls PT_TLS;
12#if defined(SHLIB) || defined(DLEXE)
13 dynamic PT_DYNAMIC;
14#endif
15 debug PT_NOTE;
16}
17
18SECTIONS {
19#ifdef SHLIB
20 . = SEGMENT_START("text-segment", 0);
21#else
22 . = SEGMENT_START("text-segment", 0x400000);
23 PROVIDE (__executable_start = .);
24#endif
25 . = . + SIZEOF_HEADERS;
26
27 .init : {
28 *(.init);
29 } :text
30
31 .text : {
32 *(.text .text.*);
33 *(.rodata .rodata.*);
34 } :text
35
36#if defined(SHLIB) || defined(DLEXE)
37 .rel.plt : {
38 *(.rel.plt);
39 }
40 /*
41 *.rel.dyn MUST FOLLOW IMMEDIATELY after .rel.plt
42 * without alignment gap or DT_REL will be broken
43 */
44 .rel.dyn : {
45 *(.rel.*);
46 } :text
47
48 .plt : {
49 *(.plt);
50 } :text
51
52 .dynsym : {
53 *(.dynsym);
54 } :text
55
56 .dynstr : {
57 *(.dynstr);
58 } :text
59
60 .hash : {
61 *(.hash .gnu.hash);
62 } :text
63#endif
64
65#if defined(DLEXE)
66 .interp : {
67 *(.interp);
68 } :interp :text
69#endif
70
71 . = . + 0x1000;
72
73#if defined(SHLIB) || defined(DLEXE)
74 .dynamic : {
75 *(.dynamic);
76 } :data :dynamic
77#endif
78
79 .data : {
80 *(.data);
81 } :data
82
83#if defined(SHLIB) || defined(DLEXE)
84 .data.rel : {
85 *(.data.rel .data.rel.*);
86 } :data
87
88 .got : {
89 *(.got);
90 } :data
91#endif
92
93 .got.plt : {
94 *(.got.plt);
95 } :data
96
97 .tdata : {
98 *(.tdata);
99 *(.tdata.*);
100 *(.gnu.linkonce.td.*);
101 } :data :tls
102
103 .tbss : {
104 *(.tbss);
105 *(.tbss.*);
106 *(.gnu.linkonce.tb.*);
107 } :data :tls
108
109 .bss : {
110 *(.dynbss);
111 *(COMMON);
112 *(.bss);
113 } :data
114
115 __dso_handle = .;
116
117 .init_array : {
118#ifndef SHLIB
119 PROVIDE_HIDDEN (__init_array_start = .);
120#endif
121 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
122 KEEP (*(.init_array .ctors))
123#ifndef SHLIB
124 PROVIDE_HIDDEN (__init_array_end = .);
125#endif
126 }
127
128 .fini_array : {
129#ifndef SHLIB
130 PROVIDE_HIDDEN (__fini_array_start = .);
131#endif
132 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
133 KEEP (*(.fini_array .dtors))
134#ifndef SHLIB
135 PROVIDE_HIDDEN (__fini_array_end = .);
136#endif
137 }
138
139 _end = .;
140
141#ifdef CONFIG_LINE_DEBUG
142 .comment 0 : { *(.comment); } :debug
143 .debug_abbrev 0 : { *(.debug_abbrev); } :debug
144 .debug_aranges 0 : { *(.debug_aranges); } :debug
145 .debug_info 0 : { *(.debug_info); } :debug
146 .debug_line 0 : { *(.debug_line); } :debug
147 .debug_loc 0 : { *(.debug_loc); } :debug
148 .debug_pubnames 0 : { *(.debug_pubnames); } :debug
149 .debug_pubtypes 0 : { *(.debug_pubtypes); } :debug
150 .debug_ranges 0 : { *(.debug_ranges); } :debug
151 .debug_str 0 : { *(.debug_str); } :debug
152#endif
153
154 /DISCARD/ : {
155 *(*);
156 }
157}
Note: See TracBrowser for help on using the repository browser.