Fix: Segmentation fault caused by npd in objdump
[binutils-gdb.git] / ld / scripttempl / ia64vms.sc
blob4e0f4c09b1225b2ed232ab2f87276f2da76fb414
1 # Linker script for Itanium VMS systems.
2 # Tristan Gingold <gingold@adacore.com>.
4 # Copyright (C) 2014-2023 Free Software Foundation, Inc.
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.
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
14 PAGESIZE=0x10000
15 BLOCKSIZE=0x200
17 cat <<EOF
18 /* Copyright (C) 2014-2023 Free Software Foundation, Inc.
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.  */
24 OUTPUT_FORMAT("${OUTPUT_FORMAT}")
25 ${LIB_SEARCH_DIRS}
26 ENTRY(__entry)
28 SECTIONS
30   /* RW segment.  */
31   ${RELOCATING+. = ${PAGESIZE};}
33   \$DATA\$ ALIGN (${BLOCKSIZE}) : {
34     *(\$DATA\$ .data .data.*)
35     *(\$BSS\$ .bss .bss.*)
36   }
38   /* Code segment.  Note: name must be \$CODE\$ */
39   ${RELOCATING+. = ALIGN (${PAGESIZE});}
41   \$CODE\$ ALIGN (${BLOCKSIZE}) : {
42     *(\$CODE\$ .text .text.*)
43   }
44   .plt ALIGN (8) : {
45     *(.plt)
46   }
48   /* RO segment.  */
49   ${RELOCATING+. = ALIGN (${PAGESIZE});}
51   /* RO initialized data.  */
52   \$LITERAL\$ ALIGN (${BLOCKSIZE}) : {
53     *(\$LITERAL\$)
54     *(\$READONLY\$ .rodata .rodata.*)
55     *(.jcr)
56     *(.ctors)
57     *(.dtors)
58     *(.opd)
59     *(.gcc_except_table)
61     /* LIB$INITIALIZE stuff.  */
62     *(LIB\$INITIALIZDZ) /* Start marker.  */
63     *(LIB\$INITIALIZD_) /* Hi priority.  */
64     *(LIB\$INITIALIZE)  /* User.  */
65     *(LIB\$INITIALIZE$) /* End marker.  */
66   }
68   /* Short segment.  */
69   ${RELOCATING+. = ALIGN (${PAGESIZE});}
71   .srodata : {
72     *(.srodata .srodata.*)
73   }
74   .got ALIGN (8) : {
75     *(.got)
76   }
77   .IA_64.pltoff ALIGN (16) : {
78     *(.IA_64.pltoff)
79   }
80   \$TFR\$ ALIGN (16) : {
81     /* Transfer vector.  */
82     __entry = .;
83     *(.transfer)
84   }
86   ${RELOCATING+. = ALIGN (${PAGESIZE});}
88   \$RW_SHORT\$ ALIGN (${BLOCKSIZE}) : {
89     *(.sdata .sdata.*)
90     *(.sbss .sbss.*)
91   }
93   ${RELOCATING+. = ALIGN (${PAGESIZE});}
95   .IA_64.unwind ALIGN (${BLOCKSIZE}) : {
96     *(.IA_64.unwind .IA_64.unwind.*)
97   }
99   .IA_64.unwind_info ALIGN (8) : {
100     *(.IA_64.unwind_info .IA_64.unwind_info.*)
101   }
103   ${RELOCATING+. = ALIGN (${PAGESIZE});}
105   .dynamic /* \$DYNAMIC\$ */ ALIGN (${BLOCKSIZE}) : {
106     *(.dynamic)
107     *(.vmsdynstr)
108     *(.fixups)
109   }
111   ${RELOCATING+. = ALIGN (${PAGESIZE});}
113   .dynstr : { *(.dynstr) }
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) }
125 source_sh $srcdir/scripttempl/DWARF.sc
127 cat <<EOF
128   .note : { *(.vms.note) }
130   /DISCARD/ : { *(.note) *(.vms_display_name_info) }