source: mainline/uspace/srv/loader/arch/amd64/_link.ld.in@ 1e00216

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 1e00216 was 1e00216, checked in by Martin Decky <martin@…>, 15 years ago

add support for line number debug information into linker scripts (ia32, amd64; both kernel & uspace)
add basic support for PT_NOTE into ELF loaders (both kernel & uspace)

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 * The difference from _link.ld.in for regular statically-linked apps
3 * is the base address and the special interp section.
4 */
5
6STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
7ENTRY(__entry)
8
9PHDRS {
10 interp PT_INTERP;
11 text PT_LOAD FLAGS(5);
12 data PT_LOAD FLAGS(6);
13 debug PT_NOTE;
14}
15
16SECTIONS {
17 .interp : {
18 *(.interp);
19 } :interp
20
21 /* . = 0x0000700000001000; */
22 . = 0x70001000;
23
24 .init ALIGN(0x1000) : SUBALIGN(0x1000) {
25 *(.init);
26 } :text
27
28 .text : {
29 *(.text);
30 *(.rodata*);
31 } :text
32
33 .data ALIGN(0x1000) : SUBALIGN(0x1000) {
34 *(.data);
35 } :data
36
37 .tdata : {
38 _tdata_start = .;
39 *(.tdata);
40 _tdata_end = .;
41 } :data
42
43 .tbss : {
44 _tbss_start = .;
45 *(.tbss);
46 _tbss_end = .;
47 } :data
48
49 _tls_alignment = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss));
50
51 .bss : {
52 *(COMMON);
53 *(.bss);
54 } :data
55
56 . = ALIGN(0x1000);
57 _heap = .;
58
59#ifdef CONFIG_LINE_DEBUG
60 .comment 0 : { *(.comment); } :debug
61 .debug_abbrev 0 : { *(.debug_abbrev); } :debug
62 .debug_aranges 0 : { *(.debug_aranges); } :debug
63 .debug_info 0 : { *(.debug_info); } :debug
64 .debug_line 0 : { *(.debug_line); } :debug
65 .debug_loc 0 : { *(.debug_loc); } :debug
66 .debug_pubnames 0 : { *(.debug_pubnames); } :debug
67 .debug_pubtypes 0 : { *(.debug_pubtypes); } :debug
68 .debug_ranges 0 : { *(.debug_ranges); } :debug
69 .debug_str 0 : { *(.debug_str); } :debug
70#endif
71
72 /DISCARD/ : {
73 *(*);
74 }
75}
Note: See TracBrowser for help on using the repository browser.