OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [ld/] [testsuite/] [ld-mips-elf/] [comm-data.exp] - Blame information for rev 166

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 166 khays
# Expect script for common symbol override, MIPS variation.
2
#
3
#   Copyright 2011  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 
25
#
26
 
27
# Exclude non-Linux targets; feel free to include your favorite one
28
# if you like.
29
if ![istarget mips*-*-linux*] {
30
    return
31
}
32
 
33
proc mips_comm_data_test { abi flag emul reloc } {
34
 
35
    set testname "MIPS $abi/$reloc common symbol override test"
36
 
37
    # There's no "-z copyreloc" option, deal with it.
38
    set ZFLAG [string map [list copyreloc "" nocopyreloc "-z $reloc"] $reloc]
39
    set AFLAGS "$flag -EB"
40
    set LDFLAGS "-m$emul"
41
 
42
    # Define a global symbol.
43
    run_ld_link_tests [list \
44
        [list \
45
            "$testname (auxiliary shared object build)" \
46
            "$LDFLAGS -shared" \
47
            "$AFLAGS -call_shared" \
48
            { ../ld-elf/comm-data1.s } \
49
            { \
50
                { readelf -s ../ld-elf/comm-data1.sd } \
51
            } \
52
          "libmips-$abi-$reloc-comm-data.so" \
53
        ] \
54
    ]
55
 
56
    # Set the pointer size according to the ABI.
57
    if { $abi == "n64" } {
58
        append AFLAGS " --defsym ELF64=1"
59
    }
60
 
61
    # Verify that a common symbol has been converted to an undefined
62
    # reference to the global symbol of the same name defined above
63
    # and that the debug reference has been dropped.
64
    run_ld_link_tests [list \
65
        [list \
66
            "$testname" \
67
            "$LDFLAGS $ZFLAG -Ltmpdir -lmips-$abi-$reloc-comm-data" \
68
            "$AFLAGS -call_nonpic" \
69
            { ../ld-elf/comm-data2.s } \
70
            { \
71
                { readelf -s ../ld-elf/comm-data2.sd } \
72
                { readelf -r ../ld-elf/comm-data2.rd } \
73
                { readelf "-x .debug_foo" ../ld-elf/comm-data2.xd } \
74
            } \
75
            "mips-$abi-$reloc-comm-data" \
76
        ] \
77
    ]
78
}
79
 
80
set abis { o32 -32 elf32btsmip n32 -n32 elf32btsmipn32 n64 -64 elf64btsmip }
81
set relocs { copyreloc nocopyreloc }
82
foreach { abi flag emul } $abis {
83
    foreach reloc $relocs {
84
        mips_comm_data_test $abi $flag $emul $reloc
85
    }
86
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.