From 237277e9a8133c64026b736b1427141e71655330 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Thu, 27 Oct 2005 22:58:52 +0000 Subject: Moved guard_setup to dl-osinfo.h (used commonly by ldso and libc). Renamed to _dl_setup_stack_chk_guard, as in glibc. SSP requires now binutils-2.16.1 and newer. Add NOT_IN_libc/IS_IN_libc. Began using -DSHARED in uClibc_main.c, there are more candidates in there. Move back dl_protect_relro to it's earlier place. --- ldso/libdl/Makefile.in | 16 ++++------------ ldso/libdl/libdl.c | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 21 deletions(-) (limited to 'ldso/libdl') diff --git a/ldso/libdl/Makefile.in b/ldso/libdl/Makefile.in index 1e758e148..be1242f60 100644 --- a/ldso/libdl/Makefile.in +++ b/ldso/libdl/Makefile.in @@ -21,7 +21,7 @@ ifeq ($(TARGET_ARCH),mips) CFLAGS:=$(CFLAGS:-O0=-O1) endif -# we need special .oS file created, do not enable this +# can't combine .c w/ .S DOMULTI=n LIB_NAME:=libdl @@ -36,18 +36,11 @@ libdl_OUT:=$(top_builddir)ldso/libdl libdl_SRC:=$(libdl_DIR)/libdl.c libdl_OBJ:=$(patsubst $(libdl_DIR)/%.c,$(libdl_OUT)/%.o,$(libdl_SRC)) -# use other suffixes, so that it does not pick up the multi rule from Makerules -$(libdl_OUT)/libdl.oS: $(libdl_DIR)/libdl.c - $(compile.c) -DSHARED - resolve:=$(top_builddir)ldso/ldso/$(TARGET_ARCH)/resolve.o -libdl-a-$(HAVE_SHARED):=$(libdl_OBJ) $(resolve) -libdl-a-pic-$(HAVE_SHARED):=$(libdl_OBJ:.o=.os) $(resolve:.o=.os) -libdl-so-$(HAVE_SHARED):=$(libdl_OBJ:.o=.oS) - -# do not disable this -libdl-multi-$(HAVE_SHARED):=$(libdl_SRC) +libdl-a-$(HAVE_SHARED):=$(libdl_OBJ) +libdl-static-$(HAVE_SHARED):=$(resolve) +libdl-shared-$(HAVE_SHARED):=$(libdl_OUT)/libdl.oS objclean-y+=libdl_clean libdl_extra_clean @@ -55,5 +48,4 @@ libdl_extra_clean: $(RM) $(libdl_OUT)/*.oS lib-a-$(HAVE_SHARED)+=$(top_builddir)lib/libdl.a -lib-a-pic-$(HAVE_SHARED)+=$(top_builddir)lib/libdl.a lib-so-$(HAVE_SHARED)+=$(top_builddir)lib/libdl.so diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index 12de25fd0..5efe36155 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -346,6 +346,15 @@ void *dlopen(const char *libname, int flag) if (_dl_fixup(dyn_chain, now_flag)) goto oops; + if (relro_ptr) { + for (rpnt = relro_ptr->next; rpnt; rpnt = rpnt->next) { + if (rpnt->dyn->relro_size) + _dl_protect_relro(rpnt->dyn); + } + } + /* TODO: Should we set the protections of all pages back to R/O now ? */ + + /* Notify the debugger we have added some objects. */ if (_dl_debug_addr) { dl_brk = (void (*)(void)) _dl_debug_addr->r_brk; @@ -376,15 +385,7 @@ void *dlopen(const char *libname, int flag) } } } -#endif - - if (relro_ptr) { - for (rpnt = relro_ptr->next; rpnt; rpnt = rpnt->next) { - if (rpnt->dyn->relro_size) - _dl_protect_relro(rpnt->dyn); - } - } - /* TODO: Should we set the protections of all pages back to R/O now ? */ +#endif /* SHARED */ _dl_unmap_cache(); return (void *) dyn_chain; -- cgit v1.2.3