Index: ld-scripts/section-flags-1.s =================================================================== RCS file: ld-scripts/section-flags-1.s diff -N ld-scripts/section-flags-1.s --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld-scripts/section-flags-1.s 22 Jun 2011 21:07:53 -0000 @@ -0,0 +1,2 @@ + .text + .space 16 Index: ld-scripts/section-flags-1.t =================================================================== RCS file: ld-scripts/section-flags-1.t diff -N ld-scripts/section-flags-1.t --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld-scripts/section-flags-1.t 22 Jun 2011 21:07:53 -0000 @@ -0,0 +1,17 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x100000, LENGTH = 144M +} + +SECTIONS +{ + .text : + { + INPUT_SECTION_FLAGS (!SHF_TLS) *(.text .text.* .text_* .gnu.linkonce.t.*) + } >ram + + .text_vle : + { + INPUT_SECTION_FLAGS (SHF_MERGE & SHF_STRINGS & SHF_LINK_ORDER) *(.text .text.* .text_* .gnu.linkonce.t.*) + } >ram +} Index: ld-scripts/section-flags-2.s =================================================================== RCS file: ld-scripts/section-flags-2.s diff -N ld-scripts/section-flags-2.s --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld-scripts/section-flags-2.s 22 Jun 2011 21:07:53 -0000 @@ -0,0 +1,2 @@ + .text + .space 16 Index: ld-scripts/section-flags-2.t =================================================================== RCS file: ld-scripts/section-flags-2.t diff -N ld-scripts/section-flags-2.t --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld-scripts/section-flags-2.t 22 Jun 2011 21:07:53 -0000 @@ -0,0 +1,12 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x100000, LENGTH = 144M +} + +SECTIONS +{ + .text : + { + INPUT_SECTION_FLAGS (!SHF_TLS) *(EXCLUDE_FILE (section-flags-1.o) .text .text.* .text_* .gnu.linkonce.t.*) + } >ram +} Index: ld-scripts/section-flags.exp =================================================================== RCS file: ld-scripts/section-flags.exp diff -N ld-scripts/section-flags.exp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ld-scripts/section-flags.exp 22 Jun 2011 21:07:53 -0000 @@ -0,0 +1,45 @@ +# Test SECTION_FLAGS in a linker script. +# +# 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. + +set testname "SECTION_FLAGS-1" + +if ![ld_assemble $as $srcdir/$subdir/section-flags-1.s tmpdir/section-flags-1.o] { + unresolved $testname + return +} + +if ![ld_simple_link $ld tmpdir/section-flags-1 "-T $srcdir/$subdir/section-flags-1.t tmpdir/section-flags-1.o"] { + fail $testname + return +} + +pass $testname + +set testname "SECTION_FLAGS-2" +if ![ld_assemble $as $srcdir/$subdir/section-flags-2.s tmpdir/section-flags-2.o] { + unresolved $testname + return +} + +if ![ld_simple_link $ld tmpdir/section-flags-2 "-T $srcdir/$subdir/section-flags-2.t tmpdir/section-flags-1.o tmpdir/section-flags-2.o"] { + fail $testname + return +} + +pass $testname