diff options
author | Ben Cheng <bccheng@google.com> | 2014-03-26 11:03:35 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2014-03-26 11:03:35 -0700 |
commit | 09797ba54abf3683ea66eedddf6afbe7653f9cb9 (patch) | |
tree | 8030b2ed79c7463c89d6da294782e9d503c84f50 /binutils-2.24/ld/testsuite/ld-linkonce | |
parent | 5a2caf34e4995860baf405552163df288000b7bf (diff) | |
download | toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.zip toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.tar.gz toolchain_binutils-09797ba54abf3683ea66eedddf6afbe7653f9cb9.tar.bz2 |
Initial checkin of binutils 2.24.
Change-Id: I0dfcbae6608dded6c3586bf5f4ac27e9612e70a2
Diffstat (limited to 'binutils-2.24/ld/testsuite/ld-linkonce')
-rw-r--r-- | binutils-2.24/ld/testsuite/ld-linkonce/linkonce.exp | 47 | ||||
-rw-r--r-- | binutils-2.24/ld/testsuite/ld-linkonce/x.s | 47 | ||||
-rw-r--r-- | binutils-2.24/ld/testsuite/ld-linkonce/y.s | 64 | ||||
-rw-r--r-- | binutils-2.24/ld/testsuite/ld-linkonce/zeroeh.ld | 5 | ||||
-rw-r--r-- | binutils-2.24/ld/testsuite/ld-linkonce/zeroehl32.d | 21 |
5 files changed, 184 insertions, 0 deletions
diff --git a/binutils-2.24/ld/testsuite/ld-linkonce/linkonce.exp b/binutils-2.24/ld/testsuite/ld-linkonce/linkonce.exp new file mode 100644 index 0000000..0211114 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-linkonce/linkonce.exp @@ -0,0 +1,47 @@ +# Expect script for ld linkonce tests +# Copyright 2001, 2002, 2005, 2007, 2010, 2012 Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# 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. +# +# Written by Hans-Peter Nilsson (hp@axis.com) +# + +# Test for ELF here (or really, .gnu.linkonce functionality), so we don't +# have to qualify on ELF specifically in every .d-file. + +if { ![istarget *-*-linux*] \ + && ![istarget *-*-gnu*] \ + && ![istarget *-*-nacl*] \ + && ![istarget hppa*64*-*-hpux*] \ + && ![istarget *-*-elf] } { + return +} + +if { [istarget *-*-linux*aout*] \ + || [istarget *-*-linux*oldld*] } { + return +} + +load_lib ld-lib.exp + +set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] +for { set i 0 } { $i < [llength $rd_test_list] } { incr i } { + # We need to strip the ".d", but can leave the dirname. + verbose [file rootname [lindex $rd_test_list $i]] + run_dump_test [file rootname [lindex $rd_test_list $i]] +} diff --git a/binutils-2.24/ld/testsuite/ld-linkonce/x.s b/binutils-2.24/ld/testsuite/ld-linkonce/x.s new file mode 100644 index 0000000..d07f73e --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-linkonce/x.s @@ -0,0 +1,47 @@ +;# Main file, x.s, with the program (_start) referring to two +;# linkonce functions fn and fn2. The functions fn and fn2 are +;# supposed to be equivalent of C++ template instantiations; the +;# main file instantiates fn. + + .text + .global _start +_start: + .long fn + .long fn2 + + .section .gnu.linkonce.t.fn,"ax",@progbits + .weak fn + .type fn,@function +fn: +.La: + .long 1 + .long 2 +.Lb: + .size fn,.Lb-.La + + .section .gcc_except_table,"aw",@progbits + .long 2 + .long .La + .long .Lb-.La + + .section .eh_frame,"aw",@progbits +.Lframe1: + .long .LECIE1-.LSCIE1 +.LSCIE1: + .long 0x0 + .byte 0x1 + .byte 0 + .uleb128 0x1 + .sleb128 -4 + .byte 0 + .p2align 2 +.LECIE1: + +.LSFDE1: + .long .LEFDE1-.LASFDE1 +.LASFDE1: + .long .LASFDE1-.Lframe1 + .long .La + .long .Lb-.La + .p2align 2 +.LEFDE1: diff --git a/binutils-2.24/ld/testsuite/ld-linkonce/y.s b/binutils-2.24/ld/testsuite/ld-linkonce/y.s new file mode 100644 index 0000000..c1eb511 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-linkonce/y.s @@ -0,0 +1,64 @@ +;# Library file y.s has linkonce entries for fn and fn2. Note +;# that this version of fn has different code, as if compiled +;# with different optimization flags than the one in x.s (not +;# important for this test, though). The reference from +;# .gcc_except_table to the linkonce-excluded fn2 must be zero, or g++ +;# EH will not work. + + .section .gnu.linkonce.t.fn2,"ax",@progbits + .weak fn2 + .type fn2,@function +fn2: +.Lc: + .long 3 +.Ld: + .size fn2,.Ld-.Lc + + .section .gnu.linkonce.t.fn,"ax",@progbits + .weak fn + .type fn,@function +fn: +.Le: + .long 4 +.Lf: + .size fn,.Lf-.Le + + .section .gcc_except_table,"aw",@progbits + .long 7 + .long .Lc + .long .Ld-.Lc + + .long 0x6066 + .long .Le + .long .Lf-.Le + + .section .eh_frame,"aw",@progbits +.Lframe1: + .long .LECIE1-.LSCIE1 +.LSCIE1: + .long 0x0 + .byte 0x1 + .byte 0 + .uleb128 0x1 + .sleb128 -4 + .byte 0 + .p2align 2 +.LECIE1: + +.LSFDE1: + .long .LEFDE1-.LASFDE1 +.LASFDE1: + .long .LASFDE1-.Lframe1 + .long .Lc + .long .Ld-.Lc + .p2align 2 +.LEFDE1: + +.LSFDE2: + .long .LEFDE2-.LASFDE2 +.LASFDE2: + .long .LASFDE2-.Lframe1 + .long .Le + .long .Lf-.Le + .p2align 2 +.LEFDE2: diff --git a/binutils-2.24/ld/testsuite/ld-linkonce/zeroeh.ld b/binutils-2.24/ld/testsuite/ld-linkonce/zeroeh.ld new file mode 100644 index 0000000..b22eaa1 --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-linkonce/zeroeh.ld @@ -0,0 +1,5 @@ +SECTIONS { + .text 0xa00 : { *(.text); *(.gnu.linkonce.t.*) } + .gcc_except_table 0x2000 : { *(.gcc_except_table) } + .eh_frame 0x4000 : { *(.eh_frame) } +} diff --git a/binutils-2.24/ld/testsuite/ld-linkonce/zeroehl32.d b/binutils-2.24/ld/testsuite/ld-linkonce/zeroehl32.d new file mode 100644 index 0000000..bd8fc6f --- /dev/null +++ b/binutils-2.24/ld/testsuite/ld-linkonce/zeroehl32.d @@ -0,0 +1,21 @@ +#source: x.s +#source: y.s +#ld: -Ttext 0xa00 -T zeroeh.ld +#objdump: -s +#target: cris-*-elf cris-*-linux* i?86-*-elf i?86-*-linux* i?86-*-gnu* + +# The word at address 201c, for the linkonce-excluded section, must be zero. + +.*: file format elf32.* + +Contents of section \.text: + 0a00 080a0000 100a0000 01000000 02000000 .* + 0a10 03000000 .* +Contents of section \.gcc_except_table: + 2000 02000000 080a0000 08000000 07000000 .* + 2010 100a0000 04000000 66600000 00000000 .* + 2020 04000000 .* +Contents of section \.eh_frame: + 4000 0c000000 00000000 0100017c 00000000 .* + 4010 0c000000 14000000 080a0000 08000000 .* + 4020 0c000000 24000000 100a0000 04000000 .* |