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

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 7fb3f1c was 729f774f, checked in by Jiri Svoboda <jiri@…>, 15 years ago

Merge linker script sources for shared libs and dynamicaly linked executables
into the default one.

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