]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
This commit was manufactured by cvs2svn to create branch 'binutils-
authornobody <>
Tue, 8 Nov 2011 13:06:04 +0000 (13:06 +0000)
committernobody <>
Tue, 8 Nov 2011 13:06:04 +0000 (13:06 +0000)
2_22-branch'.

Cherrypick from master 2011-11-08 13:06:03 UTC Alan Modra <amodra@gmail.com> 'bfd/':
    gold/testsuite/arm_farcall_arm_arm.s
    gold/testsuite/arm_farcall_arm_arm.sh
    gold/testsuite/arm_farcall_arm_thumb.s
    gold/testsuite/arm_farcall_arm_thumb.sh
    gold/testsuite/arm_farcall_thumb_arm.s
    gold/testsuite/arm_farcall_thumb_arm.sh
    gold/testsuite/arm_farcall_thumb_thumb.s
    gold/testsuite/arm_farcall_thumb_thumb.sh
    gold/testsuite/arm_fix_1176.s
    gold/testsuite/arm_fix_1176.sh
    ld/testsuite/ld-powerpc/tocopt.out

gold/testsuite/arm_farcall_arm_arm.s [new file with mode: 0644]
gold/testsuite/arm_farcall_arm_arm.sh [new file with mode: 0755]
gold/testsuite/arm_farcall_arm_thumb.s [new file with mode: 0644]
gold/testsuite/arm_farcall_arm_thumb.sh [new file with mode: 0755]
gold/testsuite/arm_farcall_thumb_arm.s [new file with mode: 0644]
gold/testsuite/arm_farcall_thumb_arm.sh [new file with mode: 0755]
gold/testsuite/arm_farcall_thumb_thumb.s [new file with mode: 0644]
gold/testsuite/arm_farcall_thumb_thumb.sh [new file with mode: 0755]
gold/testsuite/arm_fix_1176.s [new file with mode: 0644]
gold/testsuite/arm_fix_1176.sh [new file with mode: 0755]
ld/testsuite/ld-powerpc/tocopt.out [new file with mode: 0644]

