OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.18.50/] [ld/] [testsuite/] [ld-scripts/] [phdrs2.exp] - Diff between revs 38 and 156

Only display areas with differences | Details | Blame | View Log

Rev 38 Rev 156
# Test PHDRS with empty sections in a linker script.
# Test PHDRS with empty sections in a linker script.
# Copyright 2007  Free Software Foundation, Inc,
# Copyright 2007  Free Software Foundation, Inc,
#
#
# This file is part of the GNU Binutils.
# This file is part of the GNU Binutils.
#
#
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
# MA 02110-1301, USA.
# PHDRS2 is only meaningful for ELF.
# PHDRS2 is only meaningful for ELF.
if {    ![istarget *-*-sysv4*] \
if {    ![istarget *-*-sysv4*] \
     && ![istarget *-*-unixware*] \
     && ![istarget *-*-unixware*] \
     && ![istarget *-*-elf*] \
     && ![istarget *-*-elf*] \
     && ![istarget *-*-eabi*] \
     && ![istarget *-*-eabi*] \
     && ![istarget hppa*64*-*-hpux*] \
     && ![istarget hppa*64*-*-hpux*] \
     && ![istarget *-*-linux*] \
     && ![istarget *-*-linux*] \
     && ![istarget *-*-irix5*] \
     && ![istarget *-*-irix5*] \
     && ![istarget *-*-irix6*] \
     && ![istarget *-*-irix6*] \
     && ![istarget *-*-solaris2*] } {
     && ![istarget *-*-solaris2*] } {
    return
    return
}
}
if { [istarget *-*-linux*aout*] \
if { [istarget *-*-linux*aout*] \
     || [istarget *-*-linux*oldld*] } {
     || [istarget *-*-linux*oldld*] } {
    return
    return
}
}
# This is a very simplistic test.
# This is a very simplistic test.
set testname "PHDRS2"
set testname "PHDRS2"
set ldopt ""
set ldopt ""
if { [istarget spu*-*-*] } {
if { [istarget spu*-*-*] } {
    set ldopt "--local-store 0:0"
    set ldopt "--local-store 0:0"
}
}
if ![ld_assemble $as $srcdir/$subdir/phdrs2.s tmpdir/phdrs2.o] {
if ![ld_assemble $as $srcdir/$subdir/phdrs2.s tmpdir/phdrs2.o] {
    unresolved $testname
    unresolved $testname
    return
    return
}
}
set phdrs_regexp \
set phdrs_regexp \
    ".*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.*"
    ".*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.*"
set ldopt "$ldopt -T $srcdir/$subdir/phdrs2.t tmpdir/phdrs2.o"
set ldopt "$ldopt -T $srcdir/$subdir/phdrs2.t tmpdir/phdrs2.o"
if ![ld_simple_link $ld tmpdir/phdrs2 $ldopt] {
if ![ld_simple_link $ld tmpdir/phdrs2 $ldopt] {
    fail $testname
    fail $testname
} else {
} else {
    if {![is_remote host] && [which $objdump] == 0} {
    if {![is_remote host] && [which $objdump] == 0} {
        unresolved $testname
        unresolved $testname
        return
        return
    }
    }
    set exec_output [run_host_cmd "$objdump" "--private tmpdir/phdrs2"]
    set exec_output [run_host_cmd "$objdump" "--private tmpdir/phdrs2"]
    set exec_output [prune_warnings $exec_output]
    set exec_output [prune_warnings $exec_output]
    verbose -log $exec_output
    verbose -log $exec_output
    if [regexp $phdrs_regexp $exec_output] {
    if [regexp $phdrs_regexp $exec_output] {
        pass $testname
        pass $testname
    } else {
    } else {
        fail $testname
        fail $testname
    }
    }
}
}
 
 

powered by: WebSVN 2.1.0

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