summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Rules.mak7
-rw-r--r--extra/Configs/Config.in7
-rw-r--r--include/dlfcn.h21
-rw-r--r--ldso/ldso/Makefile3
-rw-r--r--ldso/ldso/ldso.c10
-rw-r--r--ldso/libdl/libdl.c7
-rw-r--r--libc/misc/internals/__uClibc_main.c10
-rw-r--r--libc/stdlib/atexit.c3
-rw-r--r--libc/sysdeps/linux/common/mmap.c2
-rw-r--r--libc/sysdeps/linux/i386/Makefile2
-rw-r--r--libc/sysdeps/linux/i386/mmap.S49
11 files changed, 78 insertions, 43 deletions
diff --git a/Rules.mak b/Rules.mak
index 589343556..d5c10f79d 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -111,7 +111,8 @@ endif
TARGET_ARCH:=$(shell grep -s ^TARGET_ARCH $(TOPDIR)/.config | sed -e 's/^TARGET_ARCH=//' -e 's/"//g')
RUNTIME_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(RUNTIME_PREFIX))))))
DEVEL_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(DEVEL_PREFIX))))))
-export RUNTIME_PREFIX DEVEL_PREFIX
+KERNEL_SOURCE:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(KERNEL_SOURCE))))))
+export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_SOURCE
ARFLAGS:=cr
@@ -373,10 +374,6 @@ ifeq ($(DOPIC),y)
CFLAGS += $(PICFLAG)
endif
-ifeq ($(DL_FINI_CRT_COMPAT),y)
-CFLAGS += -D_DL_FINI_CRT_COMPAT
-endif
-
# Keep the check_as from being needlessly executed
ASFLAGS = $(CFLAGS)
ifndef ASFLAGS_NOEXEC
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index d0cf2da19..61b6bbf77 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -277,13 +277,6 @@ config LDSO_RUNPATH
Usage of RUNPATH tags is not too common, so disabling this feature
should be safe for most people.
-config DL_FINI_CRT_COMPAT
- bool "uClibc 0.9.27 compatibility"
- default n
- help
- Allows to update a 0.9.27 based system to new crt/fini handling.
- After rebuilding all apps, this option can be disabled.
-
config UCLIBC_CTOR_DTOR
bool "Support global constructors and destructors"
default y
diff --git a/include/dlfcn.h b/include/dlfcn.h
index 6dc4a5ab8..282fd076c 100644
--- a/include/dlfcn.h
+++ b/include/dlfcn.h
@@ -1,5 +1,5 @@
/* User functions for run-time dynamic loading.
- Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999,2000,2001,2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -49,18 +49,30 @@ extern void *dlopen (__const char *__file, int __mode) __THROW;
/* Unmap and close a shared object opened by `dlopen'.
The handle cannot be used again after calling `dlclose'. */
-extern int dlclose (void *__handle) __THROW;
+extern int dlclose (void *__handle) __THROW __nonnull ((1));
/* Find the run-time address in the shared object HANDLE refers to
of the symbol called NAME. */
extern void *dlsym (void *__restrict __handle,
- __const char *__restrict __name) __THROW;
+ __const char *__restrict __name) __THROW __nonnull ((2));
+
+#if 0
+#ifdef __USE_GNU
+/* Find the run-time address in the shared object HANDLE refers to
+ of the symbol called NAME with VERSION. */
+extern void *dlvsym (void *__restrict __handle,
+ __const char *__restrict __name,
+ __const char *__restrict __version)
+ __THROW __nonnull ((2, 3));
+#endif
+#endif
/* When any of the above functions fails, call this function
to return a string describing the error. Each call resets
the error string so that a following call returns null. */
extern char *dlerror (void) __THROW;
+
#ifdef __USE_GNU
/* Structure containing information about object searched using
`dladdr'. */
@@ -74,7 +86,8 @@ typedef struct
/* Fill in *INFO with the following information about ADDRESS.
Returns 0 iff no shared object's segments contain that address. */
-extern int dladdr (const void *__address, Dl_info *__info) __THROW;
+extern int dladdr (__const void *__address, Dl_info *__info)
+ __THROW __nonnull ((2));
/* Get information about the shared objects currently loaded */
extern int dlinfo (void);
diff --git a/ldso/ldso/Makefile b/ldso/ldso/Makefile
index 1f385e58d..32b345176 100644
--- a/ldso/ldso/Makefile
+++ b/ldso/ldso/Makefile
@@ -28,9 +28,6 @@ ASFLAGS+=$(call check_as,--noexecstack)
endif
XXFLAGS=$(XWARNINGS) $(SSP_DISABLE_FLAGS)
-ifeq ($(DL_FINI_CRT_COMPAT),y)
-XXFLAGS+=-D_DL_FINI_CRT_COMPAT
-endif
ifeq ($(DODEBUG),y)
# Not really much point in including debugging info, since gdb
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 8eca73ae4..a9dc70721 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -768,16 +768,6 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
(*dl_elf_func) ();
}
}
-#ifdef _DL_FINI_CRT_COMPAT
- /* arches that have moved their ldso FINI handling should skip this part */
- {
- int (*_dl_atexit) (void *) = (int (*)(void *)) (intptr_t) _dl_find_hash("atexit",
- _dl_symbol_tables, NULL, ELF_RTYPE_CLASS_PLT);
-
- if (_dl_atexit)
- (*_dl_atexit) (_dl_fini);
- }
-#endif
/* Find the real malloc function and make ldso functions use that from now on */
_dl_malloc_function = (void* (*)(size_t)) (intptr_t) _dl_find_hash("malloc",
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index f8f90dfb7..edb7c5033 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -450,6 +450,13 @@ void *dlsym(void *vhandle, const char *name)
return ret;
}
+#if 0
+void *dlvsym(void *vhandle, const char *name, const char *version)
+{
+ return dlsym(vhandle, name);
+}
+#endif
+
static int do_dlclose(void *vhandle, int need_fini)
{
struct dyn_elf *rpnt, *rpnt1, *rpnt1_tmp;
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 5c1560d1b..c9f3d0e40 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -266,13 +266,3 @@ __uClibc_main(int (*main)(int, char **, char **), int argc,
*/
exit(main(argc, argv, __environ));
}
-
-#ifdef _DL_FINI_CRT_COMPAT
-extern int weak_function main(int argc, char **argv, char **envp);
-void __attribute__ ((__noreturn__))
-__uClibc_start_main(int argc, char **argv, char **envp,
- void (*app_fini)(void), void (*app_init)(void))
-{
- __uClibc_main(main, argc, argv, app_init, app_fini, NULL, NULL);
-}
-#endif
diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c
index 280f42cb7..1962c1b63 100644
--- a/libc/stdlib/atexit.c
+++ b/libc/stdlib/atexit.c
@@ -223,6 +223,7 @@ extern void (*__app_fini)(void);
#endif
extern void (*__rtld_fini)(void);
+
/*
* Normal program termination
*/
@@ -239,10 +240,8 @@ void exit(int rv)
if (__app_fini != NULL)
(__app_fini)();
#endif
-#ifndef _DL_FINI_CRT_COMPAT
if (__rtld_fini != NULL)
(__rtld_fini)();
-#endif
/* If we are using stdio, try to shut it down. At the very least,
* this will attempt to commit all buffered writes. It may also
diff --git a/libc/sysdeps/linux/common/mmap.c b/libc/sysdeps/linux/common/mmap.c
index 177e0da16..94c0d82b3 100644
--- a/libc/sysdeps/linux/common/mmap.c
+++ b/libc/sysdeps/linux/common/mmap.c
@@ -13,7 +13,7 @@
#ifdef __NR_mmap
#define __NR__mmap __NR_mmap
-_syscall1(__ptr_t, _mmap, unsigned long *, buffer);
+static inline _syscall1(__ptr_t, _mmap, unsigned long *, buffer);
__ptr_t mmap(__ptr_t addr, size_t len, int prot,
int flags, int fd, __off_t offset)
{
diff --git a/libc/sysdeps/linux/i386/Makefile b/libc/sysdeps/linux/i386/Makefile
index e7cee0c0b..bde820b2b 100644
--- a/libc/sysdeps/linux/i386/Makefile
+++ b/libc/sysdeps/linux/i386/Makefile
@@ -25,7 +25,7 @@ SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ))
CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
SSRC=__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
- bsd-_setjmp.S syscall.S mmap64.S
+ bsd-_setjmp.S syscall.S mmap.S mmap64.S
SOBJS=$(patsubst %.S,%.o, $(SSRC))
CSRC=brk.c sigaction.c __syscall_error.c
diff --git a/libc/sysdeps/linux/i386/mmap.S b/libc/sysdeps/linux/i386/mmap.S
new file mode 100644
index 000000000..5dde939bf
--- /dev/null
+++ b/libc/sysdeps/linux/i386/mmap.S
@@ -0,0 +1,49 @@
+/* Copyright (C) 1995,96,97,98,99,2000,2002,2005 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#define _ERRNO_H 1
+#include <features.h>
+#include <bits/errno.h>
+#include <sys/syscall.h>
+
+.text
+.global mmap
+.type mmap,%function
+mmap:
+
+ /* Save registers. */
+ movl %ebx, %edx
+
+ movl $__NR_mmap, %eax /* System call number in %eax. */
+
+ lea 4(%esp), %ebx /* Address of args is 1st arg. */
+
+ /* Do the system call trap. */
+ int $0x80
+
+ /* Restore registers. */
+ movl %edx, %ebx
+
+ /* If 0 > %eax > -4096 there was an error. */
+ cmpl $-4096, %eax
+ ja __syscall_error
+
+ /* Successful; return the syscall's value. */
+ ret
+
+.size mmap,.-mmap