]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/testsuite/ld-pe/pe.exp
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-pe / pe.exp
CommitLineData
c1711530 1# Expect script for simple PE tests that require the just-built binutils only.
250d07de 2# Copyright (C) 2004-2021 Free Software Foundation, Inc.
d127ecce
AM
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
22# These tests can only be run on PE/COFF platforms.
23if {![is_pecoff_format]} {
24 return
25}
26
27# This test can only be run on PE/COFF platforms that support .secrel32.
28if {[istarget i*86-*-cygwin*]
29 || [istarget i*86-*-pe]
30 || [istarget i*86-*-mingw*]
31 || [istarget x86_64-*-mingw*]
32 || [istarget arm-wince-pe] } {
33
34 if {[istarget x86_64-*-mingw*] } {
35 set pe_tests {
514b4e19 36 {".secrel32" "--disable-reloc-section" "" "" {secrel1.s secrel2.s}
177b81d6 37 {{objdump -s secrel_64.d}} "secrel.x"}
897aea50 38 {"Empty export table" "" "" "" "exports.s"
177b81d6 39 {{objdump -p exports64.d}} "exports.dll"}
897aea50 40 {"TLS directory entry" "" "" "" "tlssec.s"
c91a930c 41 {{objdump -p tlssec64.d}} "tlssec.dll"}
d127ecce
AM
42 }
43 } elseif {[istarget i*86-*-cygwin*] } {
44 set pe_tests {
514b4e19 45 {".secrel32" "--disable-auto-import --disable-reloc-section" "" "" {secrel1.s secrel2.s}
d127ecce 46 {{objdump -s secrel.d}} "secrel.x"}
897aea50 47 {"Empty export table" "" "" "" "exports.s"
177b81d6 48 {{objdump -p exports.d}} "exports.dll"}
897aea50 49 {"TLS directory entry" "" "" "" "tlssec.s"
c91a930c 50 {{objdump -p tlssec32.d}} "tlssec.dll"}
d127ecce
AM
51 }
52 } else {
53 set pe_tests {
514b4e19 54 {".secrel32" "--disable-reloc-section" "" "" {secrel1.s secrel2.s}
d127ecce 55 {{objdump -s secrel.d}} "secrel.x"}
897aea50 56 {"Empty export table" "" "" "" "exports.s"
177b81d6 57 {{objdump -p exports.d}} "exports.dll"}
897aea50 58 {"TLS directory entry" "" "" "" "tlssec.s"
c91a930c 59 {{objdump -p tlssec32.d}} "tlssec.dll"}
d127ecce
AM
60 }
61 }
62
63 run_ld_link_tests $pe_tests
64}
65
66run_dump_test "image_size"
67run_dump_test "export_dynamic_warning"
68
69run_dump_test "longsecn"
70run_dump_test "longsecn-1"
71run_dump_test "longsecn-2"
72run_dump_test "longsecn-3"
73run_dump_test "longsecn-4"
74run_dump_test "longsecn-5"
75
76run_dump_test "orphan"
c51297b4 77run_dump_test "orphan_nu"
05056a8d 78
1fd6d111
TG
79run_dump_test "weakdef-1"
80
41f46ed9
SKS
81run_dump_test "pr19803"
82set pr19803_dll {
83 { "PR 19803: not exporting swept symbols"
84 "-shared --out-implib dx.dll --gc-sections"
85 "" "" {pr19803.s}
86 {{objdump "--syms dx.dll" pr19803.e}}
87 "a.exe"}
88}
89# This test is *supposed* to fail. If the symbol defined in pr19803.e is
90# found then it was not stripped from the export dll, despite the fact that
91# it (should have been) garbage collected from the executable.
92setup_xfail *-*-*
93run_ld_link_tests $pr19803_dll
94
72b016b4
NC
95if {[istarget x86_64-*-mingw*] } {
96 run_dump_test "cfi"
97} elseif {[istarget i*86-*-cygwin*] || [istarget i*86-*-mingw*] } {
98 run_dump_test "cfi32"
99}
100
05056a8d 101set foreign_sym_test {
897aea50 102 {"non-C aligned common" "" "" "" {non-c-lang-syms.s}
05056a8d
DK
103 {{nm -C non-c-lang-syms.d}} "non-c-lang-syms.x"}
104}
105
1b857aee
NC
106# MCore rearranges symbol order.
107setup_xfail mcore-*-pe
05056a8d 108run_ld_link_tests $foreign_sym_test