From e9dfee340cc44e525f140d10d569c2306439134b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 18 Mar 2009 12:11:38 +0000 Subject: [PATCH] ld/ 2009-03-18 H.J. Lu PR ld/6766 * lexsup.c (parse_args): Call ldlang_add_undef for -e. ld/testsuite/ 2009-03-18 H.J. Lu PR ld/6766 * ld-undefined/dummy.s: New. * ld-undefined/entry-1.d: Likewise. * ld-undefined/entry-2.d: Likewise. * ld-undefined/entry-3.d: Likewise. * ld-undefined/entry-4.d: Likewise. * ld-undefined/entry-5.d: Likewise. * ld-undefined/entry-6.d: Likewise. * ld-undefined/entry.exp: Likewise. * ld-undefined/entry.s: Likewise. --- ld/ChangeLog | 5 +++++ ld/lexsup.c | 1 + ld/testsuite/ChangeLog | 13 +++++++++++ ld/testsuite/ld-undefined/dummy.s | 2 ++ ld/testsuite/ld-undefined/entry-1.d | 8 +++++++ ld/testsuite/ld-undefined/entry-2.d | 8 +++++++ ld/testsuite/ld-undefined/entry-3.d | 9 ++++++++ ld/testsuite/ld-undefined/entry-4.d | 9 ++++++++ ld/testsuite/ld-undefined/entry-5.d | 8 +++++++ ld/testsuite/ld-undefined/entry-6.d | 8 +++++++ ld/testsuite/ld-undefined/entry.exp | 35 +++++++++++++++++++++++++++++ ld/testsuite/ld-undefined/entry.s | 4 ++++ 12 files changed, 110 insertions(+) create mode 100644 ld/testsuite/ld-undefined/dummy.s create mode 100644 ld/testsuite/ld-undefined/entry-1.d create mode 100644 ld/testsuite/ld-undefined/entry-2.d create mode 100644 ld/testsuite/ld-undefined/entry-3.d create mode 100644 ld/testsuite/ld-undefined/entry-4.d create mode 100644 ld/testsuite/ld-undefined/entry-5.d create mode 100644 ld/testsuite/ld-undefined/entry-6.d create mode 100644 ld/testsuite/ld-undefined/entry.exp create mode 100644 ld/testsuite/ld-undefined/entry.s diff --git a/ld/ChangeLog b/ld/ChangeLog index 3af7ecf7df5..4e28d97a341 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2009-03-18 H.J. Lu + + PR ld/6766 + * lexsup.c (parse_args): Call ldlang_add_undef for -e. + 2009-03-18 Alan Modra * ld.h: Remove alloca handling. diff --git a/ld/lexsup.c b/ld/lexsup.c index 4dcfc3c6539..3ddde61c4ab 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -818,6 +818,7 @@ parse_args (unsigned argc, char **argv) break; case 'e': lang_add_entry (optarg, TRUE); + ldlang_add_undef (optarg); break; case 'f': if (command_line.auxiliary_filters == NULL) diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 551509ef825..f50755fc3b6 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2009-03-18 H.J. Lu + + PR ld/6766 + * ld-undefined/dummy.s: New. + * ld-undefined/entry-1.d: Likewise. + * ld-undefined/entry-2.d: Likewise. + * ld-undefined/entry-3.d: Likewise. + * ld-undefined/entry-4.d: Likewise. + * ld-undefined/entry-5.d: Likewise. + * ld-undefined/entry-6.d: Likewise. + * ld-undefined/entry.exp: Likewise. + * ld-undefined/entry.s: Likewise. + 2009-03-17 Alan Modra * ld-spu/icache1.d: Update for fixed set_id, new manager entry, and diff --git a/ld/testsuite/ld-undefined/dummy.s b/ld/testsuite/ld-undefined/dummy.s new file mode 100644 index 00000000000..328ba7453e6 --- /dev/null +++ b/ld/testsuite/ld-undefined/dummy.s @@ -0,0 +1,2 @@ + .text + .byte 0 diff --git a/ld/testsuite/ld-undefined/entry-1.d b/ld/testsuite/ld-undefined/entry-1.d new file mode 100644 index 00000000000..551042efe5d --- /dev/null +++ b/ld/testsuite/ld-undefined/entry-1.d @@ -0,0 +1,8 @@ +#name: --entry foo archive +#source: dummy.s +#ld: --entry foo tmpdir/libentry.a +#nm: -n + +#... +[0-9a-f]+ T +foo +#... diff --git a/ld/testsuite/ld-undefined/entry-2.d b/ld/testsuite/ld-undefined/entry-2.d new file mode 100644 index 00000000000..9122313fda3 --- /dev/null +++ b/ld/testsuite/ld-undefined/entry-2.d @@ -0,0 +1,8 @@ +#name: --entry foo -u foo archive +#source: dummy.s +#ld: --entry foo -u foo tmpdir/libentry.a +#nm: -n + +#... +[0-9a-f]+ T +foo +#... diff --git a/ld/testsuite/ld-undefined/entry-3.d b/ld/testsuite/ld-undefined/entry-3.d new file mode 100644 index 00000000000..184f4788a0c --- /dev/null +++ b/ld/testsuite/ld-undefined/entry-3.d @@ -0,0 +1,9 @@ +#name: -shared --entry foo archive +#source: dummy.s +#ld: -shared --entry foo tmpdir/libentry.a +#nm: -n +#target: *-*-linux* + +#... +[0-9a-f]+ T +foo +#... diff --git a/ld/testsuite/ld-undefined/entry-4.d b/ld/testsuite/ld-undefined/entry-4.d new file mode 100644 index 00000000000..44006aa85c6 --- /dev/null +++ b/ld/testsuite/ld-undefined/entry-4.d @@ -0,0 +1,9 @@ +#name: -shared --entry foo -u foo archive +#source: dummy.s +#ld: -shared --entry foo -u foo tmpdir/libentry.a +#nm: -n +#target: *-*-linux* + +#... +[0-9a-f]+ T +foo +#... diff --git a/ld/testsuite/ld-undefined/entry-5.d b/ld/testsuite/ld-undefined/entry-5.d new file mode 100644 index 00000000000..fc36e822d5d --- /dev/null +++ b/ld/testsuite/ld-undefined/entry-5.d @@ -0,0 +1,8 @@ +#name: --entry foo +#source: entry.s +#ld: --entry foo +#nm: -n + +#... +[0-9a-f]+ T +foo +#... diff --git a/ld/testsuite/ld-undefined/entry-6.d b/ld/testsuite/ld-undefined/entry-6.d new file mode 100644 index 00000000000..c013a1af81c --- /dev/null +++ b/ld/testsuite/ld-undefined/entry-6.d @@ -0,0 +1,8 @@ +#name: --entry foo -u foo +#source: entry.s +#ld: --entry foo -u foo +#nm: -n + +#... +[0-9a-f]+ T +foo +#... diff --git a/ld/testsuite/ld-undefined/entry.exp b/ld/testsuite/ld-undefined/entry.exp new file mode 100644 index 00000000000..76e50f85547 --- /dev/null +++ b/ld/testsuite/ld-undefined/entry.exp @@ -0,0 +1,35 @@ +# Expect script for ld --entry tests +# Copyright (C) 2009 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. +# + +set build_tests { + {"Build libentry.a" + "" "" + {entry.s} {} "libentry.a"} +} + +run_ld_link_tests $build_tests + +set test_list [lsort [glob -nocomplain $srcdir/$subdir/entry*.d]] +foreach t $test_list { + # We need to strip the ".d", but can leave the dirname. + verbose [file rootname $t] + run_dump_test [file rootname $t] +} diff --git a/ld/testsuite/ld-undefined/entry.s b/ld/testsuite/ld-undefined/entry.s new file mode 100644 index 00000000000..4a70181776f --- /dev/null +++ b/ld/testsuite/ld-undefined/entry.s @@ -0,0 +1,4 @@ + .text + .globl foo +foo: + .byte 0 -- 2.30.2