diff options
author | kib <kib@FreeBSD.org> | 2010-08-24 13:01:14 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-08-24 13:01:14 +0000 |
commit | d86ee49c10d60d69e00b6bc9560242f29642dd70 (patch) | |
tree | b872a86869cc957ec37f2ac4c07dc688912cf1bc /libexec | |
parent | ccc2cef693f2f02fa55024c17c959c78003839d9 (diff) | |
download | FreeBSD-src-d86ee49c10d60d69e00b6bc9560242f29642dd70.zip FreeBSD-src-d86ee49c10d60d69e00b6bc9560242f29642dd70.tar.gz |
Remove exports table. Export control by the version script is enough.
Reviewed by: kan
MFC after: 3 weeks
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rtld-elf/rtld.c | 54 |
1 files changed, 4 insertions, 50 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index dc5cdca..a1b95ae 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -104,7 +104,6 @@ static void init_dag1(Obj_Entry *, Obj_Entry *, DoneList *); 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_Entry **tail, Objlist *list) #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, void *retaddr, const Ver_Entry *ve, /* * 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, unsigned long hash, const Obj_Entry *refobj, /* * 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; } |