# HG changeset patch # Parent 6f5669356e76cacd52bd8dc593371bdec2b2404c Implement the glue to generate ld-elf.soft.so.1 when COMPAT_SOFTFP is defined and all the goo that goes along with that. Differential Revision: https://reviews.freebsd.org/D2435 diff -r 6f5669356e76 libexec/rtld-elf/debug.h --- a/libexec/rtld-elf/debug.h +++ b/libexec/rtld-elf/debug.h @@ -50,10 +50,12 @@ extern int debug; #define dbg(...) ((void) 0) #endif -#ifndef COMPAT_32BIT +#if defined(COMPAT_32BIT) +#define _MYNAME "ld-elf32.so.1" +#elif defined(COMPAT_SOFTFP) +#define _MYNAME "ld-elf.soft.so.1" +#else #define _MYNAME "ld-elf.so.1" -#else -#define _MYNAME "ld-elf32.so.1" #endif #define assert(cond) ((cond) ? (void) 0 : \ diff -r 6f5669356e76 libexec/rtld-elf/libmap.c --- a/libexec/rtld-elf/libmap.c +++ b/libexec/rtld-elf/libmap.c @@ -26,6 +26,11 @@ #define _PATH_LIBMAP_CONF "/etc/libmap32.conf" #endif +#ifdef COMPAT_SOFTFP +#undef _PATH_LIBMAP_CONF +#define _PATH_LIBMAP_CONF "/etc/libmap.soft.conf" +#endif + TAILQ_HEAD(lm_list, lm); struct lm { char *f; diff -r 6f5669356e76 libexec/rtld-elf/rtld.1 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -126,10 +126,16 @@ utility recognizes a number of environment variables that can be used to modify its behaviour. On 64-bit architectures, the linker for 32-bit objects recognizes -all the environment variables listed below, but is being prefixed with +all the environment variables listed below, but each is prefixed with .Ev LD_32_ , for example: .Ev LD_32_TRACE_LOADED_OBJECTS . +On 32-bit architectures with hardware floating point, the linker for +software floating point objects recognizes all the environment +variables listed below, but each is prefixed with +.Ev LD_SOFT_ , +for example: +.Ev LD_SOFT_TRACE_LOADED_OBJECTS . .Bl -tag -width ".Ev LD_LIBMAP_DISABLE" .It Ev LD_DUMP_REL_POST If set, @@ -276,15 +282,19 @@ Normally, the filtees are opened at the from the filter object. .El .Sh FILES -.Bl -tag -width ".Pa /var/run/ld-elf32.so.hints" -compact +.Bl -tag -width ".Pa /var/run/ld-elf.soft.so.hints" -compact .It Pa /var/run/ld-elf.so.hints Hints file. .It Pa /var/run/ld-elf32.so.hints Hints file for 32-bit binaries on 64-bit system. +.It Pa /var/run/ld-elf.soft.so.hints +Hints file for soft-float binaries on 32-bit hard-float systems. .It Pa /etc/libmap.conf The libmap configuration file. .It Pa /etc/libmap32.conf The libmap configuration file for 32-bit binaries on 64-bit system. +.It Pa /etc/libmap.soft.conf +The libmap configuration file for soft-float binaries on 32-bit hard-float systems. .El .Sh SEE ALSO .Xr ld 1 , diff -r 6f5669356e76 libexec/rtld-elf/rtld.c --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -64,10 +64,12 @@ #include "rtld_printf.h" #include "notes.h" -#ifndef COMPAT_32BIT +#if defined(COMPAT_32BIT) +#define PATH_RTLD "/libexec/ld-elf32.so.1" +#elif defined(COMPAT_SOFTFP) +#define PATH_RTLD "/libexec/ld-elf.soft.so.1" +#else #define PATH_RTLD "/libexec/ld-elf.so.1" -#else -#define PATH_RTLD "/libexec/ld-elf32.so.1" #endif /* Types. */ @@ -525,7 +527,7 @@ func_ptr_type aux_info[AT_STACKPROT]->a_un.a_val != 0) stack_prot = aux_info[AT_STACKPROT]->a_un.a_val; -#ifndef COMPAT_32BIT +#if !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP) /* * Get the actual dynamic linker pathname from the executable if * possible. (It should always be possible.) That ensures that diff -r 6f5669356e76 libexec/rtld-elf/rtld.h --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -41,6 +41,10 @@ #include "rtld_lock.h" #include "rtld_machdep.h" +#if defined(COMPAT_32BIT) && defined(COMPAT_SOFTFP) +#error "Cannot define both COMPAT_32BIT and COMPAT_SOFTFP" +#endif + #ifdef COMPAT_32BIT #undef STANDARD_LIBRARY_PATH #undef _PATH_ELF_HINTS @@ -50,6 +54,15 @@ #define LD_ "LD_32_" #endif +#ifdef COMPAT_SOFTFP +#undef STANDARD_LIBRARY_PATH +#undef _PATH_ELF_HINTS +#define _PATH_ELF_HINTS "/var/run/ld-elf.soft.so.hints" +/* For running soft float binaries */ +#define STANDARD_LIBRARY_PATH "/lib/soft:/usr/lib/soft" +#define LD_ "LD_SOFTFP_" +#endif + #ifndef STANDARD_LIBRARY_PATH #define STANDARD_LIBRARY_PATH "/lib:/usr/lib" #endif