From 2e095083515b4033f4fa9e2d567527b64db3c2a4 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 1 Sep 2010 08:05:15 +0000 Subject: [PATCH] * ld-scripts/section-match.exp: New file. Runs ths section-match-1 test. * ld-scripts/section-match-1.d: New file. * ld-scripts/section-match-1.s: New file. * ld-scripts/section-match-1.t: New file. --- ld/testsuite/ChangeLog | 8 ++++++++ ld/testsuite/ld-scripts/section-match-1.d | 16 ++++++++++++++++ ld/testsuite/ld-scripts/section-match-1.s | 5 +++++ ld/testsuite/ld-scripts/section-match-1.t | 16 ++++++++++++++++ ld/testsuite/ld-scripts/section-match.exp | 22 ++++++++++++++++++++++ 5 files changed, 67 insertions(+) create mode 100644 ld/testsuite/ld-scripts/section-match-1.d create mode 100644 ld/testsuite/ld-scripts/section-match-1.s create mode 100644 ld/testsuite/ld-scripts/section-match-1.t create mode 100644 ld/testsuite/ld-scripts/section-match.exp diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 85063c330..e9e202536 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2010-08-31 Nick Clifton + + * ld-scripts/section-match.exp: New file. Runs ths + section-match-1 test. + * ld-scripts/section-match-1.d: New file. + * ld-scripts/section-match-1.s: New file. + * ld-scripts/section-match-1.t: New file. + 2010-08-25 Julian Brown * ld-arm/arm-elf.exp (armelftests): Add cortex-a8-fix-blx-bcond.s. diff --git a/ld/testsuite/ld-scripts/section-match-1.d b/ld/testsuite/ld-scripts/section-match-1.d new file mode 100644 index 000000000..9d8144df3 --- /dev/null +++ b/ld/testsuite/ld-scripts/section-match-1.d @@ -0,0 +1,16 @@ +#source: section-match-1.s +#ld: -T section-match-1.t +#objdump: -s +#notarget: *-*-osf* *-*-aix* *-*-pe *-*-aout *-*-ecoff *-*-netbsd *-*-vms h8300-*-* +# This test uses arbitary section names, which are not support by some +# file formts. Also these section names must be present in the +# output, not translated into some other name, eg .text + +.*: file format .* + +#... +Contents of section \.secA: + [0-9a-f]* (01)?0+(01)? .* +Contents of section \.secC: + [0-9a-f]* (02)?0+(02)? .* +#pass diff --git a/ld/testsuite/ld-scripts/section-match-1.s b/ld/testsuite/ld-scripts/section-match-1.s new file mode 100644 index 000000000..3e32a8869 --- /dev/null +++ b/ld/testsuite/ld-scripts/section-match-1.s @@ -0,0 +1,5 @@ + .section .sec.foo + .word 1 + + .section .sec..foo + .word 2 diff --git a/ld/testsuite/ld-scripts/section-match-1.t b/ld/testsuite/ld-scripts/section-match-1.t new file mode 100644 index 000000000..155b3dce6 --- /dev/null +++ b/ld/testsuite/ld-scripts/section-match-1.t @@ -0,0 +1,16 @@ +SECTIONS +{ + /* .secA should collect all sections with a prefix of ".sec." + except for those with a prefix of ".sec..". */ + .secA : { *(*.sec.[^.]*) } + + /* .secB should be empty because .secA will have taken all of + the potential matches. */ + .secB : { *(*.sec.[!.]*) } + + /* .secC should match any sections with a ".sec.." prefix. */ + .secC : { *(*.sec.*) } + + /* Ignore anything else. */ + /DISCARD/ : { *(*) } +} diff --git a/ld/testsuite/ld-scripts/section-match.exp b/ld/testsuite/ld-scripts/section-match.exp new file mode 100644 index 000000000..bdca8cfc8 --- /dev/null +++ b/ld/testsuite/ld-scripts/section-match.exp @@ -0,0 +1,22 @@ +# Expect script for section regular expressions tests +# Copyright (C) 2010 Free Software Foundation +# +# 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. +# + +run_dump_test section-match-1 \ No newline at end of file -- 2.11.4.GIT