1# Expect script for VAX ELF linker tests 2# Copyright (C) 2012-2016 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 22if { ![istarget vax-*-*] || ![is_elf_format] } { 23 return 24} 25 26run_ld_link_tests [list \ 27 [list "PLT test (shared library)" \ 28 "-shared -T plt-local-lib.ld" "" \ 29 "-k" \ 30 { plt-local-lib.s } \ 31 { { objdump -d plt-local-lib.dd } } \ 32 "plt-local-lib.so"] \ 33 [list "PLT test (object 1)" \ 34 "-r" "" \ 35 "-k" \ 36 { plt-local-hidden-pic.s } \ 37 {} \ 38 "plt-local-hidden-pic-r.o"] \ 39 [list "PLT test (object 2)" \ 40 "-r" "" \ 41 "-k" \ 42 { plt-local-rehidden-pic.s } \ 43 {} \ 44 "plt-local-rehidden-pic-r.o"] \ 45 [list "PLT test (executable)" \ 46 "-T plt-local.ld tmpdir/plt-local-hidden-pic-r.o tmpdir/plt-local-rehidden-pic-r.o tmpdir/plt-local-lib.so" "" \ 47 "" \ 48 { plt-local.s } \ 49 { { objdump -d plt-local.dd } } \ 50 "plt-local"]] 51 52# Global offset table tests. Make sure hidden symbols do not get GOT 53# assignments. 54run_ld_link_tests [list \ 55 [list "GOT test (auxiliary shared library)" \ 56 "-shared" "" \ 57 "-k" \ 58 { got-local-aux.s } \ 59 {} \ 60 "got-local-aux.so"] \ 61 [list "GOT test (object 1)" \ 62 "-r" "" \ 63 "-k" \ 64 { got-local-ref.s } \ 65 {} \ 66 "got-local-ref-r.o"] \ 67 [list "GOT test (object 2)" \ 68 "-r" "" \ 69 "-k" \ 70 { got-local-def.s } \ 71 {} \ 72 "got-local-def-r.o"] \ 73 [list "GOT test (executable)" \ 74 "-e 0 tmpdir/got-local-aux.so tmpdir/got-local-ref-r.o tmpdir/got-local-def-r.o" "" \ 75 "" \ 76 {} \ 77 { { readelf "-x .got" got-local-exe.xd } } \ 78 "got-local-exe"] \ 79 [list "GOT test (shared library)" \ 80 "-shared tmpdir/got-local-aux.so tmpdir/got-local-ref-r.o tmpdir/got-local-def-r.o" "" \ 81 "" \ 82 {} \ 83 { { readelf "-x .got" got-local-lib.xd } } \ 84 "got-local-lib.so"]] 85 86# Export class relocation tests. 87run_ld_link_tests [list \ 88 [list \ 89 "VAX export class call relocation test" \ 90 "-shared -Ttext 0x12340000 -T export-class.ld" "" \ 91 "-k" \ 92 [list export-class-call.s export-class-def.s] \ 93 [list \ 94 [list objdump -d export-class-call.dd] \ 95 [list readelf -r export-class-call.rd] \ 96 [list readelf "-x .got" export-class-call.xd]] \ 97 "export-class-call.so"] \ 98 [list \ 99 "VAX export class data relocation test" \ 100 "-shared -Ttext 0x12340000 -T export-class.ld" "" \ 101 "-k" \ 102 [list export-class-data.s export-class-def.s] \ 103 [list \ 104 [list objdump -d export-class-data.dd] \ 105 [list readelf -r export-class-data.rd] \ 106 [list readelf "-x .got" export-class-data.xd]] \ 107 "export-class-data.so"]] 108