Kill r16/rce/acp stuff.
[deliverable/binutils-gdb.git] / ld / scripttempl / elf.sc
1 #
2 # Unusual variables checked by this code:
3 # NOP - two byte opcode for no-op (defaults to 0)
4 # DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
5 # OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
6 # (e.g., .PARISC.milli)
7 # OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
8 # (e.g., .PARISC.global)
9 # OTHER_SECTIONS - at the end
10 # EXECUTABLE_SYMBOLS - symbols that must be defined for an
11 # executable (e.g., _DYNAMIC_LINK)
12 # TEXT_START_SYMBOLS - symbols that appear at the start of the
13 # .text section.
14 # DATA_START_SYMBOLS - symbols that appear at the start of the
15 # .data section.
16 # OTHER_BSS_SYMBOLS - symbols that appear at the start of the
17 # .bss section besides __bss_start.
18 # DATA_PLT - .plt should be in data segment, not text segment.
19 #
20 # When adding sections, do note that the names of some sections are used
21 # when specifying the start address of the next.
22 #
23 test -z "$ENTRY" && ENTRY=_start
24 test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
25 test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
26 test "$LD_FLAG" = "N" && DATA_ADDR=.
27 INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
28 PLT=".plt ${RELOCATING-0} : { *(.plt) }"
29 cat <<EOF
30 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
31 "${LITTLE_OUTPUT_FORMAT}")
32 OUTPUT_ARCH(${ARCH})
33 ENTRY(${ENTRY})
34
35 ${RELOCATING+${LIB_SEARCH_DIRS}}
36 ${RELOCATING+/* Do we need any of these for elf?
37 __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
38 ${RELOCATING+${EXECUTABLE_SYMBOLS}}
39 ${RELOCATING- /* For some reason, the Solaris linker makes bad executables
40 if gld -r is used and the intermediate file has sections starting
41 at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
42 bug. But for now assigning the zero vmas works. */}
43 SECTIONS
44 {
45 /* Read-only sections, merged into text segment: */
46 ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}}
47 ${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}}
48 ${CREATE_SHLIB-${INTERP}}
49 .hash ${RELOCATING-0} : { *(.hash) }
50 .dynsym ${RELOCATING-0} : { *(.dynsym) }
51 .dynstr ${RELOCATING-0} : { *(.dynstr) }
52 .rel.text ${RELOCATING-0} : { *(.rel.text) }
53 .rela.text ${RELOCATING-0} : { *(.rela.text) }
54 .rel.data ${RELOCATING-0} : { *(.rel.data) }
55 .rela.data ${RELOCATING-0} : { *(.rela.data) }
56 .rel.rodata ${RELOCATING-0} : { *(.rel.rodata) }
57 .rela.rodata ${RELOCATING-0} : { *(.rela.rodata) }
58 .rel.got ${RELOCATING-0} : { *(.rel.got) }
59 .rela.got ${RELOCATING-0} : { *(.rela.got) }
60 .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
61 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
62 .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
63 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
64 .rel.init ${RELOCATING-0} : { *(.rel.init) }
65 .rela.init ${RELOCATING-0} : { *(.rela.init) }
66 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
67 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
68 .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
69 .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
70 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
71 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
72 .init ${RELOCATING-0} : { *(.init) } =${NOP-0}
73 ${DATA_PLT-${PLT}}
74 .text ${RELOCATING-0} :
75 {
76 ${RELOCATING+${TEXT_START_SYMBOLS}}
77 *(.text)
78 /* .gnu.warning sections are handled specially by elf32.em. */
79 *(.gnu.warning)
80 } =${NOP-0}
81 ${RELOCATING+_etext = .;}
82 ${RELOCATING+PROVIDE (etext = .);}
83 .fini ${RELOCATING-0} : { *(.fini) } =${NOP-0}
84 .rodata ${RELOCATING-0} : { *(.rodata) }
85 .rodata1 ${RELOCATING-0} : { *(.rodata1) }
86 ${RELOCATING+${OTHER_READONLY_SECTIONS}}
87
88 /* Read-write section, merged into data segment: */
89 ${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};}
90 .data ${RELOCATING-0} :
91 {
92 ${RELOCATING+${DATA_START_SYMBOLS}}
93 *(.data)
94 ${CONSTRUCTING+CONSTRUCTORS}
95 }
96 .data1 ${RELOCATING-0} : { *(.data1) }
97 ${RELOCATING+${OTHER_READWRITE_SECTIONS}}
98 .ctors ${RELOCATING-0} : { *(.ctors) }
99 .dtors ${RELOCATING-0} : { *(.dtors) }
100 .got ${RELOCATING-0} : { *(.got.plt) *(.got) }
101 .dynamic ${RELOCATING-0} : { *(.dynamic) }
102 ${DATA_PLT+${PLT}}
103 /* We want the small data sections together, so single-instruction offsets
104 can access them all, and initialized data all before uninitialized, so
105 we can shorten the on-disk segment size. */
106 .sdata ${RELOCATING-0} : { *(.sdata) }
107 ${RELOCATING+_edata = .;}
108 ${RELOCATING+PROVIDE (edata = .);}
109 ${RELOCATING+__bss_start = .;}
110 ${RELOCATING+${OTHER_BSS_SYMBOLS}}
111 .sbss ${RELOCATING-0} : { *(.sbss) *(.scommon) }
112 .bss ${RELOCATING-0} :
113 {
114 *(.dynbss)
115 *(.bss)
116 *(COMMON)
117 }
118 ${RELOCATING+_end = . ;}
119 ${RELOCATING+PROVIDE (end = .);}
120
121 /* These are needed for ELF backends which have not yet been
122 converted to the new style linker. */
123 .stab 0 : { *(.stab) }
124 .stabstr 0 : { *(.stabstr) }
125
126 /* These must appear regardless of ${RELOCATING}. */
127 ${OTHER_SECTIONS}
128 }
129 EOF
This page took 0.032067 seconds and 4 git commands to generate.