This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

SEARCH_DIR and path with '@'


While building an arm-elf cross-compiler hosted on HP-UX, arm-elf-ld
gives the error:
  built in linker script:6: ignoring invalid character `@' in expression

This is because the path used contains a `@'. I initially thought this
was coming from the paths used in SEARCH_DIR() in
$prefix/arm-elf/lib/ldscripts but removing the `@' in all paths did
not solve the problem. Running a strings on the ld binary reveals some
SEARCH_DIR() commands in the binary.

So, I quoted the path with the patch below. It's against 2.12.

2002-03-20  Albert Chin-A-Young  <china@thewrittenword.com>

	* ld/genscripts.sh: Quote path in SEARCH_DIR to preserve
	special characters.

-- 
albert chin (china@thewrittenword.com)

-- snip snip
--- ld/genscripts.sh.orig	Wed Mar 20 20:18:22 2002
+++ ld/genscripts.sh	Wed Mar 20 20:18:38 2002
@@ -69,7 +69,7 @@
 # Always search $(tooldir)/lib, aka /usr/local/TARGET/lib.
 LIB_PATH=${LIB_PATH}:${tool_lib}
 
-LIB_SEARCH_DIRS=`echo ${LIB_PATH} | tr ':' ' ' | sed -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\1);/g'`
+LIB_SEARCH_DIRS=`echo ${LIB_PATH} | tr ':' ' ' | sed -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'`
 
 # Generate 5 or 6 script files from a master script template in
 # ${srcdir}/scripttempl/${SCRIPT_NAME}.sh.  Which one of the 5 or 6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]