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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [binutils-2.20.1/] [ld/] [testsuite/] [ld-scripts/] [phdrs2.exp] - Blame information for rev 843

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 205 julius
# Test PHDRS with empty sections in a linker script.
2
# Copyright 2006, 2005, 2007  Free Software Foundation, Inc,
3
#
4
# This file is part of the GNU Binutils.
5
#
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.
10
#
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.
15
#
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,
19
# MA 02110-1301, USA.
20
 
21
# PHDRS2 is only meaningful for ELF.
22
if {    ![istarget *-*-sysv4*] \
23
     && ![istarget *-*-unixware*] \
24
     && ![istarget *-*-elf*] \
25
     && ![istarget *-*-eabi*] \
26
     && ![istarget hppa*64*-*-hpux*] \
27
     && ![istarget *-*-linux*] \
28
     && ![istarget *-*-irix5*] \
29
     && ![istarget *-*-irix6*] \
30
     && ![istarget *-*-solaris2*] } {
31
    return
32
}
33
 
34
if { [istarget *-*-linux*aout*] \
35
     || [istarget *-*-linux*oldld*] } {
36
    return
37
}
38
 
39
# This is a very simplistic test.
40
 
41
set testname "PHDRS2"
42
 
43
set ldopt ""
44
if { [istarget spu*-*-*] } {
45
    set ldopt "--local-store 0:0"
46
}
47
 
48
if ![ld_assemble $as $srcdir/$subdir/phdrs2.s tmpdir/phdrs2.o] {
49
    unresolved $testname
50
    return
51
}
52
 
53
set phdrs_regexp \
54
    ".*Program Header:.*LOAD *off *0x00\[0-9a-f\]* *vaddr *0x00*800000 *paddr *0x00*800000.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]*.*LOAD *off *0x00\[0-9a-f\]* *vaddr *0x00*800004 *paddr *0x00*800004.*filesz *0x00*\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags rw.*"
55
 
56
set ldopt "$ldopt -T $srcdir/$subdir/phdrs2.t tmpdir/phdrs2.o"
57
if ![ld_simple_link $ld tmpdir/phdrs2 $ldopt] {
58
    fail $testname
59
} else {
60
    if {![is_remote host] && [which $objdump] == 0} {
61
        unresolved $testname
62
        return
63
    }
64
 
65
    set exec_output [run_host_cmd "$objdump" "--private tmpdir/phdrs2"]
66
    set exec_output [prune_warnings $exec_output]
67
    verbose -log $exec_output
68
 
69
    if [regexp $phdrs_regexp $exec_output] {
70
        pass $testname
71
    } else {
72
        fail $testname
73
    }
74
}

powered by: WebSVN 2.1.0

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