diff options
Diffstat (limited to 'binutils-2.25/ld/testsuite/ld-scripts')
50 files changed, 412 insertions, 66 deletions
diff --git a/binutils-2.25/ld/testsuite/ld-scripts/align.exp b/binutils-2.25/ld/testsuite/ld-scripts/align.exp index 9ea46d0..1eac9cb 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/align.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/align.exp @@ -1,7 +1,6 @@ # Test ALIGN in a linker script. # By Nathan Sidwell, CodeSourcery LLC -# Copyright 2004, 2005, 2006, 2007 -# Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/alignof.exp b/binutils-2.25/ld/testsuite/ld-scripts/alignof.exp index 0f05aeb..ecdd8dc 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/alignof.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/alignof.exp @@ -1,5 +1,5 @@ # Test ALIGNOF in a linker script. -# Copyright 2007 Free Software Foundation, Inc. +# Copyright (C) 2007-2014 Free Software Foundation, Inc. # Contributed by Nathan Sidwell <nathan@codesourcery.com> # # This file is part of the GNU Binutils. diff --git a/binutils-2.25/ld/testsuite/ld-scripts/assert.exp b/binutils-2.25/ld/testsuite/ld-scripts/assert.exp index b4169ac..3b8280c 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/assert.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/assert.exp @@ -1,7 +1,6 @@ # Test ASSERT in a linker script. # By Nathan Sidwell, CodeSourcery LLC -# Copyright 2004, 2005, 2007 -# Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/crossref.exp b/binutils-2.25/ld/testsuite/ld-scripts/crossref.exp index 061b5aa..4e84481 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/crossref.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/crossref.exp @@ -1,7 +1,6 @@ # Test NOCROSSREFS in a linker script. # By Ian Lance Taylor, Cygnus Support. -# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2007 -# Free Software Foundation, Inc. +# Copyright (C) 2000-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -31,9 +30,11 @@ if { ![is_remote host] && [which $CC] == 0 } { return } +global CFLAGS +set old_CFLAGS "$CFLAGS" + # Xtensa targets currently default to putting literal values in a separate # section and that requires linker script support, so put literals in text. -global CFLAGS if [istarget xtensa*-*-*] { set CFLAGS "$CFLAGS -mtext-section-literals" } @@ -41,7 +42,7 @@ if [istarget xtensa*-*-*] { # If we have a compiler that doesn't use/reference dot-symbols, then # calls to functions reference the .opd section function descriptor. # This makes NOCROSSREFS rather useless on powerpc64. -if [istarget powerpc64*-*-*] { +if [istarget powerpc64-*-*] { set CFLAGS "$CFLAGS -mcall-aixdesc" } @@ -61,6 +62,7 @@ if { ![ld_compile $CC "$srcdir/$subdir/cross1.c" tmpdir/cross1.o] \ || ![ld_compile $CC "$srcdir/$subdir/cross2.c" tmpdir/cross2.o] } { unresolved $test1 unresolved $test2 + set CFLAGS "$old_CFLAGS" return } @@ -95,6 +97,7 @@ if [string match "" $exec_output] then { if { ![ld_compile $CC "$srcdir/$subdir/cross3.c" tmpdir/cross3.o] } { unresolved $test2 + set CFLAGS "$old_CFLAGS" return } @@ -118,11 +121,13 @@ if [string match "" $exec_output] then { if { ![ld_compile $CC "$srcdir/$subdir/cross4.c" tmpdir/cross4.o] } { unresolved $test3 + set CFLAGS "$old_CFLAGS" return } if ![ld_relocate $ld tmpdir/cross3-partial.o "tmpdir/cross1.o tmpdir/cross4.o"] { unresolved $test3 + set CFLAGS "$old_CFLAGS" return } @@ -138,3 +143,5 @@ if [string match "" $exec_output] then { verbose -log "$exec_output" fail $test3 } + +set CFLAGS "$old_CFLAGS" diff --git a/binutils-2.25/ld/testsuite/ld-scripts/data.exp b/binutils-2.25/ld/testsuite/ld-scripts/data.exp index feb22aa..ad25e9b 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/data.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/data.exp @@ -1,7 +1,6 @@ # Test DATA STATEMENT in a linker script. # By Nathan Sidwell, CodeSourcery LLC -# Copyright 2004, 2005, 2007 -# Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -24,7 +23,9 @@ # text segment, confusing run_dump_test. if {[is_aout_format]} { unsupported data + unsupported fill return } run_dump_test data +run_dump_test fill diff --git a/binutils-2.25/ld/testsuite/ld-scripts/default-script.exp b/binutils-2.25/ld/testsuite/ld-scripts/default-script.exp index 2e6fce0..3e37154 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/default-script.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/default-script.exp @@ -1,6 +1,5 @@ # Test --default-script/-dT -# Copyright 2007, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 2007-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/defined.exp b/binutils-2.25/ld/testsuite/ld-scripts/defined.exp index bfee102..b871004 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/defined.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/defined.exp @@ -1,7 +1,6 @@ # Test DEFINED in a linker script. # By Ian Lance Taylor, Cygnus Support. -# Copyright 2001, 2003, 2005, 2006, 2007, 2010 -# Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/dynamic-sections.exp b/binutils-2.25/ld/testsuite/ld-scripts/dynamic-sections.exp index b1b3ae7..ff611b7 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/dynamic-sections.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/dynamic-sections.exp @@ -1,4 +1,4 @@ -# Copyright 2007 Free Software Foundation, Inc. +# Copyright (C) 2007-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/empty-address.exp b/binutils-2.25/ld/testsuite/ld-scripts/empty-address.exp index 6a2150f..048ace9 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/empty-address.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/empty-address.exp @@ -1,7 +1,6 @@ # Make sure that "dot" is updated for empty sections if their addresses # are set. -# Copyright 2006, 2007, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.d b/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.d index d9916dd..ff131eb 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.d +++ b/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.d @@ -1,14 +1,8 @@ #source: empty-aligned.s #ld: -T empty-aligned.t -#readelf: -l --wide -#xfail: "hppa64-*-*" -#notarget: frv-*-*linux* +#readelf: -S --wide #... -Program Headers: - +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg +Align - +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ [RWE ]+ +0x[0-9a-f]+ -! +LOAD .* -#... - +Segment Sections\.\.\. - +00 +.text +.* .text .* +!.* .text[234] .* +#pass diff --git a/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.exp b/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.exp index 70da61d..cbf9662 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.exp @@ -1,6 +1,5 @@ # Make sure empty aligned sections do not change output layout. -# Copyright 2005, 2007 -# Free Software Foundation, Inc. +# Copyright (C) 2005-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.t b/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.t index e59bc20..5f6a38d 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.t +++ b/binutils-2.25/ld/testsuite/ld-scripts/empty-aligned.t @@ -6,14 +6,14 @@ SECTIONS { *(.text1) } - /* Same for alignment at beginning and end. */ + /* Same for alignment at beginning and end, although we need to be + careful in the expression used to align. */ .text2 ALIGN (4096) : { *(.text2) - . = ALIGN (4096); + . = ALIGN (. != 0 ? 4096 : 1); } - /* Same for alignment just at end, although we need to be careful in - the expression used to align. */ + /* Same for alignment just at end. */ .text3 : { *(.text3) diff --git a/binutils-2.25/ld/testsuite/ld-scripts/empty-orphan.exp b/binutils-2.25/ld/testsuite/ld-scripts/empty-orphan.exp index 0c6ebd7..6ceba79 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/empty-orphan.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/empty-orphan.exp @@ -1,7 +1,6 @@ # Make sure orphan sections do not lead to huge output files. # By David Heine, Tensilica, Inc. -# Copyright 2005, 2006, 2007, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 2005-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/expr.exp b/binutils-2.25/ld/testsuite/ld-scripts/expr.exp index 0f92d97..eaf0662 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/expr.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/expr.exp @@ -1,7 +1,6 @@ # Test expressions in a linker script. # By Nathan Sidwell, CodeSourcery LLC -# Copyright 2006, 2007, 2010 -# Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -25,3 +24,4 @@ run_dump_test expr2 run_dump_test sane1 run_dump_test assign-loc run_dump_test pr14962 +run_dump_test pr14962-2 diff --git a/binutils-2.25/ld/testsuite/ld-scripts/extern.exp b/binutils-2.25/ld/testsuite/ld-scripts/extern.exp index f05cd35..3823f8d 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/extern.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/extern.exp @@ -1,7 +1,6 @@ # Test EXTERN in a linker script. # By Nathan Sidwell, CodeSourcery LLC -# Copyright 2007 -# Free Software Foundation, Inc. +# Copyright (C) 2007-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/fill.d b/binutils-2.25/ld/testsuite/ld-scripts/fill.d new file mode 100644 index 0000000..8dd789b --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/fill.d @@ -0,0 +1,29 @@ +#source: fill_0.s +#source: fill_1.s +#source: fill_2.s +#ld: -T fill.t +#objdump: -s -j .text +#xfail: ia64-*-* alpha-*-*ecoff m32c-*-* mips*-*-* sh-*-pe sparc*-*-coff +#xfail: tic30-*-coff tic4x-*-* tic54x-*-* +#xfail: x86_64-*-pe* x86_64-*-mingw* x86_64-*-cygwin z8k-*-* +# Breaks on ia64 due to minimum alignment of code. The section alignment +# could be increased to suit ia64 but then we'd break many coff targets +# that don't support alignment other than 4 bytes. +# alpha-linuxecoff always aligns code to 16 bytes. +# m32c pads out code sections to 8 bytes. +# mips aligns to 16 bytes +# sh-pe pads out code sections to 16 bytes +# sparc-coff aligns to 8 bytes +# tic30-coff aligns to 2 bytes +# tic4x has 4 octet bytes +# tic54x doesn't support .p2align +# x86_64-pe aligns to 16 bytes +# z8k-coff aligns to 2 bytes + +.*: file format .* + +Contents of section .text: + [0-9a-f]+ cafebabe 01010101 02020202 12232323 .* + [0-9a-f]+ 03030303 00345600 00004567 000089ab .* + [0-9a-f]+ (deadbeef|efbeadde) 00004567 000089ab 0000cdef .* + [0-9a-f]+ 00004567 000089ab 0000cdef 00000123 .* diff --git a/binutils-2.25/ld/testsuite/ld-scripts/fill.t b/binutils-2.25/ld/testsuite/ld-scripts/fill.t new file mode 100644 index 0000000..835e009 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/fill.t @@ -0,0 +1,20 @@ +SECTIONS +{ + .text : + { + . += 4; + *0.o(.text) + FILL (0x12) + *1.o(.text) + . += 1; + FILL (0x23) + *2.o(.text) + FILL (0x003456) + . += 4; + FILL (0x00004567000089ab0000cdef00000123) + . += 8; + LONG (0xdeadbeef) + . += 12; + . += 16; + } =0xcafebabe +} diff --git a/binutils-2.25/ld/testsuite/ld-scripts/fill_0.s b/binutils-2.25/ld/testsuite/ld-scripts/fill_0.s new file mode 100644 index 0000000..2494a6e --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/fill_0.s @@ -0,0 +1,2 @@ + .text + .byte 1,1,1,1 diff --git a/binutils-2.25/ld/testsuite/ld-scripts/fill_1.s b/binutils-2.25/ld/testsuite/ld-scripts/fill_1.s new file mode 100644 index 0000000..2bbb28e --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/fill_1.s @@ -0,0 +1,3 @@ + .text + .p2align 2 + .byte 2,2,2,2 diff --git a/binutils-2.25/ld/testsuite/ld-scripts/fill_2.s b/binutils-2.25/ld/testsuite/ld-scripts/fill_2.s new file mode 100644 index 0000000..0b85fb5 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/fill_2.s @@ -0,0 +1,3 @@ + .text + .p2align 2 + .byte 3,3,3,3 diff --git a/binutils-2.25/ld/testsuite/ld-scripts/include.exp b/binutils-2.25/ld/testsuite/ld-scripts/include.exp index 08fa1b6..e4ecf3c 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/include.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/include.exp @@ -1,5 +1,5 @@ # Test for proper diagnosis of overflowed memory regions. -# Copyright 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 2008-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/log2.exp b/binutils-2.25/ld/testsuite/ld-scripts/log2.exp index 43827dc..f3fd7f8 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/log2.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/log2.exp @@ -1,7 +1,6 @@ # Test LOG2() expression in linker script language. # By Clemens Lang -# Copyright 2013 -# Free Software Foundation, Inc. +# Copyright (C) 2013-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/map-address.exp b/binutils-2.25/ld/testsuite/ld-scripts/map-address.exp index 499a824..70348e9 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/map-address.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/map-address.exp @@ -1,5 +1,5 @@ # Test address printed by --print-map -# Copyright 2002, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/overlay-size.exp b/binutils-2.25/ld/testsuite/ld-scripts/overlay-size.exp index 42c4348..df3407a 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/overlay-size.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/overlay-size.exp @@ -1,5 +1,5 @@ # Test the OVERLAY statement. -# Copyright 2002, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/overlay-size.t b/binutils-2.25/ld/testsuite/ld-scripts/overlay-size.t index 0d9af35..68c0986 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/overlay-size.t +++ b/binutils-2.25/ld/testsuite/ld-scripts/overlay-size.t @@ -60,5 +60,5 @@ SECTIONS end_of_data_overlays = . ; . = 0x8000; - /DISCARD/ : { *(.reginfo) } + /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) } } diff --git a/binutils-2.25/ld/testsuite/ld-scripts/phdrs.exp b/binutils-2.25/ld/testsuite/ld-scripts/phdrs.exp index b7f3682..64ed7e4 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/phdrs.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/phdrs.exp @@ -1,7 +1,6 @@ # Test PHDRS in a linker script. # By Ian Lance Taylor, Cygnus Support. -# Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/phdrs2.exp b/binutils-2.25/ld/testsuite/ld-scripts/phdrs2.exp index b680d85..59bbd6f 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/phdrs2.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/phdrs2.exp @@ -1,5 +1,5 @@ # Test PHDRS with empty sections in a linker script. -# Copyright 2006, 2005, 2007, 2010 Free Software Foundation, Inc, +# Copyright (C) 2005-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/phdrs3.exp b/binutils-2.25/ld/testsuite/ld-scripts/phdrs3.exp index 9ab8363..e1d2e7d 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/phdrs3.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/phdrs3.exp @@ -1,6 +1,6 @@ # Test PHDRS in a linker script. # By Nathan Sidwell <nathan@codesourcery.com> -# Copyright 2009 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/pr14962-2.d b/binutils-2.25/ld/testsuite/ld-scripts/pr14962-2.d new file mode 100644 index 0000000..7dd244e --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/pr14962-2.d @@ -0,0 +1,10 @@ +#ld: -T pr14962-2.t +#source: pr14962a.s +#nm: -n +#notarget: rx-*-* frv-*-*linux* + +#... +0+2000 [AT] _start +#... +0+2000 A x +#pass diff --git a/binutils-2.25/ld/testsuite/ld-scripts/pr14962-2.t b/binutils-2.25/ld/testsuite/ld-scripts/pr14962-2.t new file mode 100644 index 0000000..f2c603b --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/pr14962-2.t @@ -0,0 +1,11 @@ +TOTO = 4096; +TOTO += 4096; + +SECTIONS +{ + .text TOTO : + { + x = ABSOLUTE(TOTO); + *(*.text) + } +} diff --git a/binutils-2.25/ld/testsuite/ld-scripts/provide.exp b/binutils-2.25/ld/testsuite/ld-scripts/provide.exp index 6db399f..a6d3514 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/provide.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/provide.exp @@ -1,7 +1,6 @@ # Test PROVIDE in a linker script. # By Nathan Sidwell, CodeSourcery LLC -# Copyright 2004, 2005, 2006, 2007 -# Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/rgn-at.exp b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at.exp index 9095273..cc31fa4 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/rgn-at.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at.exp @@ -1,5 +1,5 @@ # Test for proper diagnosis of overflowed memory regions. -# Copyright 2009 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/rgn-at10.d b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at10.d new file mode 100644 index 0000000..73ebfcc --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at10.d @@ -0,0 +1,12 @@ +#source: rgn-at10.s +#ld: -T rgn-at10.t +#objdump: -h --wide +#xfail: rx-*-* +# Test that lma is adjusted in case the section start vma is aligned and +# lma_region != region if requested by script. Make sure this works with +# non-load sections. + +#... +.* 0+10000 +0+20000 .* +.* 0+10100 +0+20100 .* +.* 0+10100 +0+20100 .* diff --git a/binutils-2.25/ld/testsuite/ld-scripts/rgn-at10.s b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at10.s new file mode 100644 index 0000000..b538205 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at10.s @@ -0,0 +1,10 @@ + .text + .long 0 + + .section .tbss,"awT",%nobits + .p2align 8 + .zero 4 + + .data + .p2align 4 + .long 0 diff --git a/binutils-2.25/ld/testsuite/ld-scripts/rgn-at10.t b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at10.t new file mode 100644 index 0000000..0aa0b27 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at10.t @@ -0,0 +1,13 @@ +MEMORY +{ + ram : ORIGIN = 0x10000, LENGTH = 0x10000 + rom : ORIGIN = 0x20000, LENGTH = 0x10000 +} + +SECTIONS +{ + .text : ALIGN_WITH_INPUT {*(.text)} > ram AT> rom + .tbss : ALIGN_WITH_INPUT {*(.tbss)} > ram AT> rom + .data : ALIGN_WITH_INPUT {*(.data)} > ram AT> rom + /DISCARD/ : {*(*)} +} diff --git a/binutils-2.25/ld/testsuite/ld-scripts/rgn-at11.d b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at11.d new file mode 100644 index 0000000..9ebbd28 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at11.d @@ -0,0 +1,11 @@ +#source: rgn-at10.s +#ld: -T rgn-at11.t +#objdump: -h --wide +#xfail: rx-*-* +# Test that lma is not adjusted in case the section start vma is aligned and +# lma_region != region if not requested by script. + +#... +.* 0+10000 +0+20000 .* +.* 0+10100 +0+20004 .* +.* 0+10100 +0+20004 .* diff --git a/binutils-2.25/ld/testsuite/ld-scripts/rgn-at11.t b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at11.t new file mode 100644 index 0000000..4f07c9d --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at11.t @@ -0,0 +1,13 @@ +MEMORY +{ + ram : ORIGIN = 0x10000, LENGTH = 0x10000 + rom : ORIGIN = 0x20000, LENGTH = 0x10000 +} + +SECTIONS +{ + .text : ALIGN_WITH_INPUT {*(.text)} > ram AT> rom + .tbss : {*(.tbss)} > ram AT> rom + .data : ALIGN_WITH_INPUT {*(.data)} > ram AT> rom + /DISCARD/ : {*(*)} +} diff --git a/binutils-2.25/ld/testsuite/ld-scripts/rgn-at9.d b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at9.d new file mode 100644 index 0000000..e6384b4 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at9.d @@ -0,0 +1,10 @@ +#source: rgn-at6.s +#ld: -T rgn-at9.t +#objdump: -h --wide +#xfail: rx-*-* +# Test that lma is adjusted in case the section start vma is aligned and +# lma_region != region if requested by script. + +#... +.* 0+10000 +0+20080 .* +.* 0+10100 +0+20180 .* diff --git a/binutils-2.25/ld/testsuite/ld-scripts/rgn-at9.t b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at9.t new file mode 100644 index 0000000..7342e64 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/rgn-at9.t @@ -0,0 +1,12 @@ +MEMORY +{ + ram : ORIGIN = 0x10000, LENGTH = 0x10000 + rom : ORIGIN = 0x20080, LENGTH = 0x10000 +} + +SECTIONS +{ + .text : ALIGN_WITH_INPUT {*(.text)} > ram AT> rom + .data : ALIGN_WITH_INPUT {*(.data)} > ram AT> rom + /DISCARD/ : {*(*)} +} diff --git a/binutils-2.25/ld/testsuite/ld-scripts/rgn-over.exp b/binutils-2.25/ld/testsuite/ld-scripts/rgn-over.exp index 8192487..881f3bf 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/rgn-over.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/rgn-over.exp @@ -1,5 +1,5 @@ # Test for proper diagnosis of overflowed memory regions. -# Copyright 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2007-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/script.exp b/binutils-2.25/ld/testsuite/ld-scripts/script.exp index 41432f9..68346e0 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/script.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/script.exp @@ -1,6 +1,6 @@ # Test basic linker script functionality # By Ian Lance Taylor, Cygnus Support -# Copyright 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/section-flags.exp b/binutils-2.25/ld/testsuite/ld-scripts/section-flags.exp index 0d36f65..f48100c 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/section-flags.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/section-flags.exp @@ -2,7 +2,7 @@ # # This file is part of the GNU Binutils. # -# Copyright 2012 Free Software Foundation, Inc. +# Copyright (C) 2012-2014 Free Software Foundation, Inc. # # 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 diff --git a/binutils-2.25/ld/testsuite/ld-scripts/section-match.exp b/binutils-2.25/ld/testsuite/ld-scripts/section-match.exp index bdca8cf..f118b65 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/section-match.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/section-match.exp @@ -1,5 +1,5 @@ # Expect script for section regular expressions tests -# Copyright (C) 2010 Free Software Foundation +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/size.exp b/binutils-2.25/ld/testsuite/ld-scripts/size.exp index 1d59158..06ffc8a 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/size.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/size.exp @@ -1,5 +1,5 @@ # Expect script for SIZEOF tests -# Copyright (C) 2004, 2005, 2007 Free Software Foundation +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/sizeof.exp b/binutils-2.25/ld/testsuite/ld-scripts/sizeof.exp index ed5d191..24003cd 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/sizeof.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/sizeof.exp @@ -1,8 +1,7 @@ # Test SIZEOF in a linker script. # By Ian Lance Taylor, Cygnus Support # Based on a bug report from anders.blomdell@control.lth.se. -# Copyright 2001, 2005, 2007 -# Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/sort.exp b/binutils-2.25/ld/testsuite/ld-scripts/sort.exp index 47950a7..7371ee8 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/sort.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/sort.exp @@ -1,7 +1,6 @@ # Test SORT_BY_NAME/SORT_BY_ALIGNMENT/SORT in a linker script. # By H.J. Lu <hongjiu.lu@intel.com> -# Copyright 2004, 2005, 2007 -# Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # diff --git a/binutils-2.25/ld/testsuite/ld-scripts/sysroot-prefix-x.s b/binutils-2.25/ld/testsuite/ld-scripts/sysroot-prefix-x.s new file mode 100644 index 0000000..9b81905 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/sysroot-prefix-x.s @@ -0,0 +1,5 @@ + .data + .globl x +x: + .dc.a y + diff --git a/binutils-2.25/ld/testsuite/ld-scripts/sysroot-prefix-y.s b/binutils-2.25/ld/testsuite/ld-scripts/sysroot-prefix-y.s new file mode 100644 index 0000000..f05ffa0 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/sysroot-prefix-y.s @@ -0,0 +1,4 @@ + .data + .globl y +y: + .dc.a 0 diff --git a/binutils-2.25/ld/testsuite/ld-scripts/sysroot-prefix.exp b/binutils-2.25/ld/testsuite/ld-scripts/sysroot-prefix.exp new file mode 100644 index 0000000..65c9f70 --- /dev/null +++ b/binutils-2.25/ld/testsuite/ld-scripts/sysroot-prefix.exp @@ -0,0 +1,190 @@ +# Copyright (C) 2014 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. + +# Check that scripts using the "=" sysroot-prefix work, for both +# toolchains with and without --sysroot support. + +# We test this by emitting archives into a subdirectory and expect +# constructs such as GROUP and AS_NEEDED (the only two constructs +# actually tested) to find them (or not); both quoted and unquoted +# paths, with different prefixes on the path and with --sysroot +# present or not, with different arguments. + +# Find out if the linker supports sysroot; if it was configured +# "--with-sysroot X" where X is a non-empty string. +set with_sysroot [check_sysroot_available] +verbose -log "Has (non-empty) sysroot support: $with_sysroot; \"$ld_sysroot\"" + +# We also need to know if the sysroot is "/" (a common use) as some of +# the tests prepend sysroot to the current directory and on most +# common systems "//dir/path" is handled as "/dir/path". +if {$ld_sysroot == "/"} { + # Use a modified test-subset for testing. + set with_sysroot 3 +} + +# Entries in the array-tables: +# 0: Testtype; an inclusive bitmask indicating that the test should run on a +# build configured for: 1: non-sysroot, 2: sysroot != "/", 4: sysroot == "/". +# 1: Description, forming part of the dejagnu test-name. +# 2: Replacement for @p@. +# 3: Option to pass to linker (usually something with --sysroot). +# 4: Message substring; a substring to match against the error message +# if an error is expected, or empty if no error is expected. +# +# If the replacement or option contains @cwd@, that'll be replaced by +# "$base_dir/tmpdir", the full path to the location of the script +# (with the actual files in the "sysroot" subdirectory). If the +# description contains @cwd@, that will be replaced by "<CWD>". + +set sysroot_prefix_tests { + {7 "plain -Lpath" "sysroot/" {} ""} + {7 "root-anchored but -Lpath" "/sysroot/" {} "cannot find"} + {7 "full-path" "@cwd@/sysroot/" {} ""} + {7 "root-anchored =-prefixed -Lpath" "=/sysroot/" {} "cannot find"} + {7 "full-path =-prefixed with empty" "=@cwd@/sysroot/" "--sysroot=" ""} + {7 "plain =-prefixed with empty" "=sysroot/" "--sysroot=" ""} + {6 "root-anchored but script outside sysroot" "/" "--sysroot=@cwd@/sysroot" "cannot find"} + {6 "root-anchored and script inside sysroot" "/sysroot/" "--sysroot=@cwd@" ""} + {6 "root-anchored =-prefixed script outside" "=/" "--sysroot=@cwd@/sysroot" ""} + {6 "root-anchored =-prefixed script inside" "=/sysroot/" "--sysroot=@cwd@" ""} + {2 "plain =-prefixed without but -Lpath" "=sysroot/" {} "cannot find"} + {2 "full-path =-prefixed without" "=@cwd@/sysroot/" {} "cannot find"} + {1 "plain =-prefixed -Lpath" "=sysroot/" {} ""} + {1 "full-path =-prefixed without" "=@cwd@/sysroot/" {} ""} +} + +# May have to provide a target-specific assembler option for some targets. +set gasopt "" + +# Intentionally similar to the ubiquitous glibc libc.so script. +set template "GROUP ( @q@@p@tmp/ldtest-xyzzy/libx.a@q@ AS_NEEDED ( @q@@p@tmp/ldtest-xyzzy/liby.a@q@ ) )" + +# Set up everything from the variables above. +proc sysroot_prefix_test_setup { } { + global as gasopt srcdir subdir ar + + if {![ld_assemble_flags $as $gasopt $srcdir/$subdir/pr14962a.s tmpdir/main.o]} { + error "Error assembling a trivial file for sysroot-prefix tests framework" + return 0 + } + + # We need somewhere under tmpdir to point the sysroot, a subdirectory + # that is benevolent if it escapes into "/". + remote_exec host "mkdir -p tmpdir/sysroot/tmp/ldtest-xyzzy" + + # 0: a "main" object that needs a symbol (x) (most portably by + # using a pre-existing file). 1: a library with an object that + # provides that symbol and needs another one (y). 2: another + # library with a third object providing that other symbol. + set sysroot_prefix_tests_framework_objects { + {"pr14962a.s" "main" ""} + {"sysroot-prefix-x.s" "x" "x"} + {"sysroot-prefix-y.s" "y" "y"} + } + + foreach test_object $sysroot_prefix_tests_framework_objects { + set sname [lindex $test_object 0] + set onamebase [lindex $test_object 1] + set oname "tmpdir/$onamebase.o" + set libnamebase [lindex $test_object 2] + + if ![ld_assemble_flags $as $gasopt $srcdir/$subdir/$sname $oname] { + error "Error assembling trivial file $sname for sysroot-prefix tests framework" + return 0 + } + + if { [string length $libnamebase] != 0 && + ![ar_simple_create $ar "" tmpdir/sysroot/tmp/ldtest-xyzzy/lib$libnamebase.a $oname] } { + error "Error creating archive $libnamebase for sysroot-prefix tests framework" + return 0 + } + } + + return 1 +} + +# Run a single linker test. +proc single_sysroot_prefix_test { type xtestname finalscript ldopt errstr } { + global ld exec_output with_sysroot + set scriptname "tmpdir/libsysroottest.a" + set testname "sysroot-prefix $xtestname" + + if { ($type & ($with_sysroot + 1)) == 0 } { + unsupported $testname + return + } + + if [catch { set ofd [open $scriptname w] } x] { + perror "$x" + unresolved $testname + return + } + + puts $ofd "$finalscript" + close $ofd + verbose -log "script: $finalscript" + + set res [ld_simple_link $ld tmpdir/output "$ldopt tmpdir/main.o -Ltmpdir -lsysroottest"] + set ld_output "$exec_output" + set expect_success [expr [string length $errstr] == 0] + + if { $res == $expect_success && + ($expect_success || [regexp "$errstr" $ld_output]) } { + pass $testname + catch "exec rm -f $scriptname" + } { + fail $testname + } +} + +# Run all interesting variants from an option-and-path combination. +proc run_sysroot_prefix_test { type name templ p ldopt errstr } { + global base_dir + set qlist { { "quoted" "\"" } { "unquoted" {} } } + + regsub -all "@p@" $templ $p templ + regsub -all "@cwd@" $templ "$base_dir/tmpdir" templ + regsub -all "@cwd@" $ldopt "$base_dir/tmpdir" ldopt + regsub -all "@cwd@" $name "<CWD>" name + + foreach qitems $qlist { + regsub -all "@q@" $templ [lindex $qitems 1] finalscript + single_sysroot_prefix_test $type "$name, [lindex $qitems 0]" \ + $finalscript $ldopt $errstr + } +} + +# Run a list of option-and-path test-combinations. +proc run_sysroot_prefix_tests { descr templ items } { + foreach item $items { + set type [lindex $item 0] + set name [lindex $item 1] + set p [lindex $item 2] + set ldopt [lindex $item 3] + set errstr [lindex $item 4] + run_sysroot_prefix_test $type "$descr $name" $templ "$p" "$ldopt" "$errstr" + } +} + +if ![sysroot_prefix_test_setup] { + return +} + +run_sysroot_prefix_tests "common" $template $sysroot_prefix_tests diff --git a/binutils-2.25/ld/testsuite/ld-scripts/weak.exp b/binutils-2.25/ld/testsuite/ld-scripts/weak.exp index cba6e25..39a49f5 100644 --- a/binutils-2.25/ld/testsuite/ld-scripts/weak.exp +++ b/binutils-2.25/ld/testsuite/ld-scripts/weak.exp @@ -1,7 +1,6 @@ # Test weak symbols. # By Ian Lance Taylor, Cygnus Solutions. -# Copyright 1999, 2000, 2002, 2004, 2005, 2006, 2007, 2009, 2011 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -34,8 +33,8 @@ if {! [istarget i?86-*-*] && ! [istarget sh-*-*]} { setup_xfail *-*-pe* } -# hppa64 and or32 are incredibly broken -setup_xfail hppa64-*-* or32-*-* +# hppa64 is incredibly broken +setup_xfail hppa64-*-* if {! [ld_assemble $as $srcdir/$subdir/weak1.s tmpdir/weak1.o] || ! [ld_assemble $as $srcdir/$subdir/weak2.s tmpdir/weak2.o]} then { |