diff --git a/gold/testsuite/arm_farcall_arm_arm.s b/gold/testsuite/arm_farcall_arm_arm.s
new file mode 100644 (file)
index 0000000..00c1e48
--- /dev/null
@@ -0,0 +1,20 @@
+@ Test to ensure that a ARM to ARM call exceeding 32Mb generates a stub.
+
+       .global _start
+       .syntax unified
+
+@ We will place the section .text at 0x1000.
+
+       .text
+
+_start:
+       bl bar
+
+@ We will place the section .foo at 0x2001020.
+
+       .section .foo, "xa"
+
+       .type bar, %function
+bar:
+       bx lr
+
diff --git a/gold/testsuite/arm_farcall_arm_arm.sh b/gold/testsuite/arm_farcall_arm_arm.sh
new file mode 100755 (executable)
index 0000000..7d95528
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# arm_farcall_arm_arm.sh -- a test case for ARM->ARM farcall veneers
+
+# Copyright 2010, 2011, Free Software Foundation, Inc.
+# Written by Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+# Based upon arm_cortex_a8.sh
+# Written by Doug Kwan <dougkwan@google.com>.
+
+# This file is part of gold.
+
+# 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+check()
+{
+    if ! grep -q "$2" "$1"
+    then
+       echo "Did not find expected instruction in $1:"
+       echo "   $2"
+       echo ""
+       echo "Actual instructions below:"
+       cat "$1"
+       exit 1
+    fi
+}
+
+# Check for ARM->ARM default
+check arm_farcall_arm_arm.stdout "1004:        .*      ldr     pc, \[pc, #-4\] .*"
+check arm_farcall_arm_arm.stdout "1008:        02001020"
+
+exit 0
diff --git a/gold/testsuite/arm_farcall_arm_thumb.s b/gold/testsuite/arm_farcall_arm_thumb.s
new file mode 100644 (file)
index 0000000..c69f31c
--- /dev/null
@@ -0,0 +1,20 @@
+@ Test to ensure that a ARM to Thumb call exceeding 32Mb generates a stub.
+
+       .global _start
+       .global bar
+       .syntax unified
+
+@ We will place the section .text at 0x1000.
+
+       .text
+
+_start:
+       bl bar
+
+@ We will place the section .foo at 0x2001010.
+
+       .section .foo, "xa"
+       .thumb_func
+bar:
+       bx lr
+
diff --git a/gold/testsuite/arm_farcall_arm_thumb.sh b/gold/testsuite/arm_farcall_arm_thumb.sh
new file mode 100755 (executable)
index 0000000..2df2d65
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# arm_farcall_arm_thumb.sh -- a test case for ARM->Thumb farcall veneers.
+
+# Copyright 2010, 2011, Free Software Foundation, Inc.
+# Written by Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+# Based upon arm_cortex_a8.sh
+# Written by Doug Kwan <dougkwan@google.com>.
+
+# This file is part of gold.
+
+# 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+check()
+{
+    if ! grep -q "$2" "$1"
+    then
+       echo "Did not find expected instruction in $1:"
+       echo "   $2"
+       echo ""
+       echo "Actual instructions below:"
+       cat "$1"
+       exit 1
+    fi
+}
+
+# Check for ARM->Thumb default
+check arm_farcall_arm_thumb.stdout "1004:      .*      ldr     ip, \[pc\]"
+check arm_farcall_arm_thumb.stdout "1008:      .*      bx      ip"
+check arm_farcall_arm_thumb.stdout "100c:      02001015"
+
+# Check for ARM->Thumb with v5t interworking
+chck arm_farcall_arm_thumb_5t.stdout "1004:    f004 e51f"
+chck arm_farcall_arm_thumb_5t.stdout "1008:    1015"
+chck arm_farcall_arm_thumb_5t.stdout "100a:    0200"
+
+exit 0
diff --git a/gold/testsuite/arm_farcall_thumb_arm.s b/gold/testsuite/arm_farcall_thumb_arm.s
new file mode 100644 (file)
index 0000000..1fd6a07
--- /dev/null
@@ -0,0 +1,27 @@
+@ Test to ensure that a Thumb to ARM call exceeding 4Mb generates a stub.
+@ Check that we can generate two types of stub in the same section.
+
+       .global _start
+       .syntax unified
+
+@ We will place the section .text at 0x1c01010.
+
+       .text
+       .thumb_func
+_start:
+       .global bar
+       bl bar
+@ This call is close enough to generate a "short branch" stub
+@ or no stub if blx is available.
+       .space 0x0300000
+       bl bar
+
+@ We will place the section .foo at 0x2001014.
+
+       .section .foo, "xa"
+
+       .arm
+       .type bar, %function
+bar:
+       bx lr
+
diff --git a/gold/testsuite/arm_farcall_thumb_arm.sh b/gold/testsuite/arm_farcall_thumb_arm.sh
new file mode 100755 (executable)
index 0000000..e22da46
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# arm_farcall_thumb_arm.sh -- a test case for Thumb->ARM farcall veneers.
+
+# Copyright 2010, 2011, Free Software Foundation, Inc.
+# Written by Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+# Based upon arm_cortex_a8.sh
+# Written by Doug Kwan <dougkwan@google.com>.
+
+# This file is part of gold.
+
+# 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+check()
+{
+    if ! grep -q "$2" "$1"
+    then
+       echo "Did not find expected instruction in $1:"
+       echo "   $2"
+       echo ""
+       echo "Actual instructions below:"
+       cat "$1"
+       exit 1
+    fi
+}
+
+# Thumb->ARM
+check arm_farcall_thumb_arm.stdout "1f01018:   .*              bx      pc"
+check arm_farcall_thumb_arm.stdout "1f0101a:   .*              nop"
+check arm_farcall_thumb_arm.stdout "1f0101c:   f004 e51f"
+check arm_farcall_thumb_arm.stdout "1f01020:   1014"
+check arm_farcall_thumb_arm.stdout "1f01022:   0200"
+
+check arm_farcall_thumb_arm.stdout "1f01024:   .*              bx      pc"
+check arm_farcall_thumb_arm.stdout "1f01026:   .*              nop"
+check arm_farcall_thumb_arm.stdout "1f01028:   fff9 ea03"
+
+# Thumb->ARM with v5T interworking
+check arm_farcall_thumb_arm_5t.stdout "1f01018:        f004 e51f"
+check arm_farcall_thumb_arm_5t.stdout "1f0101c:        1014"
+check arm_farcall_thumb_arm_5t.stdout "1f0101e:        0200"
+
+exit 0
diff --git a/gold/testsuite/arm_farcall_thumb_thumb.s b/gold/testsuite/arm_farcall_thumb_thumb.s
new file mode 100644 (file)
index 0000000..650b1a6
--- /dev/null
@@ -0,0 +1,19 @@
+@ Test to ensure that a Thumb to Thumb call exceeding 4Mb generates a stub.
+
+       .global _start
+       .syntax unified
+
+@ We will place the section .text at 0x1000.
+
+       .text
+       .thumb_func
+_start:
+       bl bar
+
+@ We will place the section .foo at 0x02001014.
+
+       .section .foo, "xa"
+       .thumb_func
+bar:
+       bx lr
+
diff --git a/gold/testsuite/arm_farcall_thumb_thumb.sh b/gold/testsuite/arm_farcall_thumb_thumb.sh
new file mode 100755 (executable)
index 0000000..23fb0cd
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/sh
+
+# arm_farcall_thumb_thumb.sh -- a test case for Thumb->Thumb farcall veneers.
+
+# Copyright 2010, 2011, Free Software Foundation, Inc.
+# Written by Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+# Based upon arm_cortex_a8.sh
+# Written by Doug Kwan <dougkwan@google.com>.
+
+# This file is part of gold.
+
+# 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+check()
+{
+    if ! grep -q "$2" "$1"
+    then
+       echo "Did not find expected instruction in $1:"
+       echo "   $2"
+       echo ""
+       echo "Actual instructions below:"
+       cat "$1"
+       exit 1
+    fi
+}
+
+# Thumb->Thumb default
+check arm_farcall_thumb_thumb.stdout "1004:    .*              bx      pc"
+check arm_farcall_thumb_thumb.stdout "1006:    .*              nop"
+check arm_farcall_thumb_thumb.stdout "1008:    c000"
+check arm_farcall_thumb_thumb.stdout "100a:    e59f"
+check arm_farcall_thumb_thumb.stdout "100c:    ff1c e12f"
+check arm_farcall_thumb_thumb.stdout "1010:    1015"
+check arm_farcall_thumb_thumb.stdout "1012:    0200"
+
+# Thumb->Thumb with v5T interworking
+check arm_farcall_thumb_thumb_5t.stdout "1004: f004 e51f"
+check arm_farcall_thumb_thumb_5t.stdout "1008: 1015"
+check arm_farcall_thumb_thumb_5t.stdout "100a: 0200"
+
+# Thumb->Thumb on v6-M
+check arm_farcall_thumb_thumb_6m.stdout "1004: .*              push    {r0}"
+check arm_farcall_thumb_thumb_6m.stdout "1006: .*              ldr     r0, \\[pc, #8\\]"
+check arm_farcall_thumb_thumb_6m.stdout "1008: .*              mov     ip, r0"
+check arm_farcall_thumb_thumb_6m.stdout "100a: .*              pop     {r0}"
+check arm_farcall_thumb_thumb_6m.stdout "100c: .*              bx      ip"
+check arm_farcall_thumb_thumb_6m.stdout "100e: .*              nop"
+check arm_farcall_thumb_thumb_6m.stdout "1010: 1015"
+check arm_farcall_thumb_thumb_6m.stdout "1012: 0200"
+
+# Thumb->Thumb on v7-M
+check arm_farcall_thumb_thumb_6m.stdout "1004: .*              push    {r0}"
+check arm_farcall_thumb_thumb_6m.stdout "1006: .*              ldr     r0, \\[pc, #8\\]"
+check arm_farcall_thumb_thumb_6m.stdout "1008: .*              mov     ip, r0"
+check arm_farcall_thumb_thumb_6m.stdout "100a: .*              pop     {r0}"
+check arm_farcall_thumb_thumb_6m.stdout "100c: .*              bx      ip"
+check arm_farcall_thumb_thumb_6m.stdout "100e: .*              nop"
+check arm_farcall_thumb_thumb_6m.stdout "1010: 1015"
+check arm_farcall_thumb_thumb_6m.stdout "1012: 0200"
+
+exit 0
diff --git a/gold/testsuite/arm_fix_1176.s b/gold/testsuite/arm_fix_1176.s
new file mode 100644 (file)
index 0000000..96e0328
--- /dev/null
@@ -0,0 +1,15 @@
+       .syntax unified
+       .globl _start
+       .globl func_to_branch_to
+
+       .arm
+       .text
+func_to_branch_to:
+       bx lr
+
+       .thumb
+       .section .foo, "xa"
+       .thumb_func
+_start:
+       bl func_to_branch_to
+
diff --git a/gold/testsuite/arm_fix_1176.sh b/gold/testsuite/arm_fix_1176.sh
new file mode 100755 (executable)
index 0000000..152b0a3
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# arm_fix_1176.sh -- a test case for the ARM1176 workaround.
+
+# Copyright 2010, 2011, Free Software Foundation, Inc.
+# Written by Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+# Based upon arm_cortex_a8.sh
+# Written by Doug Kwan <dougkwan@google.com>.
+
+# This file is part of gold.
+
+# 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# This file goes with arm_v4bx.s, an ARM assembly source file constructed to
+# have test the handling of R_ARM_V4BX relocation.
+
+check()
+{
+    if ! grep -q "$2" "$1"
+    then
+       echo "Did not find expected instruction in $1:"
+       echo "   $2"
+       echo ""
+       echo "Actual instructions below:"
+       cat "$1"
+       exit 1
+    fi
+}
+
+# Check for fix default state on v6Z.
+check arm_fix_1176_default_v6z.stdout "2001014:        .*      bl      2001018 <.*>"
+
+# Check for fix explicitly on on v6Z.
+check arm_fix_1176_on_v6z.stdout "2001014:     .*      bl      2001018 <.*>"
+
+# Check for explicitly off on v6Z
+check arm_fix_1176_off_v6z.stdout "2001014:    .*      blx     2001018 <.*>"
+
+# Check for fix default state on v5TE
+check arm_fix_1176_default_v5te.stdout "2001014:       .*      bl      2001018 <.*>"
+
+# Check for fix default state on v7A
+check arm_fix_1176_default_v7a.stdout "2001014:        .*      blx     2001018 <.*>"
+
+# Check for fix default state on ARM1156T2F-S
+check arm_fix_1176_default_1156t2f_s.stdout "2001014:  .*      blx     2001018 <.*>"
+
+exit 0
diff --git a/ld/testsuite/ld-powerpc/tocopt.out b/ld/testsuite/ld-powerpc/tocopt.out
new file mode 100644 (file)
index 0000000..6df909f
--- /dev/null
@@ -0,0 +1,4 @@
+.*
+\(\.text\+0x14\): .* 0x3fa00000 .*
+.*
+\(\.text\+0x34\): .* 0x3fa00010 .*