]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/testsuite/ld-elf/elf.exp
aarch64: Add some DT_RELR ld tests
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-elf / elf.exp
CommitLineData
782c0ebf 1# Expect script for various ELF tests.
fd67aa11 2# Copyright (C) 2002-2024 Free Software Foundation, Inc.
b7b0b729 3#
f96b4a7b
NC
4# This file is part of the GNU Binutils.
5#
6# This program is free software; you can redistribute it and/or modify
b7b0b729 7# it under the terms of the GNU General Public License as published by
f96b4a7b 8# the Free Software Foundation; either version 3 of the License, or
b7b0b729
HPN
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
f96b4a7b
NC
18# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19# MA 02110-1301, USA.
b7b0b729 20#
b7b0b729
HPN
21
22# Exclude non-ELF targets.
23
43f9d75b 24if ![is_elf_format] {
b7b0b729
HPN
25 return
26}
27
85e963f1
NC
28# Return true if target is riscv little endian.
29# xfail the riscv little endain targets for the compressed1d1 test;
30# The riscv big endian targets and others should pass.
31proc riscv_little_endian { } {
32 if { [istarget "riscv32-*-*"]
33 || [istarget "riscv64-*-*"]
34 || [istarget "riscv32le-*-*"]
35 || [istarget "riscv64le-*-*"] } {
36 return 1
37 }
38 return 0
39}
40
e4970690 41set old_ldflags $LDFLAGS
9f264ea9
AM
42if { [istarget spu*-*-*] } {
43 set LDFLAGS "$LDFLAGS --local-store 0:0"
44}
dd803a24
AM
45
46# hpux .comm differs from everyone else
47set hpux ""
48set old_asflags $ASFLAGS
49if [istarget "*-*-hpux*"] {
50 set hpux "--defsym HPUX=1"
51 set ASFLAGS "$ASFLAGS --defsym HPUX=1"
52}
53
991cda6c
RH
54if { [istarget alpha*-*-* ] } {
55 # The compress1 test is written expecting 32-bit addresses; force the
56 # executable down into the low address space to match.
57 # ??? How can we adjust just the one testcase?
58 set LDFLAGS "$LDFLAGS -Ttext-segment 0x1000000"
54975ae9 59 set ASFLAGS "$ASFLAGS --defsym NO_SET=1"
991cda6c 60}
9f264ea9 61
56af5a30
AM
62if [istarget "tic6x-*-*"] {
63 append ASFLAGS " -mpic -mpid=near"
64}
65
5cc51864
L
66if { [istarget "*-*-solaris*"] } {
67 # Same for Solaris
68 set options_regsub(ld) {-melf_x86_64 -melf_x86_64_sol2}
69}
70
7f6a71ff
JM
71if { [is_remote host] } then {
72 remote_download host merge.ld
73}
74
b77db948
NC
75# Note - the output file from the second test (symbol3w.a) is
76# used in the proc is_elf64 test below...
dd803a24
AM
77run_ld_link_tests [list \
78 [list "Build symbol3.a" \
79 "" "" $hpux \
80 {symbol3.s} {} "symbol3.a" ] \
81 [list "Build symbol3w.a" \
82 "" "" "" \
83 {symbol3w.s} {} "symbol3w.a" ] \
84]
85
b77db948 86
b77db948
NC
87if [is_elf64 tmpdir/symbol3w.a] {
88 set ASFLAGS "$ASFLAGS --defsym ALIGN=3"
0a59decb 89 set pr23900_1_exp "pr23900-1-64.rd"
b7d07216
L
90 set pr25490_2_exp "pr25490-2-64.rd"
91 set pr25490_3_exp "pr25490-3-64.rd"
92 set pr25490_4_exp "pr25490-4-64.rd"
93 set pr25490_5_exp "pr25490-5-64.rd"
94 set pr25490_6_exp "pr25490-6-64.rd"
b77db948
NC
95} else {
96 set ASFLAGS "$ASFLAGS --defsym ALIGN=2"
0a59decb 97 set pr23900_1_exp "pr23900-1-32.rd"
b7d07216
L
98 if { [istarget avr-*-*]
99 || [istarget h8300-*-*]
100 || [istarget ip2k-*-*]
101 || [istarget m68hc11-*]
b7d07216
L
102 || [istarget "z80-*-*"] } {
103 set pr25490_2_exp "pr25490-2-16.rd"
104 set pr25490_3_exp "pr25490-3-16.rd"
105 set pr25490_4_exp "pr25490-4-16.rd"
106 set pr25490_5_exp "pr25490-5-16.rd"
107 set pr25490_6_exp "pr25490-6-16.rd"
108 } else {
109 set pr25490_2_exp "pr25490-2-32.rd"
110 set pr25490_3_exp "pr25490-3-32.rd"
111 set pr25490_4_exp "pr25490-4-32.rd"
112 set pr25490_5_exp "pr25490-5-32.rd"
113 set pr25490_6_exp "pr25490-6-32.rd"
114 }
b77db948
NC
115}
116
117
118
46b06a98 119# Targets that use _bfd_generic_link_add_symbols won't pass pr21703 tests
506981af
RL
120run_ld_link_tests {
121 {"PR ld/21703"
93f4de39 122 "--allow-multiple-definition tmpdir/pr21703-1.o tmpdir/pr21703-2.o" "" "" \
506981af 123 {pr21703-1.s pr21703-2.s} {{readelf {-s} pr21703.sd}} "pr21703" }
506981af 124 {"PR ld/21703 -r"
93f4de39 125 "-r --allow-multiple-definition tmpdir/pr21703-3.o tmpdir/pr21703-4.o" "" "" \
506981af 126 {pr21703-3.s pr21703-4.s} {{readelf {-s} pr21703-r.sd}} "pr21703.o" }
1336939d 127} \[is_generic\]
93f4de39 128
bdd32e03
AM
129if [is_underscore_target] {
130 set ASFLAGS "$ASFLAGS --defsym UNDERSCORE=1"
131}
132
e9d644e8
L
133set saved_ASFLAGS "$ASFLAGS"
134if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
135 set ASFLAGS "$ASFLAGS -mx86-used-note=no"
136}
137
99fabbc9
JL
138# Build libraries required for SHF_GNU_RETAIN tests.
139if { [check_gc_sections_available] && [supports_gnu_osabi] } {
140 run_ld_link_tests [list \
141 [list "Build libretain5.a" "" "" "" \
142 {retain5lib.s} {} "libretain5.a"] \
143 [list "Build libretain6.a" "" "" "" \
144 {retain6lib.s} {} "libretain6.a"] \
145 ]
146}
147
782c0ebf
AM
148set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
149foreach t $test_list {
150 # We need to strip the ".d", but can leave the dirname.
151 verbose [file rootname $t]
152 run_dump_test [file rootname $t]
153}
24edc24d 154
e9d644e8
L
155set ASFLAGS "$saved_ASFLAGS"
156
76359541 157# Check that the --out-implib option work correctly.
075a2b89 158# Targets that don't use elf.em won't support this.
dd803a24
AM
159run_ld_link_tests [list \
160 [list "Generate empty import library" \
161 "--out-implib=tmpdir/implib.lib" "" \
162 [concat "--defsym NO_GLOBAL=1" $hpux] \
163 {implib.s} \
164 {{ld empty-implib.out}} \
165 "implib" ] \
166 [list "Generate import library" \
167 "--out-implib=tmpdir/implib.lib" "" \
168 $hpux \
169 {implib.s} \
170 {{readelf {-s tmpdir/implib.lib} implib.rd}} \
171 "implib" ] \
1336939d 172] \[uses_genelf\]
76359541 173
eebad48e
L
174run_ld_link_tests [list \
175 [list "Generate undefweak-1.a" \
176 "" "" \
177 $hpux \
178 {undefweak-1a.s} \
179 {} \
180 "undefweak-1.a" ] \
181 [list "Generate undefweak-1.o" \
182 "-r" "tmpdir/undefweak-1.a" \
183 $hpux \
184 {undefweak-1b.s} \
185 {{readelf {-rsW} undefweak-1.rd}} \
186 "undefweak-1.o" ] \
6197c6f3 187] "alpha-*-*"
eebad48e 188
78336cd6
AM
189#v850 gas complains about .tbss.var section attributes.
190if { [check_gc_sections_available] && ![istarget "v850-*-*"] } {
430a16a5
NC
191 run_ld_link_tests {
192 {"--gc-sections on tls variable"
897aea50 193 "--gc-section" "" "" {tls_gc.s} {} "tls_gc"}
430a16a5
NC
194 }
195}
196
65daf5be 197proc target_defaults_to_execstack {} {
0ab70050
NC
198 global base_dir
199
200 # If the linker has been configured with --enable-default-execstack=no then
201 # this proc should always return 0.
202 if { [file exists $base_dir/config.status] } {
203 set status [remote_exec host grep "enable-default-execstack=no" $base_dir/config.status]
204 if { [lindex $status 0] == 0 } {
205 return 0
206 } else {
207 verbose -log "$base_dir/config.status does not contain enable-default-execstack=no"
208 }
209 } else {
210 verbose -log "there is no file $base_dir/config.status"
211 }
212
65daf5be
NC
213 if { [istarget "aarch64*-*-*"]
214 || [istarget "arc*-*-*"]
81cd0a49 215 || [istarget "cris*-*-*"]
65daf5be 216 || [istarget "ia64*-*-*"]
6e712424 217 || [istarget "kvx*-*-*"]
48ca1b26 218 || [istarget "loongarch*-*-*"]
65daf5be
NC
219 || [istarget "nios2*-*-*"]
220 || [istarget "powerpc64*-*-*"]
36f779c0 221 || [istarget "pru*-*-*"]
65daf5be
NC
222 || [istarget "riscv*-*-*"]
223 || [istarget "tilegx*-*-*"]
333cd559 224 || [istarget "tilepro*-*-*"] } {
65daf5be
NC
225 return 0
226 }
227 return 1
228}
229
230if { [istarget *-*-*linux*]
231 || [istarget *-*-nacl*]
232 || [istarget *-*-gnu*] } {
0a59decb
L
233 run_ld_link_tests [list \
234 [list "stack exec" \
e922d1ea 235 "-z execstack --no-error-execstack" \
0a59decb
L
236 "" \
237 "" \
238 {stack.s} \
239 {{readelf {-Wl} stack-exec.rd}} \
240 "stack-exec.exe"] \
241 [list "stack noexec" \
242 "-z noexecstack" \
243 "" \
244 "" \
245 {stack.s} \
246 {{readelf {-Wl} stack-noexec.rd}} \
247 "stack-noexec.exe"] \
248 [list "stack size" \
65daf5be 249 "-z stack-size=0x123400 -z noexecstack" \
0a59decb
L
250 "" \
251 "" \
252 {stack.s} \
253 {{readelf {-Wl} stack-size.rd}} \
254 "stack-size.exe"] \
255 [list "PT_GNU_PROPERTY alignment" \
256 "" \
257 "" \
258 "" \
259 {pr23900-1.s} \
260 [list [list "readelf" {-Wl} $pr23900_1_exp]] \
ba951afb
NC
261 "pr23900-1.exe"] \
262 ]
263
264 # Test the linker's generation of execstack and executable segment warnings.
265 # Since these are normally pruned from the linker's output we temporarily
266 # disable tha action here.
267 rename prune_warnings_extra old_prune_warnings_extra
268 proc prune_warnings_extra { text } {
269 return $text
270 }
acd65fa6 271
84789002
AM
272 set curr_ldflags $LDFLAGS
273 if { [istarget powerpc*-*-*] && ![istarget powerpc64*-*-*] } {
274 # Don't generate an executable .plt section
275 set LDFLAGS "$LDFLAGS --secure-plt"
276 }
277
9cfd4ed4
CC
278 # Since the warnings can be disabled by configure, ensure consistency
279 # of the first test by forcing the flags.
ba951afb 280 run_ld_link_tests [list \
333cd559 281 [list "PR ld/29072 (warn about an executable .note.GNU-stack)" \
e922d1ea 282 "-e 0 --warn-execstack --warn-rwx-segments --no-error-rwx-segments --no-error-execstack" \
65daf5be
NC
283 "" \
284 "" \
285 {pr29072-a.s} \
286 {{ld pr29072.a.warn}} \
287 "pr29072-a.exe"] \
288 [list "PR 29072 (warn about -z execstack)" \
e922d1ea 289 "-z execstack --warn-execstack --no-error-execstack" \
65daf5be
NC
290 "" \
291 "" \
292 {stack.s} \
293 {{ld pr29072.c.warn}} \
294 "pr29072-c.exe"] \
295 [list "PR ld/29072 (suppress warnings about executable stack)" \
296 "-e 0 --no-warn-execstack" \
297 "" \
298 "" \
299 {pr29072-a.s} \
300 {} \
301 "pr29072-d.exe"] \
ba951afb 302 [list "Ensure that a warning issued when creating a segment with RWX permissions" \
e922d1ea 303 "-e 0 -Tnobits-1.t --warn-rwx-segments --no-error-rwx-segments" \
ba951afb
NC
304 "" \
305 "" \
306 {nobits-1.s} \
307 {{ld rwx-segments-1.l}} \
308 "rwx-segments-1.exe"] \
309 [list "Ensure that a warning issued when creating a TLS segment with execute permission" \
e922d1ea 310 "-e 0 -T rwx-segments-2.t --warn-rwx-segments --no-error-rwx-segments" \
ba951afb
NC
311 "" \
312 "" \
313 {size-2.s} \
314 {{ld rwx-segments-2.l}} \
315 "rwx-segments-2.exe"] \
d11c7afa 316 [list "Ensure that the RWX warning can be suppressed" \
ba951afb
NC
317 "-e 0 -Tnobits-1.t --no-warn-rwx-segments" \
318 "" \
319 "" \
320 {nobits-1.s} \
321 {} \
322 "rwx-segments-3.exe"] \
323 ]
324
84789002
AM
325 set LDFLAGS $curr_ldflags
326
65daf5be
NC
327 if { [target_defaults_to_execstack] } {
328 run_ld_link_tests [list \
333cd559 329 [list "PR ld/29072 (warn about absent .note.GNU-stack)" \
e922d1ea 330 "-e 0 -z stack-size=0x123400 --warn-execstack --no-error-execstack" \
65daf5be
NC
331 "" \
332 "" \
333 {pr29072-b.s} \
334 {{ld pr29072.b.warn}} \
335 "pr29072-b.exe"] \
0a59decb 336 ]
65daf5be
NC
337 } else {
338 run_ld_link_tests [list \
333cd559 339 [list "PR ld/29072 (ignore absent .note.GNU-stack)" \
e922d1ea 340 "-e 0 -z stack-size=0x123400 --no-error-execstack" \
65daf5be
NC
341 "" \
342 "" \
343 {pr29072-b.s} \
344 {} \
345 "pr29072-b.exe"] \
346 ]
347 }
ba951afb
NC
348
349 # Restore the normal pruning behaviour.
350 rename prune_warnings_extra ""
351 rename old_prune_warnings_extra prune_warnings_extra
04c3a755
NS
352}
353
b7d07216
L
354if [check_gc_sections_available] {
355 run_ld_link_tests [list \
356 [list "__patchable_function_entries section 2" \
357 "--gc-sections -e _start" \
358 "" \
359 "" \
360 {pr25490-2.s} \
361 [list [list "readelf" {-SW} $pr25490_2_exp]] \
362 "pr25490-2.exe"] \
363 [list "__patchable_function_entries section 3" \
364 "--gc-sections -e _start" \
365 "" \
366 "" \
367 {pr25490-3.s} \
368 [list [list "readelf" {-SW} $pr25490_3_exp]] \
369 "pr25490-3.exe"] \
370 [list "__patchable_function_entries section 4" \
371 "--gc-sections -e _start" \
372 "" \
373 "" \
374 {pr25490-4.s} \
375 [list [list "readelf" {-SW} $pr25490_4_exp]] \
376 "pr25490-4.exe"] \
377 [list "__patchable_function_entries section 5" \
378 "--gc-sections -e _start" \
379 "" \
380 "" \
381 {pr25490-5.s} \
382 [list [list "readelf" {-SW} $pr25490_5_exp]] \
383 "pr25490-5.exe"] \
384 [list "__patchable_function_entries section 6" \
385 "--gc-sections -e _start" \
386 "" \
387 "" \
388 {pr25490-6.s} \
389 [list [list "readelf" {-SW} $pr25490_6_exp]] \
390 "pr25490-6.exe"] \
391 ]
392}
393
e4970690 394set LDFLAGS $old_ldflags
dd803a24 395set ASFLAGS $old_asflags
e4970690 396
4ce6ca2c 397# Check to see if the C compiler works
44ed8092 398if { ![check_compiler_available] } {
4ce6ca2c
AM
399 return
400}
401
a130722b
L
402if [check_gc_sections_available] {
403 run_cc_link_tests {
404 {"PR ld/13195" "-Wl,--gc-sections" ""
405 {pr13195.c} {} "pr13195"}
406 }
54e8959c
L
407}
408
24edc24d 409set array_tests {
d9816402
AM
410 {"preinit array" "" ""
411 {preinit.c} "preinit" "preinit.out"}
412 {"init array" "" ""
413 {init.c} "init" "init.out"}
414 {"fini array" "" ""
415 {fini.c} "fini" "fini.out"}
416 {"init array mixed" "" ""
417 {init-mixed.c} "init-mixed" "init-mixed.out" "-I."}
310fd250
L
418}
419set array_tests_pie {
d9816402
AM
420 {"PIE preinit array" "-pie" ""
421 {preinit.c} "preinit" "preinit.out" "-fPIE"}
422 {"PIE init array" "-pie" ""
423 {init.c} "init" "init.out" "-fPIE"}
424 {"PIE fini array" "-pie" ""
425 {fini.c} "fini" "fini.out" "-fPIE"}
426 {"PIE init array mixed" "-pie" ""
427 {init-mixed.c} "init-mixed" "init-mixed.out" "-I. -fPIE"}
428 {"PIE PR ld/14525" "-pie" ""
429 {pr14525.c} "pr14525" "pr14525.out" "-fPIE"}
5940a93c
TS
430}
431set array_tests_static {
d9816402
AM
432 {"static preinit array" "-static" ""
433 {preinit.c} "preinit" "preinit.out"}
434 {"static init array" "-static" ""
435 {init.c} "init" "init.out"}
436 {"static fini array" "-static" ""
437 {fini.c} "fini" "fini.out"}
438 {"static init array mixed" "-static" ""
439 {init-mixed.c} "init-mixed" "init-mixed.out" "-I."}
24edc24d
L
440}
441
c8c140d9 442# NetBSD ELF systems do not currently support the .*_array sections.
ab4f385b 443set xfails "*-*-netbsd*"
982c6f26 444run_ld_link_exec_tests $array_tests $xfails
310fd250 445
3fee20ef 446if { [istarget *-*-linux*]
5a68afcf 447 || [istarget *-*-nacl*]
3fee20ef 448 || [istarget *-*-gnu*] } {
982c6f26 449 run_ld_link_exec_tests $array_tests_pie $xfails
a91e1603 450
b3d7a867
L
451 if { $STATIC_PIE_LDFLAGS != "" } then {
452 run_ld_link_exec_tests [list \
453 [list \
454 "Static PIE preinit array" \
455 "$STATIC_PIE_LDFLAGS" \
456 "" \
457 {preinit.c} \
458 "preinit-static-pie" \
459 "preinit.out" \
460 "-fPIE" \
461 ] \
462 [list \
463 "Static PIE init array" \
464 "$STATIC_PIE_LDFLAGS" \
465 "" \
466 {init.c} \
467 "init-static-pie" \
468 "init.out" \
469 "-fPIE" \
470 ] \
471 [list \
472 "Static PIE fini array" \
473 "$STATIC_PIE_LDFLAGS" \
474 "" \
475 {fini.c} \
476 "fini-static-pie" \
477 "fini.out" \
478 "-fPIE" \
479 ] \
480 [list \
481 "Static PIE init array mixed" \
482 "$STATIC_PIE_LDFLAGS" \
483 "" \
484 {init-mixed.c} \
485 "init-mixed-static-pie" \
486 "init-mixed.out" \
487 "-I. -fPIE" \
488 ] \
489 [list \
490 "Static PIE PR ld/14525" \
491 "$STATIC_PIE_LDFLAGS" \
492 "" \
493 {pr14525.c} \
494 "pr14525-static-pie" \
495 "pr14525.out" \
496 "-fPIE" \
497 ] \
498 ]
499 }
500
a91e1603
L
501 run_ld_link_exec_tests [list \
502 [list \
503 "Run mbind2a" \
65daf5be 504 "$NOPIE_LDFLAGS -Wl,-z,common-page-size=0x4000 -Wl,-z,noexecstack" \
a91e1603
L
505 "" \
506 { mbind2a.s mbind2b.c } \
507 "mbind2a" \
508 "pass.out" \
509 "-O2 -I../bfd" \
510 ] \
511 [list \
512 "Run mbind2b" \
65daf5be 513 "-static -Wl,-z,common-page-size=0x4000 -Wl,-z,noexecstack" \
a91e1603
L
514 "" \
515 { mbind2a.s mbind2b.c } \
516 "mbind2b" \
517 "pass.out" \
518 "-O2 -I../bfd" \
519 ] \
520 ]
310fd250
L
521}
522
982c6f26 523run_ld_link_exec_tests $array_tests_static $xfails
9ab80182 524
496afd17
L
525run_cc_link_tests [list \
526 [list \
527 "Build pr26391-1" \
528 "-Wl,-z,unique-symbol" \
529 "-fno-function-sections" \
530 {pr26391a.c pr26391b.c pr26391c.c pr26391d.c} \
531 {{nm "" pr26391.nd}} \
532 "pr26391-1" \
533 ] \
534 [list \
535 "Build pr26391-2" \
536 "-Wl,-z,unique-symbol" \
537 "-ffunction-sections" \
538 {pr26391a.c pr26391b.c pr26391c.c pr26391d.c} \
539 {{nm "" pr26391.nd}} \
540 "pr26391-2" \
541 ] \
542 [list \
543 "Build pr26391-3" \
544 "-Wl,-z,unique-symbol,--emit-relocs" \
545 "-fno-function-sections" \
546 {pr26391a.c pr26391b.c pr26391c.c pr26391d.c} \
547 {{nm "" pr26391.nd}} \
548 "pr26391-3" \
549 ] \
550 [list \
551 "Build pr26391-4" \
552 "-Wl,-z,unique-symbol,--emit-relocs" \
553 "-ffunction-sections" \
554 {pr26391a.c pr26391b.c pr26391c.c pr26391d.c} \
555 {{nm "" pr26391.nd}} \
556 "pr26391-4" \
557 ] \
496afd17
L
558 [list \
559 "Build pr26391-5.o" \
64b59b6b
L
560 "-Wl,-z,unique-symbol -r -nostdlib -nostartfiles" \
561 "-fno-function-sections" \
496afd17 562 {pr26391a.c pr26391b.c pr26391c.c pr26391d.c} \
bcac599f
L
563 [list \
564 [list "nm" "$dep_plug_opt" "pr26391.nd"] \
565 [list "nm" "$dep_plug_opt" "pr26391.fd"] \
566 ] \
496afd17 567 "pr26391-5.o" \
496afd17
L
568 ] \
569 [list \
570 "Build pr26391-6.o" \
64b59b6b
L
571 "-Wl,-z,unique-symbol -r -nostdlib -nostartfiles" \
572 "-ffunction-sections" \
496afd17
L
573 {pr26391a.c pr26391b.c pr26391c.c pr26391d.c} \
574 {{nm "" pr26391.nd}} \
575 "pr26391-6.o" \
496afd17
L
576 ] \
577]
578
579run_ld_link_exec_tests [list \
580 [list \
581 "Run pr26391-1" \
582 "-Wl,-z,unique-symbol" \
583 "" \
584 {pr26391a.c pr26391b.c pr26391c.c pr26391d.c} \
585 "pr26391-1" \
586 "pr26391.out" \
587 "-fno-function-sections" \
588 ] \
589 [list \
590 "Run pr26391-2" \
591 "-Wl,-z,unique-symbol" \
592 "" \
593 {pr26391a.c pr26391b.c pr26391c.c pr26391d.c} \
594 "pr26391-2" \
595 "pr26391.out" \
596 "-ffunction-sections" \
597 ] \
598 [list \
599 "Run pr26391-3" \
600 "-Wl,-z,unique-symbol,--emit-relocs" \
601 "" \
602 {pr26391a.c pr26391b.c pr26391c.c pr26391d.c} \
603 "pr26391-3" \
604 "pr26391.out" \
605 "-fno-function-sections" \
606 ] \
607 [list \
608 "Run pr26391-4" \
609 "-Wl,-z,unique-symbol,--emit-relocs" \
610 "" \
611 {pr26391a.c pr26391b.c pr26391c.c pr26391d.c} \
612 "pr26391-4" \
613 "pr26391.out" \
614 "-ffunction-sections" \
615 ] \
616 [list \
617 "Run pr26391-5" \
618 "-Wl,-z,unique-symbol" \
619 "" \
620 {dummy.c} \
621 "pr26391-5" \
622 "pr26391.out" \
623 "" \
624 "c" \
625 "" \
626 "tmpdir/pr26391-5.o" \
627 ] \
628 [list \
629 "Run pr26391-6" \
630 "-Wl,-z,unique-symbol" \
631 "" \
632 {dummy.c} \
633 "pr26391-6" \
634 "pr26391.out" \
635 "" \
636 "c" \
637 "" \
638 "tmpdir/pr26391-6.o" \
639 ] \
640]
641
ec15b12d
MM
642set merge_exec_tests {
643 {"merge4" "" ""
644 {merge4a.c merge4b.s} "merge4" "merge4.out"}
645}
646run_ld_link_exec_tests $merge_exec_tests
647
02ecc8e9 648catch "exec rm -f tmpdir/preinit tmpdir/init tmpdir/fini tmpdir/init-mixed" status