rpath-link on Windows

Ryan Mansfield rmansfield@qnx.com
Wed Oct 21 17:47:00 GMT 2009


Dave Korn wrote:
> Ryan Mansfield wrote:
> 
>> + #if defined (__MSDOS__) || defined (_WIN32)
> 
>   Shouldn't you rely on HAVE_DOS_BASED_FILE_SYSTEM here?

Yep, thanks for pointing that out. Here's the updated diff:

Index: elf32.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/elf32.em,v
retrieving revision 1.204
diff -c -3 -p -r1.204 elf32.em
*** elf32.em    23 Sep 2009 13:54:28 -0000      1.204
--- elf32.em    21 Oct 2009 17:47:07 -0000
*************** fragment <<EOF
*** 58,63 ****
--- 58,64 ----
   #include <ldgram.h>
   #include "elf/common.h"
   #include "elf-bfd.h"
+ #include "filenames.h"

   /* Declare functions used by various EXTRA_EM_FILEs.  */
   static void gld${EMULATION_NAME}_before_parse (void);
*************** gld${EMULATION_NAME}_search_needed (cons
*** 471,476 ****
--- 472,487 ----
         s = strchr (path, config.rpath_separator);
         if (s == NULL)
         s = path + strlen (path);
+
+ #if HAVE_DOS_BASED_FILE_SYSTEM
+       /* Assume a match on the second char is part of drive specifier */
+       if (config.rpath_separator == ':' && s == path + 1 && ISALPHA 
(*path))
+       {
+         s = strchr (s + 1, config.rpath_separator);
+         if (s == NULL)
+           s = path + strlen (path);
+       }
+ #endif

         filename = (char *) xmalloc (s - path + len + 2);
         if (s == path)

Regards,

Ryan Mansfield



More information about the Binutils mailing list