Print this page
10366 ld(1) should support GNU-style linker sets
10581 ld(1) should know kernel modules are a thing
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/sgs/libld/common/globals.c
+++ new/usr/src/cmd/sgs/libld/common/globals.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 1988 AT&T
24 24 * All Rights Reserved
25 25 *
26 26 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
27 27 */
28 28
29 29 /*
30 30 * Global variables
31 31 */
32 32 #include <sys/elf.h>
33 33 #include "msg.h"
34 34 #include "_libld.h"
35 35
36 36 Ld_heap *ld_heap; /* list of allocated blocks for */
37 - /* link-edit dynamic allocations */
37 + /* link-edit dynamic allocations */
38 38 APlist *lib_support; /* list of support libraries specified */
39 39 /* (-S option) */
40 40 int demangle_flag; /* symbol demangling required */
41 41
42 42 /*
43 43 * Paths and directories for library searches. These are used to set up
44 44 * linked lists of directories which are maintained in the ofl structure.
45 45 */
46 46 char *Plibpath; /* User specified -YP or defaults to LIBPATH */
47 47 char *Llibdir; /* User specified -YL */
48 48 char *Ulibdir; /* User specified -YU */
49 49
50 50 /*
51 51 * A default library search path is used if one was not supplied on the command
52 52 * line. Note: these strings can not use MSG_ORIG() since they are modified as
53 53 * part of the path processing.
54 54 */
55 55 char def64_Plibpath[] = "/lib/64:/usr/lib/64";
56 56 char def32_Plibpath[] = "/usr/ccs/lib:/lib:/usr/lib";
57 57
58 58 /*
59 59 * Rejected file error messages (indexed to match SGS_REJ_ values).
60 60 */
61 61 const Msg
62 62 reject[SGS_REJ_NUM] = {
63 63 MSG_STR_EMPTY,
64 64 MSG_REJ_MACH, /* MSG_INTL(MSG_REJ_MACH) */
65 65 MSG_REJ_CLASS, /* MSG_INTL(MSG_REJ_CLASS) */
66 66 MSG_REJ_DATA, /* MSG_INTL(MSG_REJ_DATA) */
67 67 MSG_REJ_TYPE, /* MSG_INTL(MSG_REJ_TYPE) */
68 68 MSG_REJ_BADFLAG, /* MSG_INTL(MSG_REJ_BADFLAG) */
69 69 MSG_REJ_MISFLAG, /* MSG_INTL(MSG_REJ_MISFLAG) */
70 70 MSG_REJ_VERSION, /* MSG_INTL(MSG_REJ_VERSION) */
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
71 71 MSG_REJ_HAL, /* MSG_INTL(MSG_REJ_HAL) */
72 72 MSG_REJ_US3, /* MSG_INTL(MSG_REJ_US3) */
73 73 MSG_REJ_STR, /* MSG_INTL(MSG_REJ_STR) */
74 74 MSG_REJ_UNKFILE, /* MSG_INTL(MSG_REJ_UNKFILE) */
75 75 MSG_REJ_UNKCAP, /* MSG_INTL(MSG_REJ_UNKCAP) */
76 76 MSG_REJ_HWCAP_1, /* MSG_INTL(MSG_REJ_HWCAP_1) */
77 77 MSG_REJ_SFCAP_1, /* MSG_INTL(MSG_REJ_SFCAP_1) */
78 78 MSG_REJ_MACHCAP, /* MSG_INTL(MSG_REJ_MACHCAP) */
79 79 MSG_REJ_PLATCAP, /* MSG_INTL(MSG_REJ_PLATCAP) */
80 80 MSG_REJ_HWCAP_2, /* MSG_INTL(MSG_REJ_HWCAP_2) */
81 - MSG_REJ_ARCHIVE /* MSG_INTL(MSG_REJ_ARCHIVE) */
81 + MSG_REJ_ARCHIVE, /* MSG_INTL(MSG_REJ_ARCHIVE) */
82 + MSG_REJ_KMOD /* MSG_INTL(MSG_REJ_KMOD) */
82 83 };
83 -#if SGS_REJ_NUM != (SGS_REJ_ARCHIVE + 1)
84 +#if SGS_REJ_NUM != (SGS_REJ_KMOD + 1)
84 85 #error SGS_REJ_NUM has changed
85 86 #endif
86 87
87 88 /*
88 89 * Symbol types that we include in .SUNW_ldynsym sections
89 90 * (indexed by STT_ values).
90 91 */
91 92 const int
92 93 ldynsym_symtype[] = {
93 94 0, /* STT_NOTYPE (not counting 1st slot) */
94 95 0, /* STT_OBJECT */
95 96 1, /* STT_FUNC */
96 97 0, /* STT_SECTION */
97 98 1, /* STT_FILE */
98 99 0, /* STT_COMMON */
99 100 0, /* STT_TLS */
100 101 0, /* 7 */
101 102 0, /* 8 */
102 103 0, /* 9 */
103 104 0, /* 10 */
104 105 0, /* 11 */
105 106 0, /* 12 */
106 107 0, /* STT_SPARC_REGISTER */
107 108 0, /* 14 */
108 109 0, /* 15 */
109 110 };
110 111 #if STT_NUM != (STT_TLS + 1)
111 112 #error "STT_NUM has grown. Update ldynsym_symtype[]."
112 113 #endif
113 114
114 115 /*
115 116 * Symbol types that we include in .SUNW_dynsymsort sections
116 117 * (indexed by STT_ values).
117 118 */
118 119 const int
119 120 dynsymsort_symtype[] = {
120 121 0, /* STT_NOTYPE */
121 122 1, /* STT_OBJECT */
122 123 1, /* STT_FUNC */
123 124 0, /* STT_SECTION */
124 125 0, /* STT_FILE */
125 126 1, /* STT_COMMON */
126 127 0, /* STT_TLS */
127 128 0, /* 7 */
128 129 0, /* 8 */
129 130 0, /* 9 */
130 131 0, /* 10 */
131 132 0, /* 11 */
132 133 0, /* 12 */
133 134 0, /* STT_SPARC_REGISTER */
134 135 0, /* 14 */
135 136 0, /* 15 */
136 137 };
137 138 #if STT_NUM != (STT_TLS + 1)
138 139 #error "STT_NUM has grown. Update dynsymsort_symtype[]."
139 140 #endif
↓ open down ↓ |
46 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX