Subversion Repositories QNX 8.QNX8 GNU binutils

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 pmbaty 1
/* Script for -z combreloc */
2
/* Copyright (C) 2014-2023 Free Software Foundation, Inc.
3
   Copying and distribution of this script, with or without modification,
4
   are permitted in any medium without royalty provided the copyright
5
   notice and this notice are preserved.  */
6
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
7
	      "elf64-x86-64")
8
OUTPUT_ARCH(i386:x86-64)
9
ENTRY(_start)
10
SEARCH_DIR("=/opt/qnx800/host/linux/x86_64/usr/x86_64-pc-nto-qnx8.0.0/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
11
SECTIONS
12
{
13
  /* Read-only sections, merged into text segment: */
14
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000)); . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
15
  .interp         : { *(.interp) }
16
  .note.gnu.build-id  : { *(.note.gnu.build-id) }
17
  .hash           : { *(.hash) }
18
  .gnu.hash       : { *(.gnu.hash) }
19
  .dynsym         : { *(.dynsym) }
20
  .dynstr         : { *(.dynstr) }
21
  .gnu.version    : { *(.gnu.version) }
22
  .gnu.version_d  : { *(.gnu.version_d) }
23
  .gnu.version_r  : { *(.gnu.version_r) }
24
  .rela.dyn       :
25
    {
26
      *(.rela.init)
27
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
28
      *(.rela.fini)
29
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
30
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
31
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
32
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
33
      *(.rela.ctors)
34
      *(.rela.dtors)
35
      *(.rela.got)
36
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
37
      *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
38
      *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
39
      *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
40
      *(.rela.ifunc)
41
    }
42
  .rela.plt       :
43
    {
44
      *(.rela.plt)
45
      PROVIDE_HIDDEN (__rela_iplt_start = .);
46
      *(.rela.iplt)
47
      PROVIDE_HIDDEN (__rela_iplt_end = .);
48
    }
49
  .relr.dyn : { *(.relr.dyn) }
50
  .init           :
51
  {
52
    KEEP (*(SORT_NONE(.init)))
53
  }
54
  .plt            : { *(.plt) *(.iplt) }
55
.plt.got        : { *(.plt.got) }
56
.plt.sec        : { *(.plt.sec) }
57
  .text           :
58
  {
59
    _btext = .;
60
    *(.text.unlikely .text.*_unlikely .text.unlikely.*)
61
    *(.text.exit .text.exit.*)
62
    *(.text.startup .text.startup.*)
63
    *(.text.hot .text.hot.*)
64
    *(SORT(.text.sorted.*))
65
    *(.text .stub .text.* .gnu.linkonce.t.*)
66
    /* .gnu.warning sections are handled specially by elf.em.  */
67
    *(.gnu.warning)
68
  }
69
  .fini           :
70
  {
71
    KEEP (*(SORT_NONE(.fini)))
72
  }
73
  PROVIDE (__etext = .);
74
  PROVIDE (_etext = .);
75
  PROVIDE (etext = .);
76
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
77
  .rodata1        : { *(.rodata1) }
78
  .eh_frame_hdr   : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
79
  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
80
  .sframe         : ONLY_IF_RO { *(.sframe) *(.sframe.*) }
81
  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
82
  .gnu_extab   : ONLY_IF_RO { *(.gnu_extab*) }
83
  /* These sections are generated by the Sun/Oracle C++ compiler.  */
84
  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges*) }
85
  /* Adjust the address for the data segment.  We want to adjust up to
86
     the same address within the page on the next page up.  */
87
  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
88
  /* Exception handling  */
89
  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
90
  .sframe         : ONLY_IF_RW { *(.sframe) *(.sframe.*) }
91
  .gnu_extab      : ONLY_IF_RW { *(.gnu_extab) }
92
  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
93
  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges*) }
94
  /* Thread Local Storage sections  */
95
  .tdata	  :
96
   {
97
     PROVIDE_HIDDEN (__tdata_start = .);
98
     *(.tdata .tdata.* .gnu.linkonce.td.*)
99
   }
100
  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
101
  .preinit_array    :
102
  {
103
    PROVIDE_HIDDEN (__preinit_array_start = .);
104
    KEEP (*(.preinit_array))
105
    PROVIDE_HIDDEN (__preinit_array_end = .);
106
  }
107
  .init_array    :
108
  {
109
    PROVIDE_HIDDEN (__init_array_start = .);
110
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
111
    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
112
    PROVIDE_HIDDEN (__init_array_end = .);
113
  }
114
  .fini_array    :
115
  {
116
    PROVIDE_HIDDEN (__fini_array_start = .);
117
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
118
    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
119
    PROVIDE_HIDDEN (__fini_array_end = .);
120
  }
121
  .ctors          :
122
  {
123
    /* gcc uses crtbegin.o to find the start of
124
       the constructors, so we make sure it is
125
       first.  Because this is a wildcard, it
126
       doesn't matter if the user does not
127
       actually link against crtbegin.o; the
128
       linker won't look for a file to match a
129
       wildcard.  The wildcard also means that it
130
       doesn't matter which directory crtbegin.o
131
       is in.  */
132
    KEEP (*crtbegin.o(.ctors))
133
    KEEP (*crtbegin?.o(.ctors))
134
    /* We don't want to include the .ctor section from
135
       the crtend.o file until after the sorted ctors.
136
       The .ctor section from the crtend file contains the
137
       end of ctors marker and it must be last */
138
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
139
    KEEP (*(SORT(.ctors.*)))
140
    KEEP (*(.ctors))
141
  }
142
  .dtors          :
143
  {
144
    KEEP (*crtbegin.o(.dtors))
145
    KEEP (*crtbegin?.o(.dtors))
146
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
147
    KEEP (*(SORT(.dtors.*)))
148
    KEEP (*(.dtors))
149
  }
150
  .jcr            : { KEEP (*(.jcr)) }
151
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
152
  .dynamic        : { *(.dynamic) }
153
  .got            : { *(.got) *(.igot) }
154
  . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 24 ? 24 : 0, .);
155
  .got.plt        : { *(.got.plt) *(.igot.plt) }
156
  .data           :
157
  {
158
    *(.data .data.* .gnu.linkonce.d.*)
159
    SORT(CONSTRUCTORS)
160
  }
161
  .data1          : { *(.data1) }
162
  _edata = .; PROVIDE (edata = .);
163
  . = .;
164
  __bss_start = .;
165
  .bss            :
166
  {
167
   *(.dynbss)
168
   *(.bss .bss.* .gnu.linkonce.b.*)
169
   *(COMMON)
170
   /* Align here to ensure that the .bss section occupies space up to
171
      _end.  Align after .bss to ensure correct alignment even if the
172
      .bss section disappears because there are no input sections.
173
      FIXME: Why do we need it? When there is no .bss section, we do not
174
      pad the .data section.  */
175
   . = ALIGN(. != 0 ? 64 / 8 : 1);
176
  }
177
  .lbss   :
178
  {
179
    *(.dynlbss)
180
    *(.lbss .lbss.* .gnu.linkonce.lb.*)
181
    *(LARGE_COMMON)
182
  }
183
  . = ALIGN(64 / 8);
184
  . = SEGMENT_START("ldata-segment", .);
185
  .lrodata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
186
  {
187
    *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
188
  }
189
  .ldata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
190
  {
191
    *(.ldata .ldata.* .gnu.linkonce.l.*)
192
    . = ALIGN(. != 0 ? 64 / 8 : 1);
193
  }
194
  . = ALIGN(64 / 8);
195
  _end = .; PROVIDE (end = .);
196
  . = DATA_SEGMENT_END (.);
197
  /* Stabs debugging sections.  */
198
  .stab          0 : { *(.stab) }
199
  .stabstr       0 : { *(.stabstr) }
200
  .stab.excl     0 : { *(.stab.excl) }
201
  .stab.exclstr  0 : { *(.stab.exclstr) }
202
  .stab.index    0 : { *(.stab.index) }
203
  .stab.indexstr 0 : { *(.stab.indexstr) }
204
  .comment 0 (INFO) : { *(.comment); LINKER_VERSION; }
205
  .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
206
  /* DWARF debug sections.
207
     Symbols in the DWARF debugging sections are relative to the beginning
208
     of the section so we begin them at 0.  */
209
  /* DWARF 1.  */
210
  .debug          0 : { *(.debug) }
211
  .line           0 : { *(.line) }
212
  /* GNU DWARF 1 extensions.  */
213
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
214
  .debug_sfnames  0 : { *(.debug_sfnames) }
215
  /* DWARF 1.1 and DWARF 2.  */
216
  .debug_aranges  0 : { *(.debug_aranges) }
217
  .debug_pubnames 0 : { *(.debug_pubnames) }
218
  /* DWARF 2.  */
219
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
220
  .debug_abbrev   0 : { *(.debug_abbrev) }
221
  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end) }
222
  .debug_frame    0 : { *(.debug_frame) }
223
  .debug_str      0 : { *(.debug_str) }
224
  .debug_loc      0 : { *(.debug_loc) }
225
  .debug_macinfo  0 : { *(.debug_macinfo) }
226
  /* SGI/MIPS DWARF 2 extensions.  */
227
  .debug_weaknames 0 : { *(.debug_weaknames) }
228
  .debug_funcnames 0 : { *(.debug_funcnames) }
229
  .debug_typenames 0 : { *(.debug_typenames) }
230
  .debug_varnames  0 : { *(.debug_varnames) }
231
  /* DWARF 3.  */
232
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
233
  .debug_ranges   0 : { *(.debug_ranges) }
234
  /* DWARF 5.  */
235
  .debug_addr     0 : { *(.debug_addr) }
236
  .debug_line_str 0 : { *(.debug_line_str) }
237
  .debug_loclists 0 : { *(.debug_loclists) }
238
  .debug_macro    0 : { *(.debug_macro) }
239
  .debug_names    0 : { *(.debug_names) }
240
  .debug_rnglists 0 : { *(.debug_rnglists) }
241
  .debug_str_offsets 0 : { *(.debug_str_offsets) }
242
  .debug_sup      0 : { *(.debug_sup) }
243
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
244
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
245
}