End softfp->hardfp transition period for arm

On hard-float 32-bit arm platforms, always search for the soft float
binaries in the alternative locations.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D12274
MFC After: 1 week
This commit is contained in:
Warner Losh 2017-09-12 17:06:35 +00:00
parent da3086df18
commit 08d1c5b152
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323500
3 changed files with 21 additions and 12 deletions

View file

@ -51,6 +51,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
****************************** SPECIAL WARNING: ******************************
20170912:
For 32-bit arm compiled for hard-float support, soft-floating point
binaries now always get their shared libraries from
LD_SOFT_LIBRARY_PATH (in the past, this was only used if
/usr/libsoft also existed). Only users with a hard-float ld.so, but
soft-float everything else should be affected.
20170826:
During boot the geli passphrase will be hidden. To restore previous
behavior see geli(8) configuration options.

View file

@ -18,11 +18,18 @@ __FBSDID("$FreeBSD$");
#include "rtld.h"
#include "paths.h"
#ifdef __ARM_FP
/*
* On processors that have hard floating point supported, we also support
* running soft float binaries. If we're being built with hard float support,
* check the ELF headers to make sure that this is a hard float binary. If it is
* a soft float binary, force the dynamic linker to use the alternative soft
* float path.
*/
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
@ -39,17 +46,6 @@ arm_abi_variant_hook(Elf_Auxinfo **aux_info)
if ((ehdr & EF_ARM_VFP_FLOAT) != 0)
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.
@ -60,6 +56,7 @@ arm_abi_variant_hook(Elf_Auxinfo **aux_info)
ld_standard_library_path = SOFT_STANDARD_LIBRARY_PATH;
ld_env_prefix = LD_SOFT_;
}
#endif
void
init_pltgot(Obj_Entry *obj)

View file

@ -31,6 +31,7 @@
#include <sys/types.h>
#include <machine/atomic.h>
#include <machine/acle-compat.h>
struct Struct_Obj_Entry;
@ -74,7 +75,11 @@ extern void *__tls_get_addr(tls_index *ti);
extern void arm_abi_variant_hook(Elf_Auxinfo **);
#ifdef __ARM_FP
#define md_abi_variant_hook(x) arm_abi_variant_hook(x)
#define RTLD_VARIANT_ENV_NAMES
#else
#define md_abi_variant_hook(x)
#endif
#endif