Commit | Line | Data |
---|---|---|
876f4090 NS |
1 | # Test ALIGN in a linker script. |
2 | # By Nathan Sidwell, CodeSourcery LLC | |
f96b4a7b | 3 | # Copyright 2004, 2005, 2006, 2007 |
876f4090 NS |
4 | # Free Software Foundation, Inc. |
5 | # | |
f96b4a7b NC |
6 | # This file is part of the GNU Binutils. |
7 | # | |
8 | # This program is free software; you can redistribute it and/or modify | |
876f4090 | 9 | # it under the terms of the GNU General Public License as published by |
f96b4a7b | 10 | # the Free Software Foundation; either version 3 of the License, or |
876f4090 | 11 | # (at your option) any later version. |
f96b4a7b | 12 | # |
876f4090 NS |
13 | # This program is distributed in the hope that it will be useful, |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | # GNU General Public License for more details. | |
f96b4a7b | 17 | # |
876f4090 NS |
18 | # You should have received a copy of the GNU General Public License |
19 | # along with this program; if not, write to the Free Software | |
f96b4a7b NC |
20 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
21 | # MA 02110-1301, USA. | |
876f4090 | 22 | |
76cb62b0 AM |
23 | if [istarget "rs6000-*-aix*"] { |
24 | # Target maps .text and .data to other sections. | |
25 | return | |
26 | } | |
27 | ||
fbbb9ac5 | 28 | set testname "align1" |
876f4090 NS |
29 | |
30 | if ![ld_assemble $as $srcdir/$subdir/align.s tmpdir/align.o] { | |
31 | unresolved $testname | |
32 | return | |
33 | } | |
34 | ||
99ad8390 | 35 | # Doesn't work on PECOFF, appears to be a genuine bug. |
42037fe5 | 36 | # mingw on x86_64 targets need to set the image base to 0 to avoid auto image-basing. |
99ad8390 NC |
37 | global LDFLAGS |
38 | set saved_LDFLAGS "$LDFLAGS" | |
42037fe5 | 39 | if [istarget "x86_64-*-mingw*"] then { |
99ad8390 NC |
40 | set LDFLAGS "$LDFLAGS --image-base 0" |
41 | } else { | |
42 | if [is_pecoff_format] { | |
a359509e ZW |
43 | global target_triplet |
44 | setup_xfail $target_triplet | |
99ad8390 | 45 | } |
a359509e ZW |
46 | } |
47 | ||
99ad8390 | 48 | if ![ld_simple_link $ld tmpdir/align "$LDFLAGS -T $srcdir/$subdir/align.t tmpdir/align.o"] { |
876f4090 NS |
49 | fail $testname |
50 | } else { | |
51 | pass $testname | |
52 | } | |
fbbb9ac5 | 53 | |
25629536 | 54 | if ![is_aout_format] { |
3c9b82ba NC |
55 | # The z80-coff port defaults to a "binary" like output |
56 | # file format which does not include a data section. | |
57 | setup_xfail "z80-*-coff" | |
25629536 | 58 | run_dump_test align2a |
3c9b82ba | 59 | setup_xfail "z80-*-coff" |
25629536 AM |
60 | run_dump_test align2b |
61 | } | |
fbbb9ac5 | 62 | run_dump_test align2c |
99ad8390 | 63 | set LDFLAGS "$saved_LDFLAGS" |