summaryrefslogtreecommitdiff
path: root/libexec/ld.so/resolve.h
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-08-23 22:57:04 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-08-23 22:57:04 +0000
commitbfce6caf8080fa2d4f5024cab4059d709567fae4 (patch)
tree76cf0b5a29cb9439e94d9326ba53457e1dcb7f01 /libexec/ld.so/resolve.h
parent9958388d0a4d2166f3f7b1acfaae96e99f8843b7 (diff)
Change arguments to _dl_find_symbol() myself, warnnotfound, and inplt into
a single flags field with bits representing each. Use defines to create the appropriate masks. Add a new argument sym_size to warn about symbols which have the incorrect size. This replaces 'ifdef notyet' code which was in several of the md files with a single version. sym_size == 0 means do not check, and symbols of type FUNC are not checked.
Diffstat (limited to 'libexec/ld.so/resolve.h')
-rw-r--r--libexec/ld.so/resolve.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/libexec/ld.so/resolve.h b/libexec/ld.so/resolve.h
index b0eabad8784..3af79fab45e 100644
--- a/libexec/ld.so/resolve.h
+++ b/libexec/ld.so/resolve.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: resolve.h,v 1.16 2002/08/11 16:51:04 drahn Exp $ */
+/* $OpenBSD: resolve.h,v 1.17 2002/08/23 22:57:03 drahn Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -134,7 +134,29 @@ extern int _dl_md_reloc(elf_object_t *object, int rel, int relsz);
extern void _dl_md_reloc_got(elf_object_t *object, int lazy);
Elf_Addr _dl_find_symbol(const char *name, elf_object_t *startlook,
- const Elf_Sym **ref, int myself, int warnnotfound, int inplt);
+ const Elf_Sym **ref, int flags, int sym_size);
+/*
+ * defines for _dl_find_symbol() flag field, three bits of meaning
+ * myself - clear: search all objects, set: search only this object
+ * warnnotfound - clear: no warning, set: warn if not found
+ * inplt - clear: possible plt ref set: real matching function.
+ *
+ * inplt - due to how ELF handles function addresses in shared libraries
+ * &func may actually refer to the plt entry in the main program
+ * rather than the actual function address in the .so file.
+ * This rather bizarre behavior is documented in the SVR4 ABI.
+ * when getting the function address to relocate a PLT entry
+ * the 'real' function address is necessary, not the possible PLT address.
+ */
+/* myself */
+#define SYM_SEARCH_ALL 0
+#define SYM_SEARCH_SELF 1
+/* warnnotfound */
+#define SYM_NOWARNNOTFOUND 0
+#define SYM_WARNNOTFOUND 2
+/* inplt */
+#define SYM_NOTPLT 0
+#define SYM_PLT 4
void _dl_rtld(elf_object_t *object);
void _dl_call_init(elf_object_t *object);