aboutsummaryrefslogtreecommitdiff
path: root/ld/emulparams
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-01-15 12:53:04 -0800
committerH.J. Lu <hjl.tools@gmail.com>2014-01-15 20:09:09 -0800
commitf6f6c6790a0f3704575b9e9c87cf55baf215eef3 (patch)
tree003e7123e7d69b64273fef9ee173633f04f3e31f /ld/emulparams
parent6fcc66ab70d67efb1a8b96532b5eb96883caa727 (diff)
downloadgdb-f6f6c6790a0f3704575b9e9c87cf55baf215eef3.zip
gdb-f6f6c6790a0f3704575b9e9c87cf55baf215eef3.tar.gz
gdb-f6f6c6790a0f3704575b9e9c87cf55baf215eef3.tar.bz2
Skip directories with LIBPATH_SUFFIX_SKIP suffix
On Linux/x86-64, when binutils is configured with --libdir=/usr/lib64, genscripts.sh treats /usr/lib64 as the default search directory. It puts /usr/lib64 in linker scripts for all emulations, like --- /* Script for -z combreloc: combine and sort reloc sections */ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) ENTRY(_start) SEARCH_DIR("/usr/x86_64-redhat-linux/lib32"); SEARCH_DIR("/usr/i386-redhat-linux/lib32"); SEARCH_DIR("/usr/lib6432"); SEARCH_DIR("/usr/local/lib32"); SEARCH_DIR("/lib32"); SEARCH_DIR("/usr/lib32"); SEARCH_DIR("/usr/i386-redhat-linux/lib"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); --- /usr/lib6432 is odd and /usr/lib64 is wrong. This patch changes genscripts.sh to check LIBPATH_SUFFIX_SKIP if it is defined. It skips directories with LIBPATH_SUFFIX_SKIP suffix. PR ld/16456 * genscripts.sh: Don't search directory with LIBPATH_SUFFIX_SKIP suffix. * emulparams/elf32_x86_64.sh (LIBPATH_SUFFIX_SKIP): Set to 64 for elf32_x86_64 emulation. * emulparams/elf_i386.sh (LIBPATH_SUFFIX_SKIP): Set to 64 for elf_i386 emulation.
Diffstat (limited to 'ld/emulparams')
-rw-r--r--ld/emulparams/elf32_x86_64.sh9
-rw-r--r--ld/emulparams/elf_i386.sh5
2 files changed, 11 insertions, 3 deletions
diff --git a/ld/emulparams/elf32_x86_64.sh b/ld/emulparams/elf32_x86_64.sh
index d34297b..11d17ad 100644
--- a/ld/emulparams/elf32_x86_64.sh
+++ b/ld/emulparams/elf32_x86_64.sh
@@ -29,8 +29,13 @@ fi
case "$target" in
x86_64*-linux*|i[3-7]86-*-linux-*)
case "$EMULATION_NAME" in
- *32*) LIBPATH_SUFFIX=x32 ;;
- *64*) LIBPATH_SUFFIX=64 ;;
+ *32*)
+ LIBPATH_SUFFIX=x32
+ LIBPATH_SUFFIX_SKIP=64
+ ;;
+ *64*)
+ LIBPATH_SUFFIX=64
+ ;;
esac
;;
esac
diff --git a/ld/emulparams/elf_i386.sh b/ld/emulparams/elf_i386.sh
index add700f..93f1992 100644
--- a/ld/emulparams/elf_i386.sh
+++ b/ld/emulparams/elf_i386.sh
@@ -19,7 +19,10 @@ IREL_IN_PLT=
case "$target" in
x86_64*-linux* | i[3-7]86*-linux*)
case "$EMULATION_NAME" in
- *i386*) LIBPATH_SUFFIX=32 ;;
+ *i386*)
+ LIBPATH_SUFFIX=32
+ LIBPATH_SUFFIX_SKIP=64
+ ;;
esac
;;
esac