]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - ld/testsuite/ld-elfvsb/elfvsb.exp
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-elfvsb / elfvsb.exp
1 # Expect script for ld-visibility tests
2 # Copyright (C) 2000-2018 Free Software Foundation, Inc.
3 #
4 # This file is part of the GNU Binutils.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
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
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 #
21 # Written by Ian Lance Taylor (ian@cygnus.com)
22 # and H.J. Lu (hjl@gnu.org)
23 #
24
25 # Make sure that ld can generate ELF shared libraries with visibility.
26
27 # Check to see if the C compiler works
28 if { [which $CC] == 0 } {
29 return
30 }
31
32 # This test can only be run on a couple of ELF platforms.
33 # Square bracket expressions seem to confuse istarget.
34 if { ![istarget hppa*64*-*-hpux*] \
35 && ![istarget hppa*-*-linux*] \
36 && ![istarget i?86-*-linux*] \
37 && ![istarget i?86-*-gnu*] \
38 && ![istarget *-*-nacl*] \
39 && ![istarget ia64-*-linux*] \
40 && ![istarget m68k-*-linux*] \
41 && ![istarget mips*-*-linux*] \
42 && ![istarget powerpc*-*-linux*] \
43 && ![istarget arm*-*-linux*] \
44 && ![istarget alpha*-*-linux*] \
45 && ![istarget sparc*-*-linux*] \
46 && ![istarget s390*-*-linux*] \
47 && ![istarget sh\[34\]*-*-linux*] \
48 && ![istarget x86_64-*-linux*] } {
49 return
50 }
51
52 if { [istarget *-*-linux*aout*] \
53 || [istarget *-*-linux*oldld*] } {
54 return
55 }
56
57 set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
58 foreach t $test_list {
59 # We need to strip the ".d", but can leave the dirname.
60 verbose [file rootname $t]
61 run_dump_test [file rootname $t]
62 }
63
64 set tmpdir tmpdir
65 set SHCFLAG ""
66 set shared_needs_pic "no"
67 set COMPRESS_LDFLAG "-Wl,--compress-debug-sections=zlib-gabi"
68
69 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
70
71 # AIX shared libraries do not seem to support useful features,
72 # like overriding the shared library function or letting the
73 # shared library refer to objects defined in the main program. We
74 # avoid testing those features.
75 set SHCFLAG "-DXCOFF_TEST"
76
77 # The AIX 3.2.5 loader appears to randomly fail when loading
78 # shared libraries from NSF mounted partitions, so we avoid any
79 # potential problems by using a local directory.
80 catch {exec /bin/sh -c "echo $$"} pid
81 set tmpdir /usr/tmp/ld.$pid
82 catch "exec mkdir $tmpdir" exec_status
83
84 # On AIX, we need to explicitly export the symbols the shared
85 # library is going to provide, and need.
86 set file [open $tmpdir/xcoff.exp w]
87 puts $file shlibvar1
88 puts $file shlibvar2
89 puts $file shlib_shlibvar1
90 puts $file shlib_shlibvar2
91 puts $file shlib_shlibcall
92 puts $file shlib_shlibcalled
93 puts $file shlib_checkfunptr1
94 puts $file shlib_getfunptr1
95 puts $file shlib_check
96 close $file
97 }
98
99 if [istarget arm*-*-linux*] {
100 # On ARM section anchors can change the symbol pre-emptability for
101 # non-PIC shared libraries, causing these tests to fail. Turn section
102 # anchors off.
103 set SHCFLAG "-fno-section-anchors"
104
105 # On targets that have MOVW the compiler will emit relocations which
106 # the linker doesn't support when compiling -shared without -fpic. The
107 # test to find out whether we want to XFAIL the non-PIC tests requires
108 # a compile - so we pre-calculate it here. We also note that this can
109 # only affect arm*-*-*eabi* targets as the old ABI doesn't support v7.
110 if [istarget arm*-*-*eabi*] {
111 set file [open $tmpdir/movw-detect.c w]
112 puts $file "void foo(void) { __asm (\"movw r0, #0\"); }"
113 close $file
114 if [run_host_cmd_yesno "$CC" "$CFLAGS -c $tmpdir/movw-detect.c -o $tmpdir/movw-detect.o"] {
115 set shared_needs_pic "yes"
116 }
117 }
118 }
119
120 set support_protected "no"
121
122 if { [istarget *-*-linux*]
123 || [istarget *-*-nacl*]
124 || [istarget *-*-gnu*] } {
125 if [ld_compile "$CC -g $CFLAGS -DPROTECTED_CHECK" $srcdir/$subdir/main.c $tmpdir/main.o] {
126 if [ld_link $CC $tmpdir/main "$tmpdir/main.o"] {
127 catch "exec $tmpdir/main" support_protected
128 }
129 }
130 }
131
132 # The test procedure.
133 proc visibility_test { visibility progname testname main sh1 sh2 dat args } {
134 global CC
135 global srcdir
136 global subdir
137 global exec_output
138 global link_output
139 global host_triplet
140 global tmpdir
141
142 if [llength $args] { set shldflags [lindex $args 0] } else { set shldflags "" }
143
144 # Build the shared library.
145 # On AIX, we need to use an export file.
146 set shared -shared
147 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
148 set shared "-bM:SRE -bE:$tmpdir/xcoff.exp"
149 }
150 if {![ld_link $CC $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} {
151 if { [ string match $visibility "hidden_undef" ]
152 && [regexp "undefined reference to \`\.?visibility\'" $link_output]
153 && [regexp "undefined reference to \`visibility_var\'" $link_output] } {
154 pass "$testname"
155 } else { if { [ string match $visibility "protected_undef" ]
156 && [regexp "undefined reference to \`\.?visibility\'" $link_output]
157 && [regexp "undefined reference to \`visibility_var\'" $link_output] } {
158 pass "$testname"
159 } else {
160 fail "$testname"
161 }}
162 return
163 }
164
165 # Link against the shared library. Use -rpath so that the
166 # dynamic linker can locate the shared library at runtime.
167 # On AIX, we must include /lib in -rpath, as otherwise the loader
168 # can not find -lc.
169 set rpath $tmpdir
170 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
171 set rpath /lib:$tmpdir
172 }
173 if ![ld_link $CC $tmpdir/$progname "-Wl,-rpath,$rpath $tmpdir/$main $tmpdir/$progname.so"] {
174 if { [ string match $visibility "hidden" ]
175 && [regexp "undefined reference to \`\.?visibility\'" $link_output]
176 && [regexp "undefined reference to \`visibility_var\'" $link_output] } {
177 pass "$testname"
178 } else { if { [ string match $visibility "hidden_undef_def" ]
179 && [regexp "undefined reference to \`\.?visibility\'" $link_output]
180 && [regexp "undefined reference to \`visibility_def\'" $link_output]
181 && [regexp "undefined reference to \`\.?visibility_func\'" $link_output]
182 && [regexp "undefined reference to \`visibility_var\'" $link_output] } {
183 pass "$testname"
184 } else {
185 fail "$testname"
186 }}
187 return
188 }
189
190 if { [ string match $visibility "hidden" ]
191 || [ string match $visibility "hidden_undef" ]
192 || [ string match $visibility "protected_undef" ] } {
193 fail "$testname"
194 }
195
196 if ![isnative] {
197 unsupported "$testname"
198 return
199 }
200
201 # Run the resulting program
202 send_log "$tmpdir/$progname >$tmpdir/$progname.out\n"
203 verbose "$tmpdir/$progname >$tmpdir/$progname.out"
204 catch "exec $tmpdir/$progname >$tmpdir/$progname.out" exec_output
205 if ![string match "" $exec_output] then {
206 send_log "$exec_output\n"
207 verbose "$exec_output"
208 fail "$testname"
209 return
210 }
211
212 send_log "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat\n"
213 verbose "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat"
214 catch "exec diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat" exec_output
215 set exec_output [prune_warnings $exec_output]
216
217 if {![string match "" $exec_output]} then {
218 send_log "$exec_output\n"
219 verbose "$exec_output"
220 fail "$testname"
221 return
222 }
223
224 pass "$testname"
225 }
226
227 proc visibility_run {visibility} {
228 global CC
229 global CFLAGS
230 global SHCFLAG
231 global srcdir
232 global subdir
233 global tmpdir
234 global picflag
235 global target_triplet
236 global support_protected
237 global shared_needs_pic
238 global PLT_CFLAGS
239 global NOPIE_CFLAGS
240 global COMPRESS_LDFLAG
241
242 if [ string match $visibility "hidden" ] {
243 set VSBCFLAG "-DHIDDEN_TEST"
244 } else { if [ string match $visibility "hidden_normal" ] {
245 set VSBCFLAG "-DHIDDEN_NORMAL_TEST"
246 } else { if [ string match $visibility "hidden_undef" ] {
247 set VSBCFLAG "-DHIDDEN_UNDEF_TEST"
248 } else { if [ string match $visibility "hidden_undef_def" ] {
249 set VSBCFLAG "-DHIDDEN_UNDEF_TEST -DDSO_DEFINE_TEST"
250 } else { if [ string match $visibility "hidden_weak" ] {
251 set VSBCFLAG "-DHIDDEN_WEAK_TEST"
252 } else { if [ string match $visibility "protected" ] {
253 set VSBCFLAG "-DPROTECTED_TEST"
254 } else { if [ string match $visibility "protected_undef" ] {
255 set VSBCFLAG "-DPROTECTED_UNDEF_TEST"
256 } else { if [ string match $visibility "protected_undef_def" ] {
257 set VSBCFLAG "-DPROTECTED_UNDEF_TEST -DDSO_DEFINE_TEST"
258 } else { if [ string match $visibility "protected_weak" ] {
259 set VSBCFLAG "-DPROTECTED_WEAK_TEST"
260 } else {
261 set VSBCFLAG ""
262 }}}}}}}}}
263
264 # Ensure we always start with a clean slate, for the "file exists"
265 # tests below.
266 remote_file host delete $tmpdir/sh1p.o $tmpdir/sh2p.o $tmpdir/sh1np.o $tmpdir/sh2np.o
267
268 if { [istarget powerpc*-*-linux*] \
269 || ( [istarget mips*-*-linux*] && [at_least_gcc_version 4 3] )} {
270 # Testing non-PIC libraries is a waste of effort on any target.
271 # If you don't pass -fpic or -fPIC to gcc, gcc will assume quite
272 # reasonably that you are not compiling for a shared library.
273 # It can then make optimisations that result in shared library
274 # functions and variables not being overridable. Newer versions
275 # of gcc are more likely to do this.
276 } else {
277 # Compile the main program. Make sure that PLT is used since PLT
278 # is expected.
279 if ![ld_compile "$CC -g $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
280 unresolved "visibility ($visibility) (non PIC)"
281 unresolved "visibility ($visibility)"
282 } else {
283 # The shared library is composed of two files. First compile them
284 # without using -fpic. That should work on an ELF system,
285 # although it will be less efficient because the dynamic linker
286 # will need to do more relocation work. However, note that not
287 # using -fpic will cause some of the tests to return different
288 # results. Make sure that PLT is used since PLT is expected.
289 if { ![ld_compile "$CC -g $NOPIE_CFLAGS $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
290 || ![ld_compile "$CC -g $NOPIE_CFLAGS $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } {
291 unresolved "visibility ($visibility) (non PIC)"
292 } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
293 visibility_test $visibility vnp "visibility ($visibility) (non PIC)" mainnp.o sh1np.o sh2np.o xcoff
294 } else {
295 # SunOS non PIC shared libraries don't permit some cases of
296 # overriding.
297 if { [ string match $visibility "protected" ]
298 || [ string match $visibility "protected_undef_def" ] } {
299 if [ string match $support_protected "no" ] {
300 setup_xfail $target_triplet
301 }
302 } else {
303 setup_xfail "*-*-sunos4*"
304 }
305
306 # Non-pic code uses name binding rules for applications to
307 # reference variables by gp-relative relocs, which can't be
308 # used with overridable symbols.
309 if { ![ string match $visibility "hidden_undef" ]
310 && ![ string match $visibility "protected_undef" ] } {
311 setup_xfail "ia64-*-linux*"
312 setup_xfail "alpha*-*-linux*"
313 }
314 if { ![ string match $visibility "hidden" ]
315 && ![ string match $visibility "hidden_undef" ]
316 && ![ string match $visibility "hidden_undef_def" ]
317 && ![ string match $visibility "protected_undef" ] } {
318 setup_xfail "s390x-*-linux*"
319 if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } {
320 setup_xfail "sparc*-*-linux*"
321 }
322 }
323 if { [is_elf64 $tmpdir/mainnp.o] } {
324 setup_xfail "x86_64-*-linux*"
325 }
326 setup_xfail "x86_64-*-linux-gnux32"
327 if { ![istarget hppa*64*-*-linux*] } {
328 setup_xfail "hppa*-*-linux*"
329 }
330 if [ string match $shared_needs_pic "yes" ] {
331 setup_xfail "arm*-*-linux*"
332 }
333
334 visibility_test $visibility vnp "visibility ($visibility) (non PIC)" mainnp.o sh1np.o sh2np.o elfvsb
335
336 # Test ELF shared library relocations with a non-zero load
337 # address for the library. Near as I can tell, the R_*_RELATIVE
338 # relocations for various targets are broken in the case where
339 # the load address is not zero (which is the default).
340 if { [ string match $visibility "protected" ]
341 || [ string match $visibility "protected_undef_def" ] } {
342 if [ string match $support_protected "no" ] {
343 setup_xfail $target_triplet
344 }
345 } else {
346 setup_xfail "*-*-sunos4*"
347 setup_xfail "*-*-linux*libc1"
348 }
349 if { [ string match $visibility "hidden_normal" ]
350 || [ string match $visibility "hidden_weak" ]
351 || [ string match $visibility "protected" ]
352 || [ string match $visibility "protected_undef_def" ]
353 || [ string match $visibility "protected_weak" ]
354 || [ string match $visibility "normal" ] } {
355 setup_xfail "powerpc-*-linux*"
356 setup_xfail "s390x-*-linux*"
357 if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } {
358 setup_xfail "sparc*-*-linux*"
359 }
360 }
361 if { ![ string match $visibility "hidden_undef" ]
362 && ![ string match $visibility "protected_undef" ] } {
363 setup_xfail "ia64-*-linux*"
364 setup_xfail "alpha*-*-linux*"
365 setup_xfail "mips*-*-linux*"
366 }
367 if { [is_elf64 $tmpdir/mainnp.o] } {
368 setup_xfail "x86_64-*-linux*"
369 }
370 setup_xfail "x86_64-*-linux-gnux32"
371 if { ![istarget hppa*64*-*-linux*] } {
372 setup_xfail "hppa*-*-linux*"
373 }
374 if [ string match $shared_needs_pic "yes" ] {
375 setup_xfail "arm*-*-linux*"
376 }
377
378 visibility_test $visibility vnp "visibility ($visibility) (non PIC, load offset)" \
379 mainnp.o sh1np.o sh2np.o elfvsb \
380 "-Wl,-T,$srcdir/$subdir/elf-offset.ld,--hash-style=sysv"
381 } }
382
383 # Now compile the code using -fpic.
384
385 if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o]
386 || ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } {
387 unresolved "visibility ($visibility)"
388 } else {
389 if { [ string match $visibility "protected" ]
390 || [ string match $visibility "protected_undef_def" ] } {
391 if [ string match $support_protected "no" ] {
392 setup_xfail $target_triplet
393 }
394 }
395 # SunOS can not compare function pointers correctly
396 if [istarget "*-*-sunos4*"] {
397 visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o sun4
398 } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
399 visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o xcoff
400 } else {
401 visibility_test $visibility vp "visibility ($visibility)" mainnp.o sh1p.o sh2p.o elfvsb $COMPRESS_LDFLAG
402 } }
403 }
404 }}
405
406 if { [istarget powerpc*-*-linux*] } {
407 # Don't bother.
408 } else {
409 # Now do the same tests again, but this time compile main.c PIC.
410 if ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/main.c $tmpdir/mainp.o] {
411 unresolved "visibility ($visibility) (PIC main, non PIC so)"
412 unresolved "visibility ($visibility) (PIC main)"
413 } else {
414 if { [ remote_file host exists $tmpdir/sh1np.o ]
415 && [ remote_file host exists $tmpdir/sh2np.o ] } {
416 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
417 visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o xcoff
418 } else {
419 # SunOS non PIC shared libraries don't permit some cases of
420 # overriding.
421 if { [ string match $visibility "protected" ]
422 || [ string match $visibility "protected_undef_def" ] } {
423 if [ string match $support_protected "no" ] {
424 setup_xfail $target_triplet
425 }
426 } else {
427 setup_xfail "*-*-sunos4*"
428 }
429 if { ![ string match $visibility "hidden_undef" ]
430 && ![ string match $visibility "protected_undef" ] } {
431 setup_xfail "ia64-*-linux*"
432 setup_xfail "alpha*-*-linux*"
433 }
434 if { ![ string match $visibility "hidden" ]
435 && ![ string match $visibility "hidden_undef" ]
436 && ![ string match $visibility "hidden_undef_def" ]
437 && ![ string match $visibility "protected_undef" ] } {
438 setup_xfail "s390x-*-linux*"
439 if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainp.o] } {
440 setup_xfail "sparc*-*-linux*"
441 }
442 }
443 if { [is_elf64 $tmpdir/mainp.o] } {
444 setup_xfail "x86_64-*-linux*"
445 }
446 setup_xfail "x86_64-*-linux-gnux32"
447 if { ![istarget hppa*64*-*-linux*] } {
448 setup_xfail "hppa*-*-linux*"
449 }
450 if [ string match $shared_needs_pic "yes" ] {
451 setup_xfail "arm*-*-linux*"
452 }
453
454 visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o elfvsb
455 }
456 } else {
457 unresolved "visibility (PIC main, non PIC so)"
458 }
459
460 if { [ remote_file host exists $tmpdir/sh1p.o ]
461 && [ remote_file host exists $tmpdir/sh2p.o ] } {
462 if { [ string match $visibility "protected" ]
463 || [ string match $visibility "protected_undef_def" ] } {
464 if [ string match $support_protected "no" ] {
465 setup_xfail $target_triplet
466 }
467 }
468 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
469 visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o xcoff
470 } else {
471 visibility_test $visibility vmpp "visibility ($visibility) (PIC main)" mainp.o sh1p.o sh2p.o elfvsb
472 }
473 } else {
474 unresolved "visibility ($visibility) (PIC main)"
475 }
476 }}
477 }
478
479 # Old version of GCC for MIPS default to enabling -fpic
480 # and get confused if it is used on the command line.
481 if { [istarget mips*-*-*] && ! [at_least_gcc_version 4 3] } then {
482 set picflag ""
483 } else {
484 # Unfortunately, the gcc argument is -fpic and the cc argument is
485 # -KPIC. We have to try both.
486 set picflag "-fpic"
487 send_log "$CC $picflag\n"
488 verbose "$CC $picflag"
489 catch "exec $CC $picflag" exec_output
490 send_log "$exec_output\n"
491 verbose "--" "$exec_output"
492 if { [string match "*illegal option*" $exec_output] \
493 || [string match "*option ignored*" $exec_output] \
494 || [string match "*unrecognized option*" $exec_output] \
495 || [string match "*passed to ld*" $exec_output] } {
496 if [istarget *-*-sunos4*] {
497 set picflag "-pic"
498 } else {
499 set picflag "-KPIC"
500 }
501 }
502 }
503 verbose "Using $picflag to compile PIC code"
504
505 visibility_run hidden
506 visibility_run hidden_normal
507 visibility_run hidden_undef
508 visibility_run hidden_undef_def
509 visibility_run hidden_weak
510 visibility_run protected
511 visibility_run protected_undef
512 visibility_run protected_undef_def
513 visibility_run protected_weak
514 visibility_run normal
515
516 if { ![ld_compile "$CC -g $CFLAGS" $srcdir/$subdir/common.c tmpdir/common.o] } {
517 unresolved "common hidden symbol"
518 } else {
519 if ![ld_link $ld tmpdir/common "tmpdir/common.o"] {
520 fail "common hidden symbol"
521 } else {
522 pass "common hidden symbol"
523 }
524 }
525
526 if { ![ld_compile "$CC -g $CFLAGS" $srcdir/$subdir/test.c tmpdir/test.o] } {
527 unresolved "weak hidden symbol"
528 } else {
529 if { ![ld_compile "$CC -g $CFLAGS -DSHARED $picflag" $srcdir/$subdir/sh3.c tmpdir/sh3.o] } {
530 unresolved "weak hidden symbol"
531 } else {
532 if ![ld_link $ld tmpdir/sh3.so "-shared tmpdir/sh3.o"] {
533 fail "weak hidden symbol"
534 } else {
535 if ![ld_link $ld tmpdir/weak "tmpdir/test.o tmpdir/sh3.o"] {
536 fail "weak hidden symbol DSO last"
537 } else {
538 pass "weak hidden symbol DSO last"
539 }
540 if ![ld_link $ld tmpdir/weak "tmpdir/sh3.so tmpdir/test.o"] {
541 fail "weak hidden symbol DSO first"
542 } else {
543 pass "weak hidden symbol DSO first"
544 }
545 }
546 }
547 }
548
549 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
550 # Remove the temporary directory.
551 catch "exec rm -rf $tmpdir" exec_status
552 }