Description: set default library search path with respect to multiarch, these changes must be consistent with crle. Index: b/usr/src/cmd/sgs/rtld/common/elf.c =================================================================== --- a/usr/src/cmd/sgs/rtld/common/elf.c +++ b/usr/src/cmd/sgs/rtld/common/elf.c @@ -52,24 +52,40 @@ /* * Default and secure dependency search paths. */ -static Spath_defn _elf_def_dirs[] = { + #if defined(_ELF64) - { MSG_ORIG(MSG_PTH_LIB_64), MSG_PTH_LIB_64_SIZE }, - { MSG_ORIG(MSG_PTH_USRLIB_64), MSG_PTH_USRLIB_64_SIZE }, +static char deb_lib[] = DEB_LIBDIR_64; +static char deb_usr_lib[] = DEB_USRLIBDIR_64; #else - { MSG_ORIG(MSG_PTH_LIB), MSG_PTH_LIB_SIZE }, - { MSG_ORIG(MSG_PTH_USRLIB), MSG_PTH_USRLIB_SIZE }, +static char deb_lib[] = DEB_LIBDIR_32; +static char deb_usr_lib[] = DEB_USRLIBDIR_32; +#endif + +static char usr_lib[] = "/usr/lib"; + +static Spath_defn _elf_def_dirs[] = { + { deb_lib, sizeof(deb_lib) - 1 }, + { deb_usr_lib, sizeof(deb_usr_lib) - 1 }, + + /* For native linker add /usr/lib to default search path: */ +#if !defined(DEB_HOST_ARCH_BITS) \ + || ! (DEB_HOST_ARCH_BITS == 32 || DEB_HOST_ARCH_BITS == 64) +#error DEB_HOST_ARCH_BITS is not defined or has a wrong value +#endif + +#if ( defined(_ELF64) && DEB_HOST_ARCH_BITS == 64) \ + || (!defined(_ELF64) && DEB_HOST_ARCH_BITS == 32) + { usr_lib, sizeof(usr_lib) - 1 }, #endif { 0, 0 } }; static Spath_defn _elf_sec_dirs[] = { -#if defined(_ELF64) - { MSG_ORIG(MSG_PTH_LIBSE_64), MSG_PTH_LIBSE_64_SIZE }, - { MSG_ORIG(MSG_PTH_USRLIBSE_64), MSG_PTH_USRLIBSE_64_SIZE }, -#else - { MSG_ORIG(MSG_PTH_LIBSE), MSG_PTH_LIBSE_SIZE }, - { MSG_ORIG(MSG_PTH_USRLIBSE), MSG_PTH_USRLIBSE_SIZE }, + { deb_lib, sizeof(deb_lib) - 1 }, + { deb_usr_lib, sizeof(deb_usr_lib) - 1 }, +#if ( defined(_ELF64) && DEB_HOST_ARCH_BITS == 64) \ + || (!defined(_ELF64) && DEB_HOST_ARCH_BITS == 32) + { usr_lib, sizeof(usr_lib) - 1 }, #endif { 0, 0 } }; Index: b/usr/src/cmd/sgs/rtld/Makefile.com =================================================================== --- a/usr/src/cmd/sgs/rtld/Makefile.com +++ b/usr/src/cmd/sgs/rtld/Makefile.com @@ -81,6 +81,14 @@ CPPFLAGS += -I$(SRCBASE)/lib/libc/inc \ -I$(ELFCAP) \ $(CPPFEATUREMACROS) + +CPPFLAGS += \ +-DDEB_HOST_ARCH_BITS=$(DEB_HOST_ARCH_BITS) \ +-DDEB_LIBDIR_32=\"$(DEB_LIBDIR_32)\" \ +-DDEB_LIBDIR_64=\"$(DEB_LIBDIR_64)\" \ +-DDEB_USRLIBDIR_32=\"$(DEB_USRLIBDIR_32)\" \ +-DDEB_USRLIBDIR_64=\"$(DEB_USRLIBDIR_64)\" \ + ASFLAGS= -P -D_ASM $(CPPFLAGS) LDLIB = -L ../../libld/$(MACH) RTLDLIB = -L ../../librtld/$(MACH)