From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 13:01:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C57941065674; Tue, 24 Aug 2010 13:01:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2B5E8FC19; Tue, 24 Aug 2010 13:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OD1EfK076759; Tue, 24 Aug 2010 13:01:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OD1E5s076757; Tue, 24 Aug 2010 13:01:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008241301.o7OD1E5s076757@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Aug 2010 13:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211749 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 13:01:15 -0000 Author: kib Date: Tue Aug 24 13:01:14 2010 New Revision: 211749 URL: http://svn.freebsd.org/changeset/base/211749 Log: Remove exports table. Export control by the version script is enough. Reviewed by: kan MFC after: 3 weeks Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Aug 24 12:58:54 2010 (r211748) +++ head/libexec/rtld-elf/rtld.c Tue Aug 24 13:01:14 2010 (r211749) @@ -104,7 +104,6 @@ static void init_dag1(Obj_Entry *, Obj_E static void init_rtld(caddr_t, Elf_Auxinfo **); static void initlist_add_neededs(Needed_Entry *, Objlist *); static void initlist_add_objects(Obj_Entry *, Obj_Entry **, Objlist *); -static bool is_exported(const Elf_Sym *); static void linkmap_add(Obj_Entry *); static void linkmap_delete(Obj_Entry *); static int load_needed_objects(Obj_Entry *, int); @@ -197,36 +196,6 @@ extern Elf_Dyn _DYNAMIC; int osreldate, pagesize; /* - * These are the functions the dynamic linker exports to application - * programs. They are the only symbols the dynamic linker is willing - * to export from itself. - */ -static func_ptr_type exports[] = { - (func_ptr_type) &_rtld_error, - (func_ptr_type) &dlclose, - (func_ptr_type) &dlerror, - (func_ptr_type) &dlopen, - (func_ptr_type) &dlsym, - (func_ptr_type) &dlfunc, - (func_ptr_type) &dlvsym, - (func_ptr_type) &dladdr, - (func_ptr_type) &dllockinit, - (func_ptr_type) &dlinfo, - (func_ptr_type) &_rtld_thread_init, -#ifdef __i386__ - (func_ptr_type) &___tls_get_addr, -#endif - (func_ptr_type) &__tls_get_addr, - (func_ptr_type) &_rtld_allocate_tls, - (func_ptr_type) &_rtld_free_tls, - (func_ptr_type) &dl_iterate_phdr, - (func_ptr_type) &_rtld_atfork_pre, - (func_ptr_type) &_rtld_atfork_post, - (func_ptr_type) &_rtld_addr_phdr, - NULL -}; - -/* * Global declarations normally provided by crt1. The dynamic linker is * not built with crt1, so we have to provide them ourselves. */ @@ -1445,19 +1414,6 @@ initlist_add_objects(Obj_Entry *obj, Obj #define FPTR_TARGET(f) ((Elf_Addr) (f)) #endif -static bool -is_exported(const Elf_Sym *def) -{ - Elf_Addr value; - const func_ptr_type *p; - - value = (Elf_Addr)(obj_rtld.relocbase + def->st_value); - for (p = exports; *p != NULL; p++) - if (FPTR_TARGET(*p) == value) - return true; - return false; -} - /* * Given a shared object, traverse its list of needed objects, and load * each of them. Returns 0 on success. Generates an error message and @@ -2161,12 +2117,11 @@ do_dlsym(void *handle, const char *name, /* * Search the dynamic linker itself, and possibly resolve the * symbol from there. This is how the application links to - * dynamic linker services such as dlopen. Only the values listed - * in the "exports" array can be resolved from the dynamic linker. + * dynamic linker services such as dlopen. */ if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) { symp = symlook_obj(name, hash, &obj_rtld, ve, flags); - if (symp != NULL && is_exported(symp)) { + if (symp != NULL) { def = symp; defobj = &obj_rtld; } @@ -2746,12 +2701,11 @@ symlook_default(const char *name, unsign /* * Search the dynamic linker itself, and possibly resolve the * symbol from there. This is how the application links to - * dynamic linker services such as dlopen. Only the values listed - * in the "exports" array can be resolved from the dynamic linker. + * dynamic linker services such as dlopen. */ if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) { symp = symlook_obj(name, hash, &obj_rtld, ventry, flags); - if (symp != NULL && is_exported(symp)) { + if (symp != NULL) { def = symp; defobj = &obj_rtld; }