1 # Expect script for ld --just-symbols tests.
2 # Copyright (C) 2020-2021 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,
22 # SH/PE targets complain about zero VMA.
23 # i386-msdos doesn't have .data
24 # tic30-coff has a weird 32-bit reloc that divides sym value by four
25 # alpha-dec-vms wants a bunch of libs to link
26 if { [istarget sh-*-pe]
27 || [istarget *-*-msdos]
28 || [istarget *c30-*-*]
29 || [istarget alpha-*-vms] } {
33 set saved_LDFLAGS "$LDFLAGS"
34 if { [is_pecoff_format] } then {
35 # Avoid auto image-basing.
36 set LDFLAGS "$LDFLAGS --image-base 0"
37 } elseif { [is_xcoff_format] } then {
38 set LDFLAGS "$LDFLAGS -bnogc"
41 run_ld_link_tests [list \
42 [list "Object for --just-symbols test" \
43 "$LDFLAGS -r -T just-symbols.ld" "" \
48 [list "Executable for --just-symbols test" \
49 "$LDFLAGS -e 0 -T just-symbols.ld" "" \
54 [list "Object with --just-symbols test" \
55 "$LDFLAGS -e 0 -T just-symbols.ld --just-symbols=tmpdir/just-symbols-0.o" "" \
58 {{objdump {-s -j .data} just-symbols-1.dd}} \
59 "just-symbols-1obj"] \
60 [list "Executable with --just-symbols test" \
61 "$LDFLAGS -e 0 -T just-symbols.ld --just-symbols=tmpdir/just-symbols-0" "" \
64 {{objdump {-s -j .data} just-symbols-1.dd}} \
65 "just-symbols-1exe"] \
68 set LDFLAGS "$saved_LDFLAGS"