* ld-elf/comm-data.exp: Revert last change.
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elf / comm-data.exp
1 # Expect script for common symbol override.
2 #
3 # Copyright 2011, 2012 Free Software Foundation, Inc.
4 #
5 # This file is part of the GNU Binutils.
6 #
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.
11 #
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.
16 #
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,
20 # MA 02110-1301, USA.
21 #
22
23 #
24 # Written by Maciej W. Rozycki <macro@codesourcery.com>
25 #
26
27 # Exclude non-ELF targets.
28 if ![is_elf_format] {
29 return
30 }
31
32 # Exclude some more targets; feel free to include your favorite one
33 # if you like.
34 if { ![istarget *-*-linux*]
35 && ![istarget *-*-nacl*]
36 && ![istarget *-*-gnu*] } {
37 return
38 }
39
40 set testname "Common symbol override test"
41
42 # Define a global symbol.
43 run_ld_link_tests [list \
44 [list \
45 "$testname (auxiliary shared object build)" \
46 "-shared" \
47 "" \
48 { comm-data1.s } \
49 { \
50 { readelf -s comm-data1.sd } \
51 } \
52 "libcomm-data.so" \
53 ] \
54 ]
55
56 # Set the pointer size according to the ELF flavor.
57 set AFLAGS ""
58 if [is_elf64 "tmpdir/libcomm-data.so"] {
59 append AFLAGS " --defsym ELF64=1"
60 }
61
62 setup_xfail "arm*-*-*" "ld/13802"
63
64 # Verify that a common symbol has been converted to an undefined
65 # reference to the global symbol of the same name defined above
66 # and that the debug reference has been dropped.
67 run_ld_link_tests [list \
68 [list \
69 "$testname" \
70 "-Ltmpdir -lcomm-data" \
71 "$AFLAGS" \
72 { comm-data2.s } \
73 { \
74 { readelf -s comm-data2.sd } \
75 { readelf -r comm-data2.rd } \
76 { readelf "-x .debug_foo" comm-data2.xd } \
77 } \
78 "comm-data" \
79 ] \
80 [list \
81 "$testname 3a" \
82 "-static" \
83 "" \
84 { comm-data3a.s comm-data3b.s } \
85 { \
86 { readelf -s comm-data3.sd } \
87 } \
88 "comm-data3a" \
89 ] \
90 [list \
91 "$testname 3b" \
92 "-static" \
93 "" \
94 { comm-data3b.s comm-data3a.s } \
95 { \
96 { readelf -s comm-data3.sd } \
97 } \
98 "comm-data3b" \
99 ] \
100 ]
This page took 0.033426 seconds and 5 git commands to generate.