diff options
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/Makefile | 4 | ||||
-rw-r--r-- | ldso/include/dl-defs.h | 7 | ||||
-rw-r--r-- | ldso/include/dl-elf.h | 7 | ||||
-rw-r--r-- | ldso/include/dl-hash.h | 7 | ||||
-rw-r--r-- | ldso/include/dl-string.h | 7 | ||||
-rw-r--r-- | ldso/include/dl-syscall.h | 7 | ||||
-rw-r--r-- | ldso/include/dlfcn.h | 7 | ||||
-rw-r--r-- | ldso/include/ldso.h | 7 | ||||
-rw-r--r-- | ldso/include/unsecvars.h | 7 | ||||
-rw-r--r-- | ldso/ldso/Makefile | 4 | ||||
-rw-r--r-- | ldso/ldso/Makefile.in | 37 | ||||
-rw-r--r-- | ldso/ldso/arm/elfinterp.c | 2 | ||||
-rw-r--r-- | ldso/ldso/dl-elf.c | 4 | ||||
-rw-r--r-- | ldso/ldso/dl-tls.c | 4 | ||||
-rw-r--r-- | ldso/ldso/frv/elfinterp.c | 4 | ||||
-rw-r--r-- | ldso/ldso/ldso.c | 2 | ||||
-rw-r--r-- | ldso/ldso/m68k/elfinterp.c | 2 | ||||
-rw-r--r-- | ldso/ldso/powerpc/elfinterp.c | 2 | ||||
-rw-r--r-- | ldso/ldso/sh/elfinterp.c | 2 | ||||
-rw-r--r-- | ldso/ldso/sh64/elfinterp.c | 2 | ||||
-rw-r--r-- | ldso/libdl/Makefile | 4 | ||||
-rw-r--r-- | ldso/libdl/Makefile.in | 19 |
22 files changed, 94 insertions, 54 deletions
diff --git a/ldso/Makefile b/ldso/Makefile index 2dea1b3e9..c8dc9b466 100644 --- a/ldso/Makefile +++ b/ldso/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../ - -top_srcdir=$(TOPDIR) +top_srcdir=../ top_builddir=../ include $(top_builddir)Rules.mak all: libs diff --git a/ldso/include/dl-defs.h b/ldso/include/dl-defs.h index 37588b86c..789413c4f 100644 --- a/ldso/include/dl-defs.h +++ b/ldso/include/dl-defs.h @@ -1,3 +1,10 @@ +/* vi: set sw=4 ts=4: */ +/* + * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org> + * + * GNU Lesser General Public License version 2.1 or later. + */ + #ifndef _LD_DEFS_H #define _LD_DEFS_H diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h index c487436fc..f77c57348 100644 --- a/ldso/include/dl-elf.h +++ b/ldso/include/dl-elf.h @@ -1,3 +1,10 @@ +/* vi: set sw=4 ts=4: */ +/* + * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org> + * + * GNU Lesser General Public License version 2.1 or later. + */ + #ifndef LINUXELF_H #define LINUXELF_H diff --git a/ldso/include/dl-hash.h b/ldso/include/dl-hash.h index a7ef5c014..d9f386ee6 100644 --- a/ldso/include/dl-hash.h +++ b/ldso/include/dl-hash.h @@ -1,3 +1,10 @@ +/* vi: set sw=4 ts=4: */ +/* + * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org> + * + * GNU Lesser General Public License version 2.1 or later. + */ + #ifndef _LD_HASH_H_ #define _LD_HASH_H_ diff --git a/ldso/include/dl-string.h b/ldso/include/dl-string.h index bb4daff68..d1504f403 100644 --- a/ldso/include/dl-string.h +++ b/ldso/include/dl-string.h @@ -1,3 +1,10 @@ +/* vi: set sw=4 ts=4: */ +/* + * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org> + * + * GNU Lesser General Public License version 2.1 or later. + */ + #ifndef _LINUX_STRING_H_ #define _LINUX_STRING_H_ diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h index 70b79f6cf..bf25c85be 100644 --- a/ldso/include/dl-syscall.h +++ b/ldso/include/dl-syscall.h @@ -1,3 +1,10 @@ +/* vi: set sw=4 ts=4: */ +/* + * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org> + * + * GNU Lesser General Public License version 2.1 or later. + */ + #ifndef _LD_SYSCALL_H_ #define _LD_SYSCALL_H_ diff --git a/ldso/include/dlfcn.h b/ldso/include/dlfcn.h index 0bacc1a22..03afd34fb 100644 --- a/ldso/include/dlfcn.h +++ b/ldso/include/dlfcn.h @@ -1,3 +1,10 @@ +/* vi: set sw=4 ts=4: */ +/* + * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org> + * + * GNU Lesser General Public License version 2.1 or later. + */ + /* User functions for run-time dynamic loading. libdl version */ #ifndef _DLFCN_H #define _DLFCN_H 1 diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h index ac48db4c4..f0967107a 100644 --- a/ldso/include/ldso.h +++ b/ldso/include/ldso.h @@ -1,3 +1,10 @@ +/* vi: set sw=4 ts=4: */ +/* + * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org> + * + * GNU Lesser General Public License version 2.1 or later. + */ + #ifndef _LDSO_H_ #define _LDSO_H_ diff --git a/ldso/include/unsecvars.h b/ldso/include/unsecvars.h index 3555934e3..0ce3ebfea 100644 --- a/ldso/include/unsecvars.h +++ b/ldso/include/unsecvars.h @@ -1,3 +1,10 @@ +/* vi: set sw=4 ts=4: */ +/* + * Copyright (C) 2000-2005 by Erik Andersen <andersen@codepoet.org> + * + * GNU Lesser General Public License version 2.1 or later. + */ + /* * Environment variable to be removed for SUID programs. The names are all * stuffed in a single string which means they have to be terminated with a diff --git a/ldso/ldso/Makefile b/ldso/ldso/Makefile index f92f205a5..f9100219a 100644 --- a/ldso/ldso/Makefile +++ b/ldso/ldso/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../ top_builddir=../../ include $(top_builddir)Rules.mak all: libs diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in index 2b8e5fcfc..903a1fd3a 100644 --- a/ldso/ldso/Makefile.in +++ b/ldso/ldso/Makefile.in @@ -5,12 +5,12 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-ldso := -DNOT_IN_libc -DIS_IN_rtld $(SSP_DISABLE_FLAGS) +CFLAGS-ldso := -DNOT_IN_libc -DIS_IN_rtld $(SSP_DISABLE_FLAGS) -D_GNU_SOURCE # This stuff will not work with -fomit-frame-pointer CFLAGS-ldso += -fno-omit-frame-pointer -CFLAGS-ldso += -I$(top_builddir)ldso/include -I$(top_builddir)ldso/ldso +CFLAGS-ldso += -I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) -I$(top_srcdir)ldso/include -I$(top_srcdir)ldso/ldso CFLAGS-ldso += -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" ifeq ($(SUPPORT_LD_DEBUG),y) @@ -28,12 +28,10 @@ ifeq ($(DODEBUG),y) CFLAGS-ldso += -Os -g endif -ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) -CFLAGS-ldso += $(PTINC) -DSHARED -endif - CFLAGS-ldso/ldso/$(TARGET_ARCH)/ := $(CFLAGS-ldso) +CFLAGS-ldso.c := -DLDSO_ELFINTERP=\"$(TARGET_ARCH)/elfinterp.c\" + ifneq ($(SUPPORT_LD_DEBUG),y) LDFLAGS-ld-uClibc.so := $(LDFLAGS) else @@ -54,19 +52,12 @@ ld-uClibc_SOBJ := $(patsubst $(ld-uClibc_DIR)/$(TARGET_ARCH)/%.S,$(ld-uClibc_OUT ld-uClibc_OBJS := $(ld-uClibc_COBJ) $(ld-uClibc_SOBJ) -ld-uClibc-so-y := $(ld-uClibc_OBJS:.o=.os) +ld-uClibc-so-y := $(ld-uClibc_OBJS:.o=.oS) -LN_HEADERS := $(patsubst %, $(top_builddir)ldso/include/%, elf.h) -LN_ARCH_HEADERS := $(patsubst %, $(top_builddir)ldso/include/%, dl-startup.h dl-syscalls.h dl-sysdep.h dl-debug.h) -HEADERS := $(LN_HEADERS) $(LN_ARCH_HEADERS) $(top_builddir)ldso/include/dl-progname.h - -#lib-so-y := $(top_builddir)lib/$(patsubst %.$(MAJOR_VERSION),%,$(UCLIBC_LDSO)) -ld-uClibc-y := $(top_builddir)lib/$(patsubst %.$(MAJOR_VERSION),%,$(UCLIBC_LDSO)) +lib-so-y += $(ldso) objclean-y += ld-uClibc_clean -headers-$(HAVE_SHARED) += ldso_headers -headers_clean-y += ldso_headers_clean -$(top_builddir)lib/$(patsubst %.$(MAJOR_VERSION),%,$(UCLIBC_LDSO)): $(ld-uClibc_OUT)/ld-uClibc_so.a $(top_builddir)include/headers_done +$(ldso:.$(MAJOR_VERSION)=): $(ld-uClibc_OUT)/ld-uClibc_so.a $(call link.so,$(ldso_FULL_NAME),$(MAJOR_VERSION)) $(ld-uClibc_OUT)/ld-uClibc_so.a: $(ld-uClibc-so-y) @@ -74,19 +65,5 @@ $(ld-uClibc_OUT)/ld-uClibc_so.a: $(ld-uClibc-so-y) $(do_strip) $(do_ar) -ldso_headers: $(HEADERS) - -$(LN_HEADERS): - $(LN) -sf ../../$(top_srcdir)include/$(notdir $@) $@ - -$(LN_ARCH_HEADERS): - $(LN) -sf ../../$(top_srcdir)ldso/ldso/$(TARGET_ARCH)/$(notdir $@) $@ - -$(top_builddir)ldso/include/dl-progname.h: - echo '#include "$(TARGET_ARCH)/elfinterp.c"' > $@ - -ldso_headers_clean: - $(RM) $(HEADERS) - ld-uClibc_clean: $(RM) $(ld-uClibc_OUT)/*.{o,os,a} $(ld-uClibc_OUT)/*/*.{o,os} diff --git a/ldso/ldso/arm/elfinterp.c b/ldso/ldso/arm/elfinterp.c index 8086250ac..f5fbc816c 100644 --- a/ldso/ldso/arm/elfinterp.c +++ b/ldso/ldso/arm/elfinterp.c @@ -38,6 +38,8 @@ a more than adequate job of explaining everything required to get this working. */ +#include "ldso.h" + extern int _dl_linux_resolve(void); unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c index 194800ebb..2624ca3c5 100644 --- a/ldso/ldso/dl-elf.c +++ b/ldso/ldso/dl-elf.c @@ -898,8 +898,10 @@ void _dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info[], void { __dl_parse_dynamic_info(dpnt, dynamic_info, debug_addr, load_off); } + +/* we want this in ldso.so and libdl.a but nowhere else */ #ifdef __USE_GNU -#if ! defined LIBDL || (! defined PIC && ! defined __PIC__) +#if defined IS_IN_rtld || (defined IS_IN_libdl && ! defined SHARED) int __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data) { diff --git a/ldso/ldso/dl-tls.c b/ldso/ldso/dl-tls.c index 502720e58..1530cdcf5 100644 --- a/ldso/ldso/dl-tls.c +++ b/ldso/ldso/dl-tls.c @@ -719,6 +719,8 @@ _dl_update_slotinfo (unsigned long int req_modid) unsigned long int idx = req_modid; struct dtv_slotinfo_list *listp = _dl_tls_dtv_slotinfo_list; + _dl_debug_early ("Updating slotinfo for module %d\n", req_modid); + while (idx >= listp->len) { idx -= listp->len; @@ -899,6 +901,8 @@ _dl_add_to_slotinfo (struct link_map *l) struct dtv_slotinfo_list *prevp; size_t idx = l->l_tls_modid; + _dl_debug_early("Adding to slotinfo for %s\n", l->l_name); + /* Find the place in the dtv slotinfo list. */ listp = _dl_tls_dtv_slotinfo_list; prevp = NULL; /* Needed to shut up gcc. */ diff --git a/ldso/ldso/frv/elfinterp.c b/ldso/ldso/frv/elfinterp.c index cccf9b70c..60ba138b0 100644 --- a/ldso/ldso/frv/elfinterp.c +++ b/ldso/ldso/frv/elfinterp.c @@ -24,7 +24,7 @@ License along with uClibc; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <sys/cdefs.h> /* __attribute_used__ */ +#include <features.h> /* Program to load an ELF binary on a linux system, and run it. References to symbols in sharable libraries can be resolved by either @@ -37,7 +37,7 @@ USA. */ a more than adequate job of explaining everything required to get this working. */ -struct funcdesc_value volatile *__attribute__((__visibility__("hidden"))) +struct funcdesc_value volatile attribute_hidden * _dl_linux_resolver (struct elf_resolve *tpnt, int reloc_entry) { int reloc_type; diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c index 5376e48e3..31eec9f2a 100644 --- a/ldso/ldso/ldso.c +++ b/ldso/ldso/ldso.c @@ -43,7 +43,7 @@ #endif /* Pull in the value of _dl_progname */ -#include "dl-progname.h" +#include LDSO_ELFINTERP /* Global variables used within the shared library loader */ char *_dl_library_path = 0; /* Where we look for libraries */ diff --git a/ldso/ldso/m68k/elfinterp.c b/ldso/ldso/m68k/elfinterp.c index c777faa5b..80fa1c9ec 100644 --- a/ldso/ldso/m68k/elfinterp.c +++ b/ldso/ldso/m68k/elfinterp.c @@ -40,6 +40,8 @@ a more than adequate job of explaining everything required to get this working. */ +#include "ldso.h" + extern int _dl_linux_resolve(void); unsigned int diff --git a/ldso/ldso/powerpc/elfinterp.c b/ldso/ldso/powerpc/elfinterp.c index 3dd12f0ee..d0fa862f4 100644 --- a/ldso/ldso/powerpc/elfinterp.c +++ b/ldso/ldso/powerpc/elfinterp.c @@ -29,6 +29,8 @@ * SUCH DAMAGE. */ +#include "ldso.h" + extern int _dl_linux_resolve(void); void _dl_init_got(unsigned long *plt,struct elf_resolve *tpnt) diff --git a/ldso/ldso/sh/elfinterp.c b/ldso/ldso/sh/elfinterp.c index 3027a27f8..b37bf129d 100644 --- a/ldso/ldso/sh/elfinterp.c +++ b/ldso/ldso/sh/elfinterp.c @@ -39,6 +39,8 @@ a more than adequate job of explaining everything required to get this working. */ +#include "ldso.h" + extern int _dl_linux_resolve(void); unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) diff --git a/ldso/ldso/sh64/elfinterp.c b/ldso/ldso/sh64/elfinterp.c index c20314a85..845ff4fd0 100644 --- a/ldso/ldso/sh64/elfinterp.c +++ b/ldso/ldso/sh64/elfinterp.c @@ -41,6 +41,8 @@ a more than adequate job of explaining everything required to get this working. */ +#include "ldso.h" + extern int _dl_linux_resolve(void); unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) diff --git a/ldso/libdl/Makefile b/ldso/libdl/Makefile index f92f205a5..f9100219a 100644 --- a/ldso/libdl/Makefile +++ b/ldso/libdl/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../ top_builddir=../../ include $(top_builddir)Rules.mak all: libs diff --git a/ldso/libdl/Makefile.in b/ldso/libdl/Makefile.in index 326d303df..c63cedb2d 100644 --- a/ldso/libdl/Makefile.in +++ b/ldso/libdl/Makefile.in @@ -6,9 +6,9 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CFLAGS-libdl := -DNOT_IN_libc -DIS_IN_libdl $(SSP_ALL_CFLAGS) +CFLAGS-libdl := -DNOT_IN_libc -DIS_IN_libdl -DIS_IN_rtld $(SSP_ALL_CFLAGS) -CFLAGS-libdl +=-I$(top_builddir)ldso/include -I$(top_builddir)ldso/ldso +CFLAGS-libdl += -I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) -I$(top_srcdir)ldso/include -I$(top_srcdir)ldso/ldso CFLAGS-libdl += -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" @@ -16,13 +16,11 @@ ifeq ($(SUPPORT_LD_DEBUG),y) CFLAGS-libdl += -D__SUPPORT_LD_DEBUG__ endif -ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) -CFLAGS-libdl += $(PTINC) -DSHARED -DIS_IN_rtld -endif +CFLAGS-libdl.c := -DLDSO_ELFINTERP=\"$(TARGET_ARCH)/elfinterp.c\" LDFLAGS-libdl.so := $(LDFLAGS) -fini dl_cleanup -LIBS-libdl.so := $(LIBS) $(top_builddir)lib/$(UCLIBC_LDSO) +LIBS-libdl.so := $(LIBS) $(ldso) libdl_FULL_NAME := libdl-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so @@ -35,13 +33,16 @@ libdl_OBJ := $(patsubst $(libdl_DIR)/%.c,$(libdl_OUT)/%.o,$(libdl_SRC)) resolve := $(top_builddir)ldso/ldso/$(TARGET_ARCH)/resolve.o libdl-a-y := $(libdl_OBJ) $(resolve) +ifeq ($(DOPIC),y) +libdl-a-y := $(libdl-a-y:.o=.os) +endif libdl-so-y := $(libdl_OUT)/libdl.oS lib-a-$(HAVE_SHARED) += $(top_builddir)lib/libdl.a lib-so-y += $(top_builddir)lib/libdl.so objclean-y += libdl_clean -$(top_builddir)lib/libdl.so: $(libdl_OUT)/libdl_so.a ld-uClibc-y libc-y +$(top_builddir)lib/libdl.so: $(libdl_OUT)/libdl_so.a $(libc) $(call link.so,$(libdl_FULL_NAME),$(MAJOR_VERSION)) $(libdl_OUT)/libdl_so.a: $(libdl-so-y) @@ -49,11 +50,7 @@ $(libdl_OUT)/libdl_so.a: $(libdl-so-y) $(do_strip) $(do_ar) -ifeq ($(DOPIC),y) -$(top_builddir)lib/libdl.a: $(libdl-a-y:.o=.os) -else $(top_builddir)lib/libdl.a: $(libdl-a-y) -endif $(Q)$(INSTALL) -d $(dir $@) $(Q)$(RM) $@ $(do_strip) |