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

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since d2bb25e7 was 6adb775f, checked in by Jiri Svoboda <jiri@…>, 9 years ago

TLS for dynamically linked executables and initially loaded DSOs (but must not call dlopen or there will be trouble).

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