1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
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)
|