From c76308d222c1144f80f5cd36e8c69952a2594d0a Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 28 Mar 2007 14:42:28 +0000 Subject: [PATCH] ld/ * ld.h (ld_config_type): Add rpath_separator. * ldmain.c (main): Initialize it. * lexsup.c (parse_args): Honor config.rpath_separator. * emultempl/elf32.em (gld${EMULATION_NAME}_search_needed): Likewise. (gld${EMULATION_NAME}_add_sysroot): Likewise. (gld${EMULATION_NAME}_parse_ld_so_conf): Use config.rpath_separator rather than ':' when building the path. * emultempl/vxworks.em (vxworks_before_parse): New function. Override config.rpath_separator. (LDEMUL_AFTER_OPEN): Do not change if EXTRA_EM_FILE has been set to gld${EMULATION_NAME}_after_open; #define that identifier to vxworks_foo instead. (LDEMUL_BEFORE_PARSE): Override in the same way as LDEMUL_AFTER_OPEN. ld/testsuite/ * ld-vxworks/rpath-1.s, ld-vxworks/rpath-1.d, * ld-vxworks/vxworks.exp: New files. --- ld/ChangeLog | 16 ++++++++++++++++ ld/emultempl/elf32.em | 11 ++++++----- ld/emultempl/vxworks.em | 32 +++++++++++++++++++++++++++++++- ld/ld.h | 3 +++ ld/ldmain.c | 1 + ld/lexsup.c | 17 ++++++++--------- ld/testsuite/ChangeLog | 5 +++++ ld/testsuite/ld-vxworks/rpath-1.d | 6 ++++++ ld/testsuite/ld-vxworks/rpath-1.s | 2 ++ ld/testsuite/ld-vxworks/vxworks.exp | 24 ++++++++++++++++++++++++ 10 files changed, 102 insertions(+), 15 deletions(-) create mode 100644 ld/testsuite/ld-vxworks/rpath-1.d create mode 100644 ld/testsuite/ld-vxworks/rpath-1.s create mode 100644 ld/testsuite/ld-vxworks/vxworks.exp diff --git a/ld/ChangeLog b/ld/ChangeLog index 5c0b392..372a5d2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,4 +1,20 @@ 2007-03-28 Richard Sandiford + + * ld.h (ld_config_type): Add rpath_separator. + * ldmain.c (main): Initialize it. + * lexsup.c (parse_args): Honor config.rpath_separator. + * emultempl/elf32.em (gld${EMULATION_NAME}_search_needed): Likewise. + (gld${EMULATION_NAME}_add_sysroot): Likewise. + (gld${EMULATION_NAME}_parse_ld_so_conf): Use config.rpath_separator + rather than ':' when building the path. + * emultempl/vxworks.em (vxworks_before_parse): New function. + Override config.rpath_separator. + (LDEMUL_AFTER_OPEN): Do not change if EXTRA_EM_FILE has been + set to gld${EMULATION_NAME}_after_open; #define that identifier + to vxworks_foo instead. + (LDEMUL_BEFORE_PARSE): Override in the same way as LDEMUL_AFTER_OPEN. + +2007-03-28 Richard Sandiford Phil Edwards * ld.texinfo: Put the contents after the title page rather diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 1646d2e..e7ed2bd 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -459,7 +459,7 @@ gld${EMULATION_NAME}_search_needed (const char *path, { char *filename, *sset; - s = strchr (path, ':'); + s = strchr (path, config.rpath_separator); if (s == NULL) s = path + strlen (path); @@ -492,7 +492,8 @@ EOF if [ "x${USE_LIBPATH}" = xyes ] ; then cat >>e${EMULATION_NAME}.c <alloc += p - dir + 256; info->path = xrealloc (info->path, info->alloc); } - info->path[info->len++] = ':'; + info->path[info->len++] = config.rpath_separator; } memcpy (info->path + info->len, dir, p - dir); info->len += p - dir; diff --git a/ld/emultempl/vxworks.em b/ld/emultempl/vxworks.em index 349fa54..b03419f 100644 --- a/ld/emultempl/vxworks.em +++ b/ld/emultempl/vxworks.em @@ -7,6 +7,13 @@ cat >>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c < + + * ld-vxworks/rpath-1.s, ld-vxworks/rpath-1.d, + * ld-vxworks/vxworks.exp: New files. + 2007-03-27 Alan Modra * ld-elf/note-1.s: Increase .foo size. diff --git a/ld/testsuite/ld-vxworks/rpath-1.d b/ld/testsuite/ld-vxworks/rpath-1.d new file mode 100644 index 0000000..df67a03 --- /dev/null +++ b/ld/testsuite/ld-vxworks/rpath-1.d @@ -0,0 +1,6 @@ +# source: rpath-1.s +# ld: --entry foo --rpath /dir1 --rpath /dir2 --rpath net:/dir4 --rpath /dir2 --rpath /dir1 --rpath /dir3 --force-dynamic -q +# readelf: -d +#... + 0x0+f \(RPATH\).*Library rpath: \[/dir1;/dir2;net:/dir4;/dir3\] +#pass diff --git a/ld/testsuite/ld-vxworks/rpath-1.s b/ld/testsuite/ld-vxworks/rpath-1.s new file mode 100644 index 0000000..6218588 --- /dev/null +++ b/ld/testsuite/ld-vxworks/rpath-1.s @@ -0,0 +1,2 @@ + .global foo +foo: diff --git a/ld/testsuite/ld-vxworks/vxworks.exp b/ld/testsuite/ld-vxworks/vxworks.exp new file mode 100644 index 0000000..e33e761 --- /dev/null +++ b/ld/testsuite/ld-vxworks/vxworks.exp @@ -0,0 +1,24 @@ +# Expect script for VxWorks tests +# Copyright 2007 Free Software Foundation, Inc. +# +# This file 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 2 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. + +if { [istarget *-*-vxworks*] } { + foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.d]] { + if { [runtest_file_p $runtests $test] } { + run_dump_test [file rootname $test] + } + } +} -- 2.7.4