Update sources to GPLv3
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elf / frame.exp
CommitLineData
f96b4a7b
NC
1# Expect script for frame section tests
2# Copyright 2004, 2007 Free Software Foundation, Inc.
117a3ac8 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
117a3ac8 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
117a3ac8 9# (at your option) any later version.
f96b4a7b 10#
117a3ac8
L
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.
f96b4a7b 15#
117a3ac8
L
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.
117a3ac8
L
20#
21# Written by H.J. Lu (hongjiu.lu@intel.com)
22#
23
24# Make sure that ld correctly handles frame sections in ELF.
25
26# This test can only be run on ELF platforms.
27if ![is_elf_format] {
28 return
29}
30
3874ed78
AM
31# No shared lib support on this target.
32if { [istarget "mcore-*-*"] } {
33 return
34}
35
f6a8ae81
KK
36# Too small MAXPAGESIZE on this target.
37if { [istarget "sh*-*-elf*"] } {
38 return
39}
40
48733062
AM
41# ??? These targets have their own .tbss section, with different meaning
42# to the usual ELF .tbss.
43if { [istarget "hppa64-*-*"] || [istarget "v850-*-*"] } {
44 return
45}
46
117a3ac8
L
47set test1 "read-only .eh_frame section"
48set test2 "read-only .gcc_except_table section"
49
50global as
51global ld
52
53if { ![ld_assemble $as $srcdir/$subdir/tbss.s tmpdir/tbss.o ]
54 || ![ld_assemble $as $srcdir/$subdir/frame.s tmpdir/frame.o] } {
55 unresolved "$test1"
56 return
57}
58
59if { [ld_simple_link $ld tmpdir/frame.so "--shared tmpdir/frame.o tmpdir/tbss.o"] } {
60 pass "$test1"
61} else {
e6f12cf6
NC
62 if [string match "*shared not supported*" $link_output] {
63 unsupported "-shared is not supported by this target"
64 } else {
65 fail "$test1"
66 }
117a3ac8
L
67}
68
69if ![ld_assemble $as $srcdir/$subdir/table.s tmpdir/table.o ] {
70 unresolved "$test2"
71 return
72}
73
74if { [ld_simple_link $ld tmpdir/table.so "--shared tmpdir/table.o tmpdir/tbss.o"] } {
75 pass "$test2"
76} else {
e6f12cf6
NC
77 if [string match "*shared not supported*" $link_output] {
78 unsupported "-shared is not supported by this target"
79 } else {
80 fail "$test2"
81 }
117a3ac8 82}
This page took 0.140978 seconds and 4 git commands to generate.