summaryrefslogtreecommitdiff
path: root/usr/src/cmd/sgs/include
diff options
context:
space:
mode:
authorRod Evans <Rod.Evans@Sun.COM>2010-05-19 22:33:49 -0700
committerRod Evans <Rod.Evans@Sun.COM>2010-05-19 22:33:49 -0700
commitf441771b0ce9f9d6122d318ff8290cb1a2848f9d (patch)
treeedc5b9e27e15ab0cad9075b0b8f4ec85910fdec6 /usr/src/cmd/sgs/include
parent8f8c16c468f9b60de6f1d897375c320443d872a8 (diff)
downloadillumos-joyent-f441771b0ce9f9d6122d318ff8290cb1a2848f9d.tar.gz
6943772 Testing for a symbols existence with RTLD_PROBE is compromised by RTLD_BIND_NOW
PSARC/2010/175 Deferred symbol references 6943432 dlsym(RTLD_PROBE) should only bind to symbol definitions 6668759 an external method for determining whether an ELF dependency is optional --HG-- rename : usr/src/cmd/sgs/rtld/common/_inline.h => usr/src/cmd/sgs/rtld/common/_inline_gen.h
Diffstat (limited to 'usr/src/cmd/sgs/include')
-rw-r--r--usr/src/cmd/sgs/include/conv.h7
-rw-r--r--usr/src/cmd/sgs/include/debug.h3
-rw-r--r--usr/src/cmd/sgs/include/libld.h21
-rw-r--r--usr/src/cmd/sgs/include/rtld.h23
4 files changed, 38 insertions, 16 deletions
diff --git a/usr/src/cmd/sgs/include/conv.h b/usr/src/cmd/sgs/include/conv.h
index bfdf9f8317..66924769a4 100644
--- a/usr/src/cmd/sgs/include/conv.h
+++ b/usr/src/cmd/sgs/include/conv.h
@@ -23,8 +23,7 @@
* Copyright (c) 1988 AT&T
* All Rights Reserved
*
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _CONV_H
@@ -208,7 +207,7 @@ typedef union {
} Conv_seg_flags_buf_t;
/* conv_dyn_posflag1() */
-#define CONV_DYN_POSFLAG1_BUFSIZE 57
+#define CONV_DYN_POSFLAG1_BUFSIZE 72
typedef union {
Conv_inv_buf_t inv_buf;
char buf[CONV_DYN_POSFLAG1_BUFSIZE];
@@ -271,7 +270,7 @@ typedef union {
} Conv_dwarf_ehe_buf_t;
/* conv_syminfo_flags() */
-#define CONV_SYMINFO_FLAGS_BUFSIZE 193
+#define CONV_SYMINFO_FLAGS_BUFSIZE 230
typedef union {
Conv_inv_buf_t inv_buf;
char buf[CONV_SYMINFO_FLAGS_BUFSIZE];
diff --git a/usr/src/cmd/sgs/include/debug.h b/usr/src/cmd/sgs/include/debug.h
index c0c992458a..0e13600956 100644
--- a/usr/src/cmd/sgs/include/debug.h
+++ b/usr/src/cmd/sgs/include/debug.h
@@ -330,6 +330,7 @@ extern void Dbg_help(void);
#define Dbg_file_config_obj Dbg64_file_config_obj
#define Dbg_file_del_rescan Dbg64_file_del_rescan
#define Dbg_file_delete Dbg64_file_delete
+#define Dbg_file_deferred Dbg64_file_deferred
#define Dbg_file_elf Dbg64_file_elf
#define Dbg_file_filtee Dbg64_file_filtee
#define Dbg_file_filter Dbg64_file_filter
@@ -561,6 +562,7 @@ extern void Dbg_help(void);
#define Dbg_file_config_obj Dbg32_file_config_obj
#define Dbg_file_del_rescan Dbg32_file_del_rescan
#define Dbg_file_delete Dbg32_file_delete
+#define Dbg_file_deferred Dbg32_file_deferred
#define Dbg_file_elf Dbg32_file_elf
#define Dbg_file_filtee Dbg32_file_filtee
#define Dbg_file_filter Dbg32_file_filter
@@ -827,6 +829,7 @@ extern void Dbg_file_config_obj(Lm_list *, const char *, const char *,
const char *);
extern void Dbg_file_del_rescan(Lm_list *);
extern void Dbg_file_delete(Rt_map *);
+extern void Dbg_file_deferred(Lm_list *, const char *, const char *);
extern void Dbg_file_elf(Lm_list *, const char *, Addr, size_t,
const char *, Aliste);
extern void Dbg_file_filtee(Lm_list *, const char *, const char *, int);
diff --git a/usr/src/cmd/sgs/include/libld.h b/usr/src/cmd/sgs/include/libld.h
index 6fdb38d99a..c8629fa3f5 100644
--- a/usr/src/cmd/sgs/include/libld.h
+++ b/usr/src/cmd/sgs/include/libld.h
@@ -476,6 +476,7 @@ struct ofl_desc {
#define FLG_OF1_NOINTRP 0x0000000008 /* -z nointerp flag set */
#define FLG_OF1_ZDIRECT 0x0000000010 /* -z direct flag set */
#define FLG_OF1_NDIRECT 0x0000000020 /* no-direct bindings specified */
+#define FLG_OF1_DEFERRED 0x0000000040 /* deferred dependency recording */
#define FLG_OF1_RELDYN 0x0000000100 /* process .dynamic in rel obj */
#define FLG_OF1_NRLXREL 0x0000000200 /* -z norelaxreloc flag set */
@@ -844,10 +845,8 @@ struct ifl_desc { /* input file descriptor */
#define FLG_IF_IGNORE 0x00000080 /* ignore unused dependencies */
#define FLG_IF_NODIRECT 0x00000100 /* object contains symbols that */
/* cannot be directly bound to */
-#define FLG_IF_LAZYLD 0x00000200 /* bindings to this object should be */
- /* lazy loaded */
-#define FLG_IF_GRPPRM 0x00000400 /* this dependency should have the */
- /* DF_P1_GROUPPERM flag set */
+#define FLG_IF_LAZYLD 0x00000200 /* dependency should be lazy loaded */
+#define FLG_IF_GRPPRM 0x00000400 /* dependency establishes a group */
#define FLG_IF_DISPPEND 0x00000800 /* displacement relocation done */
/* in the ld time. */
#define FLG_IF_DISPDONE 0x00001000 /* displacement relocation done */
@@ -862,6 +861,18 @@ struct ifl_desc { /* input file descriptor */
/* required */
#define FLG_IF_OTOSCAP 0x00040000 /* convert object capabilities to */
/* symbol capabilities */
+#define FLG_IF_DEFERRED 0x00080000 /* dependency is deferred */
+
+/*
+ * Symbol states that require the generation of a DT_POSFLAG_1 .dynamic entry.
+ */
+#define MSK_IF_POSFLAG1 (FLG_IF_LAZYLD | FLG_IF_GRPPRM | FLG_IF_DEFERRED)
+
+/*
+ * Symbol states that require an associated Syminfo entry.
+ */
+#define MSK_IF_SYMINFO (FLG_IF_LAZYLD | FLG_IF_DIRECT | FLG_IF_DEFERRED)
+
struct is_desc { /* input section descriptor */
const char *is_name; /* original section name */
@@ -1267,6 +1278,8 @@ struct sym_avlnode {
#define FLG_SY_OVERLAP 0x0080000000000 /* move entry overlap detected */
#define FLG_SY_CAP 0x0100000000000 /* symbol is associated with */
/* capabilities */
+#define FLG_SY_DEFERRED 0x0200000000000 /* symbol should not be bound to */
+ /* during BIND_NOW relocations */
/*
* A symbol can only be truly hidden if it is not a capabilities symbol.
diff --git a/usr/src/cmd/sgs/include/rtld.h b/usr/src/cmd/sgs/include/rtld.h
index ffe3c7baaa..eaffdeb543 100644
--- a/usr/src/cmd/sgs/include/rtld.h
+++ b/usr/src/cmd/sgs/include/rtld.h
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _RTLD_H
#define _RTLD_H
@@ -597,8 +596,9 @@ typedef cond_t Rt_cond;
* loading and filtee processing.
*/
typedef struct {
- uint_t di_flags;
- void *di_info;
+ uint_t di_flags;
+ void *di_info;
+ const char *di_name;
} Dyninfo;
#define FLG_DI_STDFLTR 0x00001 /* .dynamic entry for DT_FILTER */
@@ -609,14 +609,21 @@ typedef struct {
#define FLG_DI_POSFLAG1 0x00010 /* .dynamic entry for DT_POSFLAG_1 */
#define FLG_DI_NEEDED 0x00020 /* .dynamic entry for DT_NEEDED */
-#define FLG_DI_LAZY 0x00100 /* lazy needed entry - preceded by */
+#define FLG_DI_REGISTER 0x00040 /* .dynamic entry for DT_REGISTER */
+#define FLG_DI_IGNORE 0x00080 /* .dynamic entry should be ignored */
+
+#define FLG_DI_LAZY 0x00100 /* lazy needed entry, preceded by */
/* DF_P1_LAZYLOAD (DT_POSFLAG_1) */
-#define FLG_DI_GROUP 0x00200 /* group needed entry - preceded by */
+#define FLG_DI_GROUP 0x00200 /* group needed entry, preceded by */
/* DF_P1_GROUPPERM (DT_POSFLAG_1) */
+#define FLG_DI_DEFERRED 0x00400 /* deferred needed entry, preceded by */
+ /* DF_P1_DEFERRED (DT_POSFLAG_1) */
-#define FLG_DI_LDD_DONE 0x01000 /* entry has been processed (ldd) */
-#define FLG_DI_LAZYFAIL 0x02000 /* the lazy loading of this entry */
+#define FLG_DI_LAZYFAIL 0x01000 /* the lazy loading of this entry */
/* failed */
+#define FLG_DI_LDD_DONE 0x02000 /* entry has been processed (ldd) */
+#define FLG_DI_DEF_DONE 0x04000 /* entry has been processed (dlinfo) */
+
/*
* Data structure to track AVL tree of pathnames. This structure provides the
* basis of both the "not-found" node tree, and the "full-path" node tree. Both