1 # Expect script for common symbol override.
3 # Copyright 2011, 2012 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 # Exclude non-ELF targets.
32 # Exclude some more targets; feel free to include your favorite one
34 if { ![istarget *-*-linux*]
35 && ![istarget *-*-nacl*]
36 && ![istarget *-*-gnu*] } {
40 set testname "Common symbol override test"
42 # Define a global symbol.
43 run_ld_link_tests [list \
45 "$testname (auxiliary shared object build)" \
50 { readelf -s comm-data1.sd } \
56 # Set the pointer size according to the ELF flavor.
58 if [is_elf64 "tmpdir/libcomm-data.so"] {
59 append AFLAGS " --defsym ELF64=1"
62 # Verify that a common symbol has been converted to an undefined
63 # reference to the global symbol of the same name defined above
64 # and that the debug reference has been dropped.
65 run_ld_link_tests [list \
68 "-Ltmpdir -lcomm-data" \
72 { readelf -s comm-data2.sd } \
73 { readelf -r comm-data2.rd } \
74 { readelf "-x .debug_foo" comm-data2.xd } \
82 { comm-data3a.s comm-data3b.s } \
84 { readelf -s comm-data3.sd } \
92 { comm-data3b.s comm-data3a.s } \
94 { readelf -s comm-data3.sd } \