Commit | Line | Data |
---|---|---|
117a3ac8 L |
1 | # Expect script for common symbol tests |
2 | # Copyright 2004 Free Software Foundation, Inc. | |
3 | # | |
4 | # This file is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 2 of the License, or | |
7 | # (at your option) any later version. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software | |
75be928b | 16 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. |
117a3ac8 L |
17 | # |
18 | # Written by H.J. Lu (hongjiu.lu@intel.com) | |
19 | # | |
20 | ||
21 | # Make sure that ld correctly handles frame sections in ELF. | |
22 | ||
23 | # This test can only be run on ELF platforms. | |
24 | if ![is_elf_format] { | |
25 | return | |
26 | } | |
27 | ||
3874ed78 AM |
28 | # No shared lib support on this target. |
29 | if { [istarget "mcore-*-*"] } { | |
30 | return | |
31 | } | |
32 | ||
f6a8ae81 KK |
33 | # Too small MAXPAGESIZE on this target. |
34 | if { [istarget "sh*-*-elf*"] } { | |
35 | return | |
36 | } | |
37 | ||
48733062 AM |
38 | # ??? These targets have their own .tbss section, with different meaning |
39 | # to the usual ELF .tbss. | |
40 | if { [istarget "hppa64-*-*"] || [istarget "v850-*-*"] } { | |
41 | return | |
42 | } | |
43 | ||
117a3ac8 L |
44 | set test1 "read-only .eh_frame section" |
45 | set test2 "read-only .gcc_except_table section" | |
46 | ||
47 | global as | |
48 | global ld | |
49 | ||
50 | if { ![ld_assemble $as $srcdir/$subdir/tbss.s tmpdir/tbss.o ] | |
51 | || ![ld_assemble $as $srcdir/$subdir/frame.s tmpdir/frame.o] } { | |
52 | unresolved "$test1" | |
53 | return | |
54 | } | |
55 | ||
56 | if { [ld_simple_link $ld tmpdir/frame.so "--shared tmpdir/frame.o tmpdir/tbss.o"] } { | |
57 | pass "$test1" | |
58 | } else { | |
e6f12cf6 NC |
59 | if [string match "*shared not supported*" $link_output] { |
60 | unsupported "-shared is not supported by this target" | |
61 | } else { | |
62 | fail "$test1" | |
63 | } | |
117a3ac8 L |
64 | } |
65 | ||
66 | if ![ld_assemble $as $srcdir/$subdir/table.s tmpdir/table.o ] { | |
67 | unresolved "$test2" | |
68 | return | |
69 | } | |
70 | ||
71 | if { [ld_simple_link $ld tmpdir/table.so "--shared tmpdir/table.o tmpdir/tbss.o"] } { | |
72 | pass "$test2" | |
73 | } else { | |
e6f12cf6 NC |
74 | if [string match "*shared not supported*" $link_output] { |
75 | unsupported "-shared is not supported by this target" | |
76 | } else { | |
77 | fail "$test2" | |
78 | } | |
117a3ac8 | 79 | } |