1 # Expect script
for frame section tests
2 # Copyright
2004, 2005, 2007 Free Software Foundation
, Inc.
4 # This file is part of the GNU Binutils.
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.
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.
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
,
21 # Written by H.J. Lu
(hongjiu.lu@intel.com
)
24 # Make sure that
ld correctly handles frame sections in ELF.
26 # This test can only be run
on ELF platforms.
31 # No shared lib support
on this target.
32 if { [istarget
"mcore-*-*"] } {
36 # Too small MAXPAGESIZE
on this target.
37 if { [istarget
"sh*-*-elf*"] } {
41 # ??? These targets have their own .tbss section
, with different meaning
42 # to the usual ELF .tbss.
43 if { [istarget
"hppa64-*-*"] || [istarget "v850-*-*"] } {
49 # This target requires extra as options when building code
for shared
51 if { [istarget
"tic6x-*-*"] } {
52 set as_opt
"-mpic -mpid=near"
55 set test1
"read-only .eh_frame section"
56 set test2
"read-only .gcc_except_table section"
61 if { ![ld_assemble_flags $as $as_opt $srcdir
/$subdir
/tbss.s tmpdir
/tbss.o
]
62 ||
![ld_assemble_flags $as $as_opt $srcdir
/$subdir
/frame.s tmpdir
/frame.o
] } {
67 if { [ld_simple_link $
ld tmpdir
/frame.so
"--shared tmpdir/frame.o tmpdir/tbss.o"] } {
70 if [string match
"*shared not supported*" $link_output] {
71 unsupported
"-shared is not supported by this target"
77 if ![ld_assemble_flags $as $as_opt $srcdir
/$subdir
/table.s tmpdir
/table.o
] {
82 if { [ld_simple_link $
ld tmpdir
/table.so
"--shared tmpdir/table.o tmpdir/tbss.o"] } {
85 if [string match
"*shared not supported*" $link_output] {
86 unsupported
"-shared is not supported by this target"