From: Richard Sandiford Date: Wed, 28 Mar 2007 14:42:28 +0000 (+0000) Subject: ld/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c76308d222c1144f80f5cd36e8c69952a2594d0a;p=binutils-gdb.git 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. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 5c0b3920fec..372a5d2179c 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,19 @@ +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 diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 1646d2ebf3d..e7ed2bdf98e 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 349fa548c57..b03419fe3fc 100644 --- a/ld/emultempl/vxworks.em +++ b/ld/emultempl/vxworks.em @@ -6,6 +6,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 00000000000..df67a03ac42 --- /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 00000000000..6218588e1d7 --- /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 00000000000..e33e7613e17 --- /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] + } + } +}