Commit | Line | Data |
---|---|---|
202e2356 NC |
1 | # Linker script for Itanium VMS systems. |
2 | # Tristan Gingold <gingold@adacore.com>. | |
985743c7 | 3 | # |
82704155 | 4 | # Copyright (C) 2014-2019 Free Software Foundation, Inc. |
6c19b93b | 5 | # |
985743c7 NC |
6 | # Copying and distribution of this file, with or without modification, |
7 | # are permitted in any medium without royalty provided the copyright | |
8 | # notice and this notice are preserved. | |
202e2356 | 9 | |
2bf2bf23 AM |
10 | # Using an empty script for ld -r is better than mashing together |
11 | # sections. This hack likely leaves ld -Ur broken. | |
12 | test -n "${RELOCATING}" || exit 0 | |
13 | ||
202e2356 NC |
14 | PAGESIZE=0x10000 |
15 | BLOCKSIZE=0x200 | |
16 | ||
17 | cat <<EOF | |
82704155 | 18 | /* Copyright (C) 2014-2019 Free Software Foundation, Inc. |
985743c7 NC |
19 | |
20 | Copying and distribution of this script, with or without modification, | |
21 | are permitted in any medium without royalty provided the copyright | |
22 | notice and this notice are preserved. */ | |
23 | ||
202e2356 NC |
24 | OUTPUT_FORMAT("${OUTPUT_FORMAT}") |
25 | ${LIB_SEARCH_DIRS} | |
26 | ENTRY(__entry) | |
27 | ||
28 | SECTIONS | |
29 | { | |
30 | /* RW segment. */ | |
31 | ${RELOCATING+. = ${PAGESIZE};} | |
32 | ||
33 | \$DATA\$ ALIGN (${BLOCKSIZE}) : { | |
34 | *(\$DATA\$ .data .data.*) | |
639453f5 | 35 | *(\$BSS\$ .bss .bss.*) |
202e2356 NC |
36 | } |
37 | ||
38 | /* Code segment. Note: name must be \$CODE\$ */ | |
39 | ${RELOCATING+. = ALIGN (${PAGESIZE});} | |
40 | ||
41 | \$CODE\$ ALIGN (${BLOCKSIZE}) : { | |
639453f5 | 42 | *(\$CODE\$ .text .text.*) |
202e2356 NC |
43 | } |
44 | .plt ALIGN (8) : { | |
45 | *(.plt) | |
46 | } | |
47 | ||
48 | /* RO segment. */ | |
49 | ${RELOCATING+. = ALIGN (${PAGESIZE});} | |
50 | ||
51 | /* RO initialized data. */ | |
52 | \$LITERAL\$ ALIGN (${BLOCKSIZE}) : { | |
53 | *(\$LITERAL\$) | |
639453f5 | 54 | *(\$READONLY\$ .rodata .rodata.*) |
202e2356 NC |
55 | *(.jcr) |
56 | *(.ctors) | |
57 | *(.dtors) | |
58 | *(.opd) | |
59 | *(.gcc_except_table) | |
60 | ||
61 | /* LIB$INITIALIZE stuff. */ | |
62 | *(LIB\$INITIALIZDZ) /* Start marker. */ | |
63 | *(LIB\$INITIALIZD_) /* Hi priority. */ | |
64 | *(LIB\$INITIALIZE) /* User. */ | |
65 | *(LIB\$INITIALIZE$) /* End marker. */ | |
66 | } | |
67 | ||
68 | /* Short segment. */ | |
69 | ${RELOCATING+. = ALIGN (${PAGESIZE});} | |
70 | ||
71 | .srodata : { | |
639453f5 | 72 | *(.srodata .srodata.*) |
202e2356 NC |
73 | } |
74 | .got ALIGN (8) : { | |
75 | *(.got) | |
76 | } | |
77 | .IA_64.pltoff ALIGN (16) : { | |
78 | *(.IA_64.pltoff) | |
79 | } | |
80 | \$TFR\$ ALIGN (16) : { | |
b81c93c8 | 81 | /* Transfer vector. */ |
202e2356 NC |
82 | __entry = .; |
83 | *(.transfer) | |
84 | } | |
85 | ||
86 | ${RELOCATING+. = ALIGN (${PAGESIZE});} | |
87 | ||
88 | \$RW_SHORT\$ ALIGN (${BLOCKSIZE}) : { | |
89 | *(.sdata .sdata.*) | |
639453f5 | 90 | *(.sbss .sbss.*) |
202e2356 NC |
91 | } |
92 | ||
93 | ${RELOCATING+. = ALIGN (${PAGESIZE});} | |
94 | ||
95 | .IA_64.unwind ALIGN (${BLOCKSIZE}) : { | |
96 | *(.IA_64.unwind .IA_64.unwind.*) | |
97 | } | |
98 | ||
99 | .IA_64.unwind_info ALIGN (8) : { | |
100 | *(.IA_64.unwind_info .IA_64.unwind_info.*) | |
101 | } | |
102 | ||
103 | ${RELOCATING+. = ALIGN (${PAGESIZE});} | |
104 | ||
105 | .dynamic /* \$DYNAMIC\$ */ ALIGN (${BLOCKSIZE}) : { | |
106 | *(.dynamic) | |
107 | *(.vmsdynstr) | |
108 | *(.fixups) | |
109 | } | |
110 | ||
111 | ${RELOCATING+. = ALIGN (${PAGESIZE});} | |
112 | ||
113 | .dynstr : { *(.dynstr) } | |
114 | ||
115 | .dynsym ${RELOCATING-0} : { *(.dynsym) } | |
116 | .rela.got : { *(.rela.got) } | |
117 | .got.plt : { *(.got.plt) } | |
118 | .gnu.version_d : { *(.gnu.version_d) } | |
119 | .gnu.version : { *(.gnu.version) } | |
120 | .gnu.version_r : { *(.gnu.version_r) } | |
121 | .rela.IA_64.pltoff : { *(.rela.IA_64.pltoff) } | |
122 | ||
ceb0a680 NC |
123 | EOF |
124 | ||
d061dfac | 125 | . $srcdir/scripttempl/DWARF.sc |
ceb0a680 | 126 | |
6c19b93b | 127 | cat <<EOF |
202e2356 NC |
128 | .note : { *(.vms.note) } |
129 | ||
639453f5 | 130 | /DISCARD/ : { *(.note) *(.vms_display_name_info) } |
202e2356 NC |
131 | } |
132 | EOF |