1 # Expect script for the PROVIDE_HIDDEN linker script command.
3 # Copyright (C) 2013-2015 Free Software Foundation, Inc.
5 # This file is part of the GNU Binutils.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
24 # Written by Maciej W. Rozycki <macro@codesourcery.com>
27 # Export classes only make sense for ELF shared-library targets.
28 if { ![is_elf_format] || ![check_shared_lib_support] } {
32 # This target requires extra GAS options when building code for shared
35 if [istarget "tic6x-*-*"] {
36 append AFLAGS_PIC " -mpic -mpid=near"
39 set testname "PROVIDE_HIDDEN test"
41 run_ld_link_tests [list \
43 "$testname (auxiliary shared object)" \
44 "-shared -T provide-hidden-s.ld" "" \
46 [list provide-hidden-1.s ] \
47 [list "readelf -s provide-hidden-s.nd"] \
48 "provide-hidden-s.so"]]
50 run_ld_link_tests [list \
53 "-T provide-hidden-1.ld" "" \
55 [list provide-hidden-1.s] \
57 [list readelf -s provide-hidden-def.nd] \
58 [list readelf -s provide-hidden-dyn.nd]] \
62 "-T provide-hidden-1.ld" "" \
64 [list provide-hidden-2.s] \
66 [list readelf -s provide-hidden-def.nd] \
67 [list readelf -s provide-hidden-dyn.nd]] \
71 "-T provide-hidden-1.ld" "" \
73 [list provide-hidden-3.s] \
75 [list readelf -s provide-hidden-sec.nd] \
76 [list readelf -s provide-hidden-dyn.nd]] \
80 "-T provide-hidden-1.ld" "tmpdir/provide-hidden-s.so" \
82 [list provide-hidden-3.s] \
83 [list "readelf -s provide-hidden-dynsec.nd"] \
87 "-T provide-hidden-1.ld" "" \
89 [list provide-hidden-4.s] \
91 [list readelf -s provide-hidden-sec.nd] \
92 [list readelf -s provide-hidden-dyn.nd]] \
96 "-T provide-hidden-1.ld" "tmpdir/provide-hidden-s.so" \
98 [list provide-hidden-4.s] \
100 [list readelf -s provide-hidden-sec.nd] \
101 [list readelf -s provide-hidden-dyn.nd]] \
102 "provide-hidden-6"] \
105 "-T provide-hidden-2.ld" "" \
107 [list provide-hidden-1.s] \
109 [list readelf -s provide-hidden-def.nd] \
110 [list readelf -s provide-hidden-dyn.nd]] \
111 "provide-hidden-7"] \
114 "-T provide-hidden-2.ld" "" \
116 [list provide-hidden-2.s] \
118 [list readelf -s provide-hidden-def.nd] \
119 [list readelf -s provide-hidden-dyn.nd]] \
120 "provide-hidden-8"] \
123 "-T provide-hidden-2.ld" "" \
125 [list provide-hidden-3.s] \
127 [list readelf -s provide-hidden-abs.nd] \
128 [list readelf -s provide-hidden-dyn.nd]] \
129 "provide-hidden-9"] \
132 "-T provide-hidden-2.ld" "tmpdir/provide-hidden-s.so" \
134 [list provide-hidden-3.s] \
135 [list "readelf -s provide-hidden-dynabs.nd"] \
136 "provide-hidden-10"] \
139 "-T provide-hidden-2.ld" "" \
141 [list provide-hidden-4.s] \
143 [list readelf -s provide-hidden-abs.nd] \
144 [list readelf -s provide-hidden-dyn.nd]] \
145 "provide-hidden-11"] \
148 "-T provide-hidden-2.ld" "tmpdir/provide-hidden-s.so" \
150 [list provide-hidden-4.s] \
152 [list readelf -s provide-hidden-abs.nd] \
153 [list readelf -s provide-hidden-dyn.nd]] \
154 "provide-hidden-12"]]