2 # Unusual variables checked by this code:
3 # NOP - four 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 .ctors .rodata ...
6 # (e.g., .PARISC.milli)
7 # OTHER_READWRITE_SECTIONS - other than .data .bss .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
14 # DATA_START_SYMBOLS - symbols that appear at the start of the
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.
20 # When adding sections, do note that the names of some sections are used
21 # when specifying the start address of the next.
23 test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
24 test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
25 test "$LD_FLAG" = "N" && DATA_ADDR=.
26 INTERP=".interp : { *(.interp) }"
27 PLT=".plt : { *(.plt) }"
29 OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
30 "${LITTLE_OUTPUT_FORMAT}")
33 ${RELOCATING+${LIB_SEARCH_DIRS}}
34 ${RELOCATING+/* Do we need any of these for elf?
35 __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
36 ${RELOCATING+${EXECUTABLE_SYMBOLS}}
40 /* Read-only sections, merged into text segment: */
41 ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}}
42 ${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}}
43 ${CREATE_SHLIB-${INTERP}}
45 .dynsym : { *(.dynsym) }
46 .dynstr : { *(.dynstr) }
47 .rel.text : { *(.rel.text) }
48 .rela.text : { *(.rela.text) }
49 .rel.data : { *(.rel.data) }
50 .rela.data : { *(.rela.data) }
51 .rel.rodata : { *(.rel.rodata) }
52 .rela.rodata : { *(.rela.rodata) }
53 .rel.got : { *(.rel.got) }
54 .rela.got : { *(.rela.got) }
55 .rel.ctors : { *(.rel.ctors) }
56 .rela.ctors : { *(.rela.ctors) }
57 .rel.dtors : { *(.rel.dtors) }
58 .rela.dtors : { *(.rela.dtors) }
59 .rel.bss : { *(.rel.bss) }
60 .rela.bss : { *(.rela.bss) }
61 .rel.plt : { *(.rel.plt) }
62 .rela.plt : { *(.rela.plt) }
63 .init : { *(.init) } =${NOP-0}
67 ${RELOCATING+${TEXT_START_SYMBOLS}}
69 ${CONSTRUCTING+ __CTOR_LIST__ = .;}
70 ${CONSTRUCTING+ LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)}
71 ${CONSTRUCTING+ *(.ctors)}
72 ${CONSTRUCTING+ LONG(0)}
73 ${CONSTRUCTING+ __CTOR_END__ = .;}
74 ${CONSTRUCTING+ __DTOR_LIST__ = .;}
75 ${CONSTRUCTING+ LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)}
76 ${CONSTRUCTING+ *(.dtors)}
77 ${CONSTRUCTING+ LONG(0)}
78 ${CONSTRUCTING+ __DTOR_END__ = .;}
80 ${RELOCATING+_etext = .;}
81 ${RELOCATING+PROVIDE (etext = .);}
82 .fini : { *(.fini) } =${NOP-0}
83 .ctors : { *(.ctors) }
84 .dtors : { *(.dtors) }
85 .rodata : { *(.rodata) }
86 .rodata1 : { *(.rodata1) }
87 ${OTHER_READONLY_SECTIONS}
89 /* Read-write section, merged into data segment: */
90 ${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};}
93 ${RELOCATING+${DATA_START_SYMBOLS}}
95 ${CONSTRUCTING+CONSTRUCTORS}
97 .data1 : { *(.data1) }
98 ${OTHER_READWRITE_SECTIONS}
99 .got : { *(.got.plt) *(.got) }
100 .dynamic : { *(.dynamic) }
102 /* We want the small data sections together, so single-instruction offsets
103 can access them all, and initialized data all before uninitialized, so
104 we can shorten the on-disk segment size. */
105 .sdata : { *(.sdata) }
106 ${RELOCATING+_edata = .;}
107 ${RELOCATING+PROVIDE (edata = .);}
108 ${RELOCATING+__bss_start = .;}
109 ${RELOCATING+${OTHER_BSS_SYMBOLS}}
110 .sbss : { *(.sbss) *(.scommon) }
117 ${RELOCATING+_end = . ;}
118 ${RELOCATING+PROVIDE (end = .);}
120 /* These are needed for ELF backends which have not yet been
121 converted to the new style linker. */
122 .stab 0 : { *(.stab) }
123 .stabstr 0 : { *(.stabstr) }