summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2016-01-18 21:40:20 +0000
committerimp <imp@FreeBSD.org>2016-01-18 21:40:20 +0000
commit9d34214affb9f2762d53c4b2a0482decd34a808f (patch)
tree1db15fbb9a833cc0b518989e7f405e6a12d57778 /libexec/rtld-elf
parent4e5086551d319f9c7fe728a3eab713a1d1bfbcb3 (diff)
downloadFreeBSD-src-9d34214affb9f2762d53c4b2a0482decd34a808f.zip
FreeBSD-src-9d34214affb9f2762d53c4b2a0482decd34a808f.tar.gz
Restore ABI variants now that ldconfig groks -soft. In addition, as a
transition mechanism, if we don't have /usr/libsoft, assume that soft float ABI binaries are the default, so treat them as default binaries. When we've fully transitioned, it will make no sense to do this stat, and it will be removed.
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r--libexec/rtld-elf/arm/reloc.c19
-rw-r--r--libexec/rtld-elf/paths.h2
-rw-r--r--libexec/rtld-elf/rtld.c2
3 files changed, 16 insertions, 7 deletions
diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c
index 6bdda73..286e493 100644
--- a/libexec/rtld-elf/arm/reloc.c
+++ b/libexec/rtld-elf/arm/reloc.c
@@ -3,6 +3,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/stat.h>
#include <sys/mman.h>
#include <errno.h>
@@ -21,6 +22,7 @@ void
arm_abi_variant_hook(Elf_Auxinfo **aux_info)
{
Elf_Word ehdr;
+ struct stat sb;
/*
* If we're running an old kernel that doesn't provide any data fail
@@ -38,12 +40,19 @@ arm_abi_variant_hook(Elf_Auxinfo **aux_info)
return;
/*
+ * If there's no /usr/libsoft, then we don't have a system with both
+ * hard and soft float. In that case, hope for the best and just
+ * return. Such systems are required to have all soft or all hard
+ * float ABI binaries and libraries. This is, at best, a transition
+ * compatibility hack. Once we're fully hard-float, this should
+ * be removed.
+ */
+ if (stat("/usr/libsoft", &sb) != 0 || !S_ISDIR(sb.st_mode))
+ return;
+
+ /*
* This is a soft float ABI binary. We need to use the soft float
- * settings. For the moment, the standard library path includes the hard
- * float paths as well. When upgrading, we need to execute the wrong
- * kind of binary until we've installed the new binaries. We could go
- * off whether or not /libsoft exists, but the simplicity of having it
- * in the path wins.
+ * settings.
*/
ld_elf_hints_default = _PATH_SOFT_ELF_HINTS;
ld_path_libmap_conf = _PATH_SOFT_LIBMAP_CONF;
diff --git a/libexec/rtld-elf/paths.h b/libexec/rtld-elf/paths.h
index abfeb3f..7d9d372 100644
--- a/libexec/rtld-elf/paths.h
+++ b/libexec/rtld-elf/paths.h
@@ -62,7 +62,7 @@
#define _PATH_SOFT_ELF_HINTS "/var/run/ld-elf-soft.so.hints"
#define _PATH_SOFT_LIBMAP_CONF "/etc/libmap-soft.conf"
#define _PATH_SOFT_RTLD "/libexec/ld-elf.so.1"
-#define SOFT_STANDARD_LIBRARY_PATH "/libsoft:/usr/libsoft:/lib:/usr/lib"
+#define SOFT_STANDARD_LIBRARY_PATH "/usr/libsoft"
#define LD_SOFT_ "LD_SOFT_"
extern char *ld_elf_hints_default;
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index ad5d359..66edc15 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -435,7 +435,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
trust = !issetugid();
-/* md_abi_variant_hook(aux_info); */
+ md_abi_variant_hook(aux_info);
ld_bind_now = getenv(_LD("BIND_NOW"));
/*
OpenPOWER on IntegriCloud