aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-10-23 01:21:12 +0000
committerAlan Modra <amodra@gmail.com>2009-10-23 01:21:12 +0000
commit07f1e47a64cf333e0484c235be7a91f7d62732e2 (patch)
tree610ab9718f78f1de26d7b43357f3828f49de85bb /ld/emultempl
parentf282425ecda29faaa48f6ca88a4d457239d5fbb0 (diff)
downloadgdb-07f1e47a64cf333e0484c235be7a91f7d62732e2.zip
gdb-07f1e47a64cf333e0484c235be7a91f7d62732e2.tar.gz
gdb-07f1e47a64cf333e0484c235be7a91f7d62732e2.tar.bz2
PR ld/10489
* emultempl/elf32.em (gld${EMULATION_NAME}_search_needed): Handle drive specifiers for DOS based filesystems in rpath-link strings.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf32.em12
1 files changed, 12 insertions, 0 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index f7b70ac..6df6d0f 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -58,6 +58,7 @@ fragment <<EOF
#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);
@@ -472,6 +473,17 @@ gld${EMULATION_NAME}_search_needed (const char *path,
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. */
+ else 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)
sset = filename;