20 Jan 2011, uClibc 0.9.32-rc2 Release Candidate
>
>
> - Release candidate 2 for 0.9.32 was released today.This release contains
> - the generic implementation of protected symbols for all archs with
> respect
> - to -rc1. The final release is planned for end of january 2011.
> - Please test and report back.
> + Release candidate 2 for 0.9.32 was released today. This release candidate
> + contains the generic implementation of protected symbols for all archs
> + with respect to -rc1.
>
>
> Go to the downloads page for the
> --
> 1.7.3.4
>
Bernhard,
have you forgotten to add the tag ?
cheers,
carmelo
> _______________________________________________
> uClibc-cvs mailing list
> uClibc-cvs at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc-cvs
>
From bugzilla at busybox.net Mon Apr 11 02:10:06 2011
From: bugzilla at busybox.net (bugzilla at busybox.net)
Date: Mon, 11 Apr 2011 02:10:06 +0000 (UTC)
Subject: [Bug 3589] New: defconfig & option order in Makefile.in
Message-ID:
https://bugs.busybox.net/show_bug.cgi?id=3589
Summary: defconfig & option order in Makefile.in
Product: uClibc
Version: 0.9.31
Platform: PC
OS/Version: Other
Status: NEW
Severity: minor
Priority: P5
Component: Other
AssignedTo: unassigned at uclibc.org
ReportedBy: tsuckow at gmail.com
CC: uclibc-cvs at uclibc.org
Estimated Hours: 0.0
The modified kconfig defines -D to be the same function as -d. In addition -d
does not take an argument and Config.in should be passed as a non-option
argument. The existing argument order appears to work on distributions such as
Fedora but chokes on Cygwin (newlib?).
The following change worked for me:
defconfig: $(top_builddir)extra/config/conf
$(Q)$(top_builddir)extra/config/conf -d extra/Configs/Config.in \
-D extra/Configs/defconfigs/$(ARCH)
should read:
defconfig: $(top_builddir)extra/config/conf
$(Q)$(top_builddir)extra/config/conf -D extra/Configs/defconfigs/$(ARCH) \
extra/Configs/Config.in
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit future] _exit.c: include the proper headers
Message-ID: <20110411142402.385CE8254F@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=15cef361ad2641ed365677c43e81d61edffd988f
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
Signed-off-by: Peter S. Mazinger
---
libc/sysdeps/linux/common/_exit.c | 14 +++-----------
1 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/libc/sysdeps/linux/common/_exit.c b/libc/sysdeps/linux/common/_exit.c
index 51117d1..2196a98 100644
--- a/libc/sysdeps/linux/common/_exit.c
+++ b/libc/sysdeps/linux/common/_exit.c
@@ -7,25 +7,17 @@
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
-#include
-#include
#include
-#include
+#include
#include
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
-#include
-#endif
-
-void attribute_noreturn _exit(int status)
+void _exit(int status)
{
/* The loop is added only to keep gcc happy. */
while(1)
{
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
-# ifdef __NR_exit_group
+#if defined __NR_exit_group && defined __UCLIBC_HAS_THREADS_NATIVE__
INLINE_SYSCALL(exit_group, 1, status);
-# endif
#endif
INLINE_SYSCALL(exit, 1, status);
}
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit future] munmap.c: do not include unistd.h
Message-ID: <20110411142402.1138C8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=6cbc03c2e3a76a5990addeee5fb2a2da9dd6ca53
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
Signed-off-by: Peter S. Mazinger
---
libc/sysdeps/linux/common/munmap.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/libc/sysdeps/linux/common/munmap.c b/libc/sysdeps/linux/common/munmap.c
index 736bffe..22c393f 100644
--- a/libc/sysdeps/linux/common/munmap.c
+++ b/libc/sysdeps/linux/common/munmap.c
@@ -8,9 +8,7 @@
*/
#include
-#include
#include
-
_syscall2(int, munmap, void *, start, size_t, length)
libc_hidden_def(munmap)
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-syscall.h: use system headers as much as
possible, cleanup a bit
Message-ID: <20110411142450.C11B28254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=a698a25a8f0b0faad1117fc6f27bac463bda28d6
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/include/dl-syscall.h | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h
index f002e8b..2cf58ff 100644
--- a/ldso/include/dl-syscall.h
+++ b/ldso/include/dl-syscall.h
@@ -15,8 +15,10 @@
#include
#include /* MAP_ANONYMOUS -- differs between platforms */
-#define _FCNTL_H
-#include
+#define stat __hide_stat
+#include
+#include
+#undef stat
/* Pull in whatever this particular arch's kernel thinks the kernel version of
* struct stat should look like. It turns out that each arch has a different
@@ -29,10 +31,6 @@
#include
#include
-/* Protection bits. -- instead of including sys/stat.h */
-#define S_ISUID 04000 /* Set user ID on execution. */
-#define S_ISGID 02000 /* Set group ID on execution. */
-
/* Pull in the arch specific syscall implementation */
#ifdef HAVE_DL_SYSCALLS_H
# include
@@ -114,12 +112,7 @@ static __always_inline _syscall3(int, _dl_readlink, const char *, path, char *,
# include
# define __NR__dl_gettimeofday __NR_gettimeofday
static __always_inline _syscall2(int, _dl_gettimeofday, struct timeval *, tv,
-# ifdef __USE_BSD
- struct timezone *
-# else
- void *
-# endif
- , tz)
+ __timezone_ptr_t, tz)
#endif
/* Some architectures always use 12 as page shift for mmap2() eventhough the
@@ -130,7 +123,6 @@ static __always_inline _syscall2(int, _dl_gettimeofday, struct timeval *, tv,
# define MMAP2_PAGE_SHIFT 12
#endif
-#define MAP_FAILED ((void *) -1)
static __always_inline
void *_dl_mmap(void *addr, unsigned long size, int prot,
int flags, int fd, unsigned long offset)
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] sh64: remove dl-syscalls.h
Message-ID: <20110411142451.38A4E8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=68b377cfe30056294d7c7d07977bdd186c141a78
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
The "special" __syscall_return was only added to handle errno,
the general approach should handle this correctly
Signed-off-by: Peter S. Mazinger
---
ldso/ldso/sh64/dl-syscalls.h | 18 ------------------
ldso/ldso/sh64/dl-sysdep.h | 2 --
2 files changed, 0 insertions(+), 20 deletions(-)
delete mode 100644 ldso/ldso/sh64/dl-syscalls.h
diff --git a/ldso/ldso/sh64/dl-syscalls.h b/ldso/ldso/sh64/dl-syscalls.h
deleted file mode 100644
index 1de3899..0000000
--- a/ldso/ldso/sh64/dl-syscalls.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#undef __syscall_return
-#define __syscall_return(type, res) \
-do { \
- /* \
- * Note: when returning from kernel the return value is in r9 \
- * \
- * This prevents conflicts between return value and arg1 \
- * when dispatching signal handler, in other words makes \
- * life easier in the system call epilogue (see entry.S) \
- */ \
- register unsigned long __sr2 __asm__ ("r2") = res; \
- if ((unsigned long)(res) >= (unsigned long)(-125)) { \
- __set_errno(-(res)); \
- __sr2 = -1; \
- } \
- return (type)(__sr2); \
-} while (0)
-
diff --git a/ldso/ldso/sh64/dl-sysdep.h b/ldso/ldso/sh64/dl-sysdep.h
index 3ad7efa..b60dcea 100644
--- a/ldso/ldso/sh64/dl-sysdep.h
+++ b/ldso/ldso/sh64/dl-sysdep.h
@@ -27,8 +27,6 @@
#define ELF_MACHINE_JMP_SLOT R_SH_JMP_SLOT
-#define HAVE_DL_SYSCALLS_H
-
/* Need bootstrap relocations */
#define ARCH_NEEDS_BOOTSTRAP_RELOCS
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-sysdep.h: include on all archs elf.h and
link.h
Message-ID: <20110411142451.0092F8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=0bcfb8636f878d1da000bc2d6d33e183774cfdb9
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/ldso/arm/dl-sysdep.h | 2 ++
ldso/ldso/avr32/dl-sysdep.h | 2 +-
ldso/ldso/bfin/dl-sysdep.h | 13 ++-----------
ldso/ldso/c6x/dl-sysdep.h | 13 ++-----------
ldso/ldso/cris/dl-sysdep.h | 2 +-
ldso/ldso/frv/dl-sysdep.h | 13 ++-----------
ldso/ldso/i386/dl-sysdep.h | 2 ++
ldso/ldso/m68k/dl-sysdep.h | 2 ++
ldso/ldso/sh/dl-sysdep.h | 2 ++
ldso/ldso/sh64/dl-sysdep.h | 2 ++
ldso/ldso/sparc/dl-sysdep.h | 2 ++
ldso/ldso/x86_64/dl-sysdep.h | 1 +
12 files changed, 21 insertions(+), 35 deletions(-)
diff --git a/ldso/ldso/arm/dl-sysdep.h b/ldso/ldso/arm/dl-sysdep.h
index 5f17a77..0cc87b6 100644
--- a/ldso/ldso/arm/dl-sysdep.h
+++ b/ldso/ldso/arm/dl-sysdep.h
@@ -11,6 +11,8 @@
/* Define this if the system uses RELOCA. */
#undef ELF_USES_RELOCA
#include
+#include
+
/* Initialization sequence for the GOT. */
#define INIT_GOT(GOT_BASE,MODULE) \
{ \
diff --git a/ldso/ldso/avr32/dl-sysdep.h b/ldso/ldso/avr32/dl-sysdep.h
index 0b52a7a..311ec9a 100644
--- a/ldso/ldso/avr32/dl-sysdep.h
+++ b/ldso/ldso/avr32/dl-sysdep.h
@@ -9,8 +9,8 @@
/* Define this if the system uses RELOCA. */
#define ELF_USES_RELOCA
-
#include
+#include
#define ARCH_NUM 1
#define DT_AVR32_GOTSZ_IDX (DT_NUM + OS_NUM)
diff --git a/ldso/ldso/bfin/dl-sysdep.h b/ldso/ldso/bfin/dl-sysdep.h
index be705e0..4e3108e 100644
--- a/ldso/ldso/bfin/dl-sysdep.h
+++ b/ldso/ldso/bfin/dl-sysdep.h
@@ -28,6 +28,8 @@ USA. */
* Define this if the system uses RELOCA.
*/
#undef ELF_USES_RELOCA
+#include
+#include
/* JMPREL relocs are inside the DT_RELA table. */
#define ELF_MACHINE_PLTREL_OVERLAP
@@ -201,17 +203,6 @@ while (0)
#define DL_GET_READY_TO_RUN_EXTRA_ARGS \
, dl_boot_progmap, dl_boot_got_pointer
-
-#ifdef __USE_GNU
-# include
-#else
-# define __USE_GNU
-# include
-# undef __USE_GNU
-#endif
-
-#include
-
static __always_inline Elf32_Addr
elf_machine_load_address (void)
{
diff --git a/ldso/ldso/c6x/dl-sysdep.h b/ldso/ldso/c6x/dl-sysdep.h
index e5ddb07..e1954c6 100644
--- a/ldso/ldso/c6x/dl-sysdep.h
+++ b/ldso/ldso/c6x/dl-sysdep.h
@@ -7,12 +7,12 @@
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
-#include
-
/*
* Define this if the system uses RELOCA.
*/
#define ELF_USES_RELOCA
+#include
+#include
/* JMPREL relocs are inside the DT_RELA table. */
/* Actually looks like a linker bug sets DT_JMPREL anyway */
@@ -167,15 +167,6 @@ while (0)
#define DL_BOOT_COMPUTE_DYN(dpnt, got, load_addr) \
((dpnt) = dl_boot_ldso_dyn_pointer)
-
-#ifdef __USE_GNU
-# include
-#else
-# define __USE_GNU
-# include
-# undef __USE_GNU
-#endif
-
static __always_inline Elf32_Addr
elf_machine_load_address (void)
{
diff --git a/ldso/ldso/cris/dl-sysdep.h b/ldso/ldso/cris/dl-sysdep.h
index be97ce7..900eda1 100644
--- a/ldso/ldso/cris/dl-sysdep.h
+++ b/ldso/ldso/cris/dl-sysdep.h
@@ -1,7 +1,7 @@
/* CRIS can never use Elf32_Rel relocations. */
#define ELF_USES_RELOCA
-
#include
+#include
/* Initialization sequence for the GOT. */
#define INIT_GOT(GOT_BASE,MODULE) \
diff --git a/ldso/ldso/frv/dl-sysdep.h b/ldso/ldso/frv/dl-sysdep.h
index e33b399..7193c20 100644
--- a/ldso/ldso/frv/dl-sysdep.h
+++ b/ldso/ldso/frv/dl-sysdep.h
@@ -14,6 +14,8 @@
* Define this if the system uses RELOCA.
*/
#undef ELF_USES_RELOCA
+#include
+#include
/* JMPREL relocs are inside the DT_RELA table. */
#define ELF_MACHINE_PLTREL_OVERLAP
@@ -178,14 +180,3 @@ while (0)
, struct elf32_fdpic_loadmap *dl_boot_progmap
#define DL_GET_READY_TO_RUN_EXTRA_ARGS \
, dl_boot_progmap
-
-
-
-
-#ifdef __USE_GNU
-# include
-#else
-# define __USE_GNU
-# include
-# undef __USE_GNU
-#endif
diff --git a/ldso/ldso/i386/dl-sysdep.h b/ldso/ldso/i386/dl-sysdep.h
index 535e8e3..b91bd61 100644
--- a/ldso/ldso/i386/dl-sysdep.h
+++ b/ldso/ldso/i386/dl-sysdep.h
@@ -8,6 +8,8 @@
/* Define this if the system uses RELOCA. */
#undef ELF_USES_RELOCA
#include
+#include
+
/* Initialization sequence for the GOT. */
#define INIT_GOT(GOT_BASE,MODULE) \
do { \
diff --git a/ldso/ldso/m68k/dl-sysdep.h b/ldso/ldso/m68k/dl-sysdep.h
index 87b0245..5660571 100644
--- a/ldso/ldso/m68k/dl-sysdep.h
+++ b/ldso/ldso/m68k/dl-sysdep.h
@@ -8,6 +8,8 @@
/* Define this if the system uses RELOCA. */
#define ELF_USES_RELOCA
#include
+#include
+
/* Initialization sequence for a GOT. */
#define INIT_GOT(GOT_BASE,MODULE) \
do { \
diff --git a/ldso/ldso/sh/dl-sysdep.h b/ldso/ldso/sh/dl-sysdep.h
index 650a8fd..a8a4dc7 100644
--- a/ldso/ldso/sh/dl-sysdep.h
+++ b/ldso/ldso/sh/dl-sysdep.h
@@ -6,6 +6,8 @@
/* Define this if the system uses RELOCA. */
#define ELF_USES_RELOCA
#include
+#include
+
/*
* Initialization sequence for a GOT.
*/
diff --git a/ldso/ldso/sh64/dl-sysdep.h b/ldso/ldso/sh64/dl-sysdep.h
index e413c59..3ad7efa 100644
--- a/ldso/ldso/sh64/dl-sysdep.h
+++ b/ldso/ldso/sh64/dl-sysdep.h
@@ -7,6 +7,8 @@
/* Define this if the system uses RELOCA. */
#define ELF_USES_RELOCA
#include
+#include
+
/*
* Initialization sequence for a GOT.
*/
diff --git a/ldso/ldso/sparc/dl-sysdep.h b/ldso/ldso/sparc/dl-sysdep.h
index bb2b1cd..f2cd46b 100644
--- a/ldso/ldso/sparc/dl-sysdep.h
+++ b/ldso/ldso/sparc/dl-sysdep.h
@@ -8,6 +8,8 @@
/* Define this if the system uses RELOCA. */
#define ELF_USES_RELOCA
#include
+#include
+
/*
* Initialization sequence for a GOT. For the Sparc, this points to the
* PLT, and we need to initialize a couple of the slots. The PLT should
diff --git a/ldso/ldso/x86_64/dl-sysdep.h b/ldso/ldso/x86_64/dl-sysdep.h
index 2c6c9e8..a64af00 100644
--- a/ldso/ldso/x86_64/dl-sysdep.h
+++ b/ldso/ldso/x86_64/dl-sysdep.h
@@ -24,6 +24,7 @@
#define ELF_USES_RELOCA
#include
#include
+
/* Initialization sequence for the GOT. */
#define INIT_GOT(GOT_BASE,MODULE) \
do { \
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-syscall.h: remove inconsistent mmap
implementation, use the common one
Message-ID: <20110411142451.58DDD8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=820bfb1fae5fb1d66f2bf5f8b989bac7bf3e4a93
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/include/dl-syscall.h | 42 +-------------------------------------
libc/sysdeps/linux/common/mmap.c | 26 +++++++++++++----------
2 files changed, 16 insertions(+), 52 deletions(-)
diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h
index 2cf58ff..0b1c6c2 100644
--- a/ldso/include/dl-syscall.h
+++ b/ldso/include/dl-syscall.h
@@ -115,47 +115,7 @@ static __always_inline _syscall2(int, _dl_gettimeofday, struct timeval *, tv,
__timezone_ptr_t, tz)
#endif
-/* Some architectures always use 12 as page shift for mmap2() eventhough the
- * real PAGE_SHIFT != 12. Other architectures use the same value as
- * PAGE_SHIFT...
- */
-#ifndef MMAP2_PAGE_SHIFT
-# define MMAP2_PAGE_SHIFT 12
-#endif
-
-static __always_inline
-void *_dl_mmap(void *addr, unsigned long size, int prot,
- int flags, int fd, unsigned long offset)
-{
-#if defined(__UCLIBC_MMAP_HAS_6_ARGS__) && defined(__NR_mmap)
- /* first try mmap(), syscall6() style */
- return (void *)INLINE_SYSCALL(mmap, 6, addr, size, prot, flags, fd, offset);
-
-#elif defined(__NR_mmap2) && !defined (__mcoldfire__)
- /* then try mmap2() */
- unsigned long shifted;
-
- if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1))
- return MAP_FAILED;
-
- /* gcc needs help with putting things onto the stack */
- shifted = offset >> MMAP2_PAGE_SHIFT;
- return (void *)INLINE_SYSCALL(mmap2, 6, addr, size, prot, flags, fd, shifted);
-
-#elif defined(__NR_mmap)
- /* finally, fall back to mmap(), syscall1() style */
- unsigned long buffer[6];
- buffer[0] = (unsigned long) addr;
- buffer[1] = (unsigned long) size;
- buffer[2] = (unsigned long) prot;
- buffer[3] = (unsigned long) flags;
- buffer[4] = (unsigned long) fd;
- buffer[5] = (unsigned long) offset;
- return (void *)INLINE_SYSCALL(mmap, 1, buffer);
-#else
-# error "Your architecture doesn't seem to provide mmap() !?"
-#endif
-}
+#include "../../libc/sysdeps/linux/common/mmap.c"
#else /* IS_IN_rtld */
diff --git a/libc/sysdeps/linux/common/mmap.c b/libc/sysdeps/linux/common/mmap.c
index dbc66c2..4446a02 100644
--- a/libc/sysdeps/linux/common/mmap.c
+++ b/libc/sysdeps/linux/common/mmap.c
@@ -16,9 +16,9 @@
# error disable __UCLIBC_MMAP_HAS_6_ARGS__ for this arch
# endif
-# define __NR__mmap __NR_mmap
-static _syscall6(void *, _mmap, void *, addr, size_t, len,
- int, prot, int, flags, int, fd, __off_t, offset)
+# define __NR__dl_mmap __NR_mmap
+static __always_inline _syscall6(void *, _dl_mmap, void *, addr, size_t, len,
+ int, prot, int, flags, int, fd, __off_t, offset)
#elif defined __NR_mmap2 && defined _syscall6
@@ -29,17 +29,19 @@ static _syscall6(void *, _mmap, void *, addr, size_t, len,
# endif
# define __NR___syscall_mmap2 __NR_mmap2
-static __inline__ _syscall6(void *, __syscall_mmap2, void *, addr, size_t, len,
- int, prot, int, flags, int, fd, __off_t, offset)
+static __always_inline _syscall6(void *, __syscall_mmap2, void *, addr, size_t, len,
+ int, prot, int, flags, int, fd, __off_t, offset)
-static void *_mmap(void *addr, size_t len, int prot, int flags,
- int fd, __off_t offset)
+static __always_inline void *_dl_mmap(void *addr, size_t len, int prot, int flags,
+ int fd, __off_t offset)
{
const int mmap2_shift = MMAP2_PAGE_SHIFT;
const __off_t mmap2_mask = ((__off_t) 1 << MMAP2_PAGE_SHIFT) - 1;
/* check if offset is page aligned */
if (offset & mmap2_mask) {
+# ifndef IS_IN_rtld
__set_errno(EINVAL);
+# endif
return MAP_FAILED;
}
# ifdef __USE_FILE_OFFSET64
@@ -54,10 +56,10 @@ static void *_mmap(void *addr, size_t len, int prot, int flags,
#elif defined __NR_mmap
# define __NR___syscall_mmap __NR_mmap
-static __inline__ _syscall1(void *, __syscall_mmap, unsigned long *, buffer)
+static __always_inline _syscall1(void *, __syscall_mmap, unsigned long *, buffer)
-static void *_mmap(void *addr, size_t len, int prot, int flags,
- int fd, __off_t offset)
+static __always_inline void *_dl_mmap(void *addr, size_t len, int prot, int flags,
+ int fd, __off_t offset)
{
unsigned long buffer[6];
@@ -76,5 +78,7 @@ static void *_mmap(void *addr, size_t len, int prot, int flags,
#endif
-strong_alias(_mmap,mmap)
+#ifndef IS_IN_rtld
+strong_alias(_dl_mmap,mmap)
+#endif
libc_hidden_def(mmap)
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-syscall.h: use newer common get[e]uid,
get[e]gid and getpid
Message-ID: <20110411142451.8705D8254F@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=d21f59a4a02f3d274d6eb0cbba46409d3ab0ef71
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/include/dl-syscall.h | 34 +++++-----------------------------
libc/sysdeps/linux/common/getegid.c | 5 +++++
libc/sysdeps/linux/common/geteuid.c | 5 +++++
libc/sysdeps/linux/common/getgid.c | 9 +++++++++
libc/sysdeps/linux/common/getpid.c | 7 ++++++-
libc/sysdeps/linux/common/getuid.c | 9 +++++++++
6 files changed, 39 insertions(+), 30 deletions(-)
diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h
index 0b1c6c2..9f4ac05 100644
--- a/ldso/include/dl-syscall.h
+++ b/ldso/include/dl-syscall.h
@@ -74,35 +74,11 @@ static __always_inline _syscall2(int, _dl_fstat, int, fd, struct stat *, buf)
#define __NR__dl_munmap __NR_munmap
static __always_inline _syscall2(int, _dl_munmap, void *, start, unsigned long, length)
-#ifdef __NR_getxuid
-# define __NR_getuid __NR_getxuid
-#endif
-#define __NR__dl_getuid __NR_getuid
-static __always_inline _syscall0(uid_t, _dl_getuid)
-
-#ifndef __NR_geteuid
-# define __NR_geteuid __NR_getuid
-#endif
-#define __NR__dl_geteuid __NR_geteuid
-static __always_inline _syscall0(uid_t, _dl_geteuid)
-
-#ifdef __NR_getxgid
-# define __NR_getgid __NR_getxgid
-#endif
-#define __NR__dl_getgid __NR_getgid
-static __always_inline _syscall0(gid_t, _dl_getgid)
-
-#ifndef __NR_getegid
-# define __NR_getegid __NR_getgid
-#endif
-#define __NR__dl_getegid __NR_getegid
-static __always_inline _syscall0(gid_t, _dl_getegid)
-
-#ifdef __NR_getxpid
-# define __NR_getpid __NR_getxpid
-#endif
-#define __NR__dl_getpid __NR_getpid
-static __always_inline _syscall0(gid_t, _dl_getpid)
+#include "../../libc/sysdeps/linux/common/getuid.c"
+#include "../../libc/sysdeps/linux/common/geteuid.c"
+#include "../../libc/sysdeps/linux/common/getgid.c"
+#include "../../libc/sysdeps/linux/common/getegid.c"
+#include "../../libc/sysdeps/linux/common/getpid.c"
#define __NR__dl_readlink __NR_readlink
static __always_inline _syscall3(int, _dl_readlink, const char *, path, char *, buf,
diff --git a/libc/sysdeps/linux/common/getegid.c b/libc/sysdeps/linux/common/getegid.c
index 80a8ac9..9e2998b 100644
--- a/libc/sysdeps/linux/common/getegid.c
+++ b/libc/sysdeps/linux/common/getegid.c
@@ -16,6 +16,11 @@
#endif
#ifdef __NR_getegid
+# ifdef IS_IN_rtld
+# define __NR__dl_getegid __NR_getegid
+# define getegid _dl_getegid
+static __always_inline
+# endif
_syscall_noerr0(gid_t, getegid)
libc_hidden_def(getegid)
#endif
diff --git a/libc/sysdeps/linux/common/geteuid.c b/libc/sysdeps/linux/common/geteuid.c
index 610fbc1..4830c57 100644
--- a/libc/sysdeps/linux/common/geteuid.c
+++ b/libc/sysdeps/linux/common/geteuid.c
@@ -16,6 +16,11 @@
#endif
#ifdef __NR_geteuid
+# ifdef IS_IN_rtld
+# define __NR__dl_geteuid __NR_geteuid
+# define geteuid _dl_geteuid
+static __always_inline
+# endif
_syscall_noerr0(uid_t, geteuid)
libc_hidden_def(geteuid)
#endif
diff --git a/libc/sysdeps/linux/common/getgid.c b/libc/sysdeps/linux/common/getgid.c
index ccfbfc0..868c9e1 100644
--- a/libc/sysdeps/linux/common/getgid.c
+++ b/libc/sysdeps/linux/common/getgid.c
@@ -19,9 +19,18 @@
# define __NR_getgid __NR_getgid32
#endif
+#ifdef IS_IN_rtld
+# define __NR__dl_getgid __NR_getgid
+# define getgid _dl_getgid
+static __always_inline
+#endif
_syscall_noerr0(gid_t, getgid)
libc_hidden_def(getgid)
#if !defined __NR_getegid32 && !defined __NR_getegid
+# ifdef IS_IN_rtld
+# define getegid _dl_getegid
+static __always_inline
+# endif
strong_alias(getgid,getegid)
libc_hidden_def(getegid)
#endif
diff --git a/libc/sysdeps/linux/common/getpid.c b/libc/sysdeps/linux/common/getpid.c
index d9a6908..88ba680 100644
--- a/libc/sysdeps/linux/common/getpid.c
+++ b/libc/sysdeps/linux/common/getpid.c
@@ -15,8 +15,13 @@
# define __NR_getpid __NR_getxpid
#endif
+#ifdef IS_IN_rtld
+# define __NR__dl_getpid __NR_getpid
+# define getpid _dl_getpid
+static __always_inline
+#endif
_syscall_noerr0(pid_t, getpid)
libc_hidden_weak(getpid)
-#ifndef __NR_getppid
+#if !defined __NR_getppid && !defined IS_IN_rtld
strong_alias(getpid,getppid)
#endif
diff --git a/libc/sysdeps/linux/common/getuid.c b/libc/sysdeps/linux/common/getuid.c
index f921acb..b59bfac 100644
--- a/libc/sysdeps/linux/common/getuid.c
+++ b/libc/sysdeps/linux/common/getuid.c
@@ -19,9 +19,18 @@
# define __NR_getuid __NR_getuid32
#endif
+#ifdef IS_IN_rtld
+# define __NR__dl_getuid __NR_getuid
+# define getuid _dl_getuid
+static __always_inline
+#endif
_syscall_noerr0(uid_t, getuid)
libc_hidden_def(getuid)
#if !defined __NR_geteuid32 && !defined __NR_geteuid
+# ifdef IS_IN_rtld
+# define geteuid _dl_geteuid
+static __always_inline
+# endif
strong_alias(getuid,geteuid)
libc_hidden_def(geteuid)
#endif
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-syscall.h: mark _dl_exit with
attribute_noreturn
Message-ID: <20110411142452.4111D8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=486f3d1b16ec46abb6b21e9161940e6f40250213
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
Patch is too large, so refusing to show it
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] _exit.c: include the proper headers
Message-ID: <20110411142452.A9B868254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=15cef361ad2641ed365677c43e81d61edffd988f
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
Patch is too large, so refusing to show it
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-syscall.h: change _dl_close to void,
return value is nowhere checked
Message-ID: <20110411142452.F272F8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=3ef57d53be081aeffe331478763434a3045c6493
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
Patch is too large, so refusing to show it
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] munmap.c: do not include unistd.h
Message-ID: <20110411142451.CDECA8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=6cbc03c2e3a76a5990addeee5fb2a2da9dd6ca53
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
Patch is too large, so refusing to show it
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-inlines.h: remove useless prototypes for
_dl_debug and _dl_debug_file
Message-ID: <20110411142453.214778254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=4901b37adda08e89bb871e1206040f419ddca1f9
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/ldso/bfin/dl-inlines.h | 2 --
ldso/ldso/frv/dl-inlines.h | 2 --
2 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/ldso/ldso/bfin/dl-inlines.h b/ldso/ldso/bfin/dl-inlines.h
index 66c6dd6..1b284d9 100644
--- a/ldso/ldso/bfin/dl-inlines.h
+++ b/ldso/ldso/bfin/dl-inlines.h
@@ -85,8 +85,6 @@ __dl_init_loadaddr_hdr (struct elf32_fdpic_loadaddr loadaddr, void *addr,
#if defined (__SUPPORT_LD_DEBUG__)
{
- extern char *_dl_debug;
- extern int _dl_debug_file;
if (_dl_debug)
_dl_dprintf(_dl_debug_file, "%i: mapped %x at %x, size %x\n",
loadaddr.map->nsegs-1,
diff --git a/ldso/ldso/frv/dl-inlines.h b/ldso/ldso/frv/dl-inlines.h
index 8f4c13a..c07e5aa 100644
--- a/ldso/ldso/frv/dl-inlines.h
+++ b/ldso/ldso/frv/dl-inlines.h
@@ -69,8 +69,6 @@ __dl_init_loadaddr_hdr (struct elf32_fdpic_loadaddr loadaddr, void *addr,
#if defined (__SUPPORT_LD_DEBUG__)
{
- extern char *_dl_debug;
- extern int _dl_debug_file;
if (_dl_debug)
_dl_dprintf(_dl_debug_file, "%i: mapped %x at %x, size %x\n",
loadaddr.map->nsegs-1,
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] ldsodefs.h: add prototypes for functions
used in libdl and libc
Message-ID: <20110411142453.4B3C18254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=7d7ff83fc7a8bb5ab15b757552a72d7af84fb8a8
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/include/ldsodefs.h | 7 ++++++-
ldso/ldso/dl-array.c | 16 +++++-----------
libc/misc/internals/__uClibc_main.c | 5 +----
3 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/ldso/include/ldsodefs.h b/ldso/include/ldsodefs.h
index 7eb4c8f..ebfee72 100644
--- a/ldso/include/ldsodefs.h
+++ b/ldso/include/ldsodefs.h
@@ -50,9 +50,14 @@ extern struct r_debug *_dl_debug_addr;
extern void *(*_dl_malloc_function)(size_t);
extern void (*_dl_free_function) (void *p);
struct elf_resolve;
+# ifdef __UCLIBC_CTOR_DTOR__
+extern void _dl_app_init_array(void);
+extern void _dl_app_fini_array(void);
+# endif
+#endif
+struct elf_resolve;
extern void _dl_run_init_array(struct elf_resolve *);
extern void _dl_run_fini_array(struct elf_resolve *);
-#endif
#ifdef __UCLIBC_HAS_TLS__
/* Determine next available module ID. */
diff --git a/ldso/ldso/dl-array.c b/ldso/ldso/dl-array.c
index 8e2ea00..cc5e197 100644
--- a/ldso/ldso/dl-array.c
+++ b/ldso/ldso/dl-array.c
@@ -47,7 +47,6 @@ static void _dl_run_array_forward(unsigned long array, unsigned long size,
}
}
-void _dl_run_init_array(struct elf_resolve *tpnt);
void _dl_run_init_array(struct elf_resolve *tpnt)
{
_dl_run_array_forward(tpnt->dynamic_info[DT_INIT_ARRAY],
@@ -55,15 +54,6 @@ void _dl_run_init_array(struct elf_resolve *tpnt)
tpnt->loadaddr);
}
-#if defined IS_IN_rtld && defined __UCLIBC_CTOR_DTOR__
-void _dl_app_init_array(void);
-void _dl_app_init_array(void)
-{
- _dl_run_init_array(_dl_loaded_modules);
-}
-#endif
-
-void _dl_run_fini_array(struct elf_resolve *tpnt);
void _dl_run_fini_array(struct elf_resolve *tpnt)
{
if (tpnt->dynamic_info[DT_FINI_ARRAY]) {
@@ -78,7 +68,11 @@ void _dl_run_fini_array(struct elf_resolve *tpnt)
}
#if defined IS_IN_rtld && defined __UCLIBC_CTOR_DTOR__
-void _dl_app_fini_array(void);
+void _dl_app_init_array(void)
+{
+ _dl_run_init_array(_dl_loaded_modules);
+}
+
void _dl_app_fini_array(void)
{
_dl_run_fini_array(_dl_loaded_modules);
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 68b020f..7462241 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -128,10 +128,7 @@ extern void __pthread_initialize_minimal(void);
/* If __UCLIBC_FORMAT_SHARED_FLAT__, all array initialisation and finalisation
* is handled by the routines passed to __uClibc_main(). */
#if defined (__UCLIBC_CTOR_DTOR__) && !defined (__UCLIBC_FORMAT_SHARED_FLAT__)
-# ifdef SHARED
-extern void _dl_app_init_array(void);
-extern void _dl_app_fini_array(void);
-# else
+# ifndef SHARED
/* These magic symbols are provided by the linker. */
extern void (*__preinit_array_start []) (void) attribute_hidden;
extern void (*__preinit_array_end []) (void) attribute_hidden;
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] arm/dl-startup.h: guard a bx instruction
with __USE_BX__
Message-ID: <20110411142453.80DC48254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=fc103eef1a09e54b6fc4ec9c09078c4e7fde8d66
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/ldso/arm/dl-startup.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/ldso/ldso/arm/dl-startup.h b/ldso/ldso/arm/dl-startup.h
index f170dbd..f89f70c 100644
--- a/ldso/ldso/arm/dl-startup.h
+++ b/ldso/ldso/arm/dl-startup.h
@@ -73,7 +73,11 @@ __asm__(
" @ odd, so use an arm function and change to thumb (_dl_start\n"
" @ is thumb)\n"
" adr r0, __dl_thumb_start+1\n"
+#if defined(__USE_BX__)
" bx r0\n"
+#else
+ " mov pc, r0\n"
+#endif
"\n\n"
" .thumb\n"
" .globl __dl_thumb_start\n"
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] ldso: make a bunch of functions static
Message-ID: <20110411142453.E192C8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=44627e878e11cda2b766293c322e5a95b5722b4f
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
They all go into the same file, no need to handle them as hidden
Signed-off-by: Peter S. Mazinger
---
ldso/include/dl-elf.h | 6 ------
ldso/include/dl-hash.h | 4 ----
ldso/ldso/dl-elf.c | 5 ++++-
ldso/ldso/dl-hash.c | 2 +-
ldso/ldso/elfinterp_common.c | 10 ++++------
ldso/ldso/ldso.c | 17 ++++++++++-------
ldso/ldso/mips/elfinterp.c | 10 ++++------
ldso/ldso/powerpc/elfinterp.c | 5 ++---
8 files changed, 25 insertions(+), 34 deletions(-)
diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h
index addf23a..0103d3d 100644
--- a/ldso/include/dl-elf.h
+++ b/ldso/include/dl-elf.h
@@ -28,15 +28,9 @@ static __inline__ void _dl_unmap_cache(void) { }
#endif
/* Function prototypes for non-static stuff in dl-elf.c and elfinterp.c */
-extern void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
- ElfW(Addr) rel_addr, ElfW(Word) rel_size);
-extern int _dl_parse_relocation_information(struct dyn_elf *rpnt,
- ElfW(Addr) rel_addr, ElfW(Word) rel_size);
extern struct elf_resolve * _dl_load_shared_library(int secure,
struct dyn_elf **rpnt, struct elf_resolve *tpnt, char *full_libname,
int trace_loaded_objects);
-extern struct elf_resolve * _dl_load_elf_shared_library(int secure,
- struct dyn_elf **rpnt, char *libname) attribute_hidden;
extern int _dl_fixup(struct dyn_elf *rpnt, int flag);
extern void _dl_protect_relro (struct elf_resolve *l) internal_function;
diff --git a/ldso/include/dl-hash.h b/ldso/include/dl-hash.h
index b3f811b..3e25692 100644
--- a/ldso/include/dl-hash.h
+++ b/ldso/include/dl-hash.h
@@ -151,10 +151,6 @@ struct elf_resolve {
extern struct dyn_elf * _dl_symbol_tables;
extern struct elf_resolve * _dl_loaded_modules;
-extern struct elf_resolve * _dl_add_elf_hash_table(const char * libname,
- DL_LOADADDR_TYPE loadaddr, ElfW(Word) * dynamic_info,
- ElfW(Addr) dynamic_addr, unsigned long dynamic_size);
-
extern char *_dl_find_hash(const char *name, struct dyn_elf *rpnt,
struct elf_resolve *mytpnt, int type_class,
struct symbol_ref *symbol);
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 0d3640d..8832c1a 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -31,6 +31,9 @@
#include
+static struct elf_resolve * _dl_load_elf_shared_library(int secure,
+ struct dyn_elf **rpnt, char *libname);
+
#ifdef __LDSO_CACHE_SUPPORT__
static caddr_t _dl_cache_addr = NULL;
@@ -320,7 +323,7 @@ goof:
* are required.
*/
-struct elf_resolve *_dl_load_elf_shared_library(int secure,
+static struct elf_resolve *_dl_load_elf_shared_library(int secure,
struct dyn_elf **rpnt, char *libname)
{
ElfW(Ehdr) *epnt;
diff --git a/ldso/ldso/dl-hash.c b/ldso/ldso/dl-hash.c
index fa6b316..1232c0d 100644
--- a/ldso/ldso/dl-hash.c
+++ b/ldso/ldso/dl-hash.c
@@ -82,7 +82,7 @@ static __inline__ Elf_Symndx _dl_elf_hash(const unsigned char *name)
* We add the relevant info to the symbol chain, so that we can resolve all
* externals properly.
*/
-struct elf_resolve *_dl_add_elf_hash_table(const char *libname,
+static struct elf_resolve *_dl_add_elf_hash_table(const char *libname,
DL_LOADADDR_TYPE loadaddr, ElfW(Word) *dynamic_info, ElfW(Addr) dynamic_addr,
attribute_unused unsigned long dynamic_size)
{
diff --git a/ldso/ldso/elfinterp_common.c b/ldso/ldso/elfinterp_common.c
index c89ffda..a9f4092 100644
--- a/ldso/ldso/elfinterp_common.c
+++ b/ldso/ldso/elfinterp_common.c
@@ -186,9 +186,8 @@ static int _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
return 0;
}
-int _dl_parse_relocation_information(struct dyn_elf *rpnt,
- ElfW(Addr) rel_addr,
- ElfW(Word) rel_size)
+static int _dl_parse_relocation_information(struct dyn_elf *rpnt,
+ ElfW(Addr) rel_addr, ElfW(Word) rel_size)
{
return _dl_parse(rpnt->dyn, rpnt->dyn->symbol_scope, rel_addr, rel_size, _dl_do_reloc);
}
@@ -245,9 +244,8 @@ static __always_inline int _dl_do_lazy_reloc(struct elf_resolve *tpnt, struct dy
#endif
#ifndef ARCH_HAS_LAZY
-void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
- ElfW(Addr) rel_addr,
- ElfW(Word) rel_size)
+static void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
+ ElfW(Addr) rel_addr, ElfW(Word) rel_size)
{
# if defined ELF_MACHINE_NONE && defined ELF_MACHINE_JMP_SLOT
(void)_dl_parse(rpnt->dyn, NULL, rel_addr, rel_size, _dl_do_lazy_reloc);
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index f2ea13b..b7c2a8a 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -64,9 +64,9 @@ void (*_dl_free_function) (void *p) = NULL;
static int _dl_secure = 1; /* Are we dealing with setuid stuff? */
-void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
- ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp, char **argv
- DL_GET_READY_TO_RUN_EXTRA_PARMS) attribute_hidden;
+static __always_inline void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
+ ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp, char **argv
+ DL_GET_READY_TO_RUN_EXTRA_PARMS);
#include "dl-startup.c"
#include "dl-symbols.c"
@@ -267,10 +267,13 @@ static void __attribute__ ((destructor)) __attribute_used__ _dl_fini(void)
}
}
-void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
- ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp,
- char **argv
- DL_GET_READY_TO_RUN_EXTRA_PARMS)
+static struct elf_resolve * _dl_add_elf_hash_table(const char * libname,
+ DL_LOADADDR_TYPE loadaddr, ElfW(Word) * dynamic_info,
+ ElfW(Addr) dynamic_addr, unsigned long dynamic_size);
+
+static __always_inline void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
+ ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp,
+ char **argv DL_GET_READY_TO_RUN_EXTRA_PARMS)
{
ElfW(Addr) app_mapaddr = 0;
ElfW(Phdr) *ppnt;
diff --git a/ldso/ldso/mips/elfinterp.c b/ldso/ldso/mips/elfinterp.c
index 10e752d..fd41c44 100644
--- a/ldso/ldso/mips/elfinterp.c
+++ b/ldso/ldso/mips/elfinterp.c
@@ -81,17 +81,15 @@ unsigned long __dl_runtime_resolve(unsigned long sym_index,
return new_addr;
}
-void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
- ElfW(Addr) rel_addr,
- ElfW(Word) rel_size)
+static void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
+ ElfW(Addr) rel_addr, ElfW(Word) rel_size)
{
/* Nothing to do */
return;
}
-int _dl_parse_relocation_information(struct dyn_elf *xpnt,
- ElfW(Addr) rel_addr,
- ElfW(Word) rel_size)
+static int _dl_parse_relocation_information(struct dyn_elf *xpnt,
+ ElfW(Addr) rel_addr, ElfW(Word) rel_size)
{
ElfW(Addr) *reloc_addr = NULL;
struct elf_resolve *tpnt = xpnt->dyn;
diff --git a/ldso/ldso/powerpc/elfinterp.c b/ldso/ldso/powerpc/elfinterp.c
index 21b5869..b96ce36 100644
--- a/ldso/ldso/powerpc/elfinterp.c
+++ b/ldso/ldso/powerpc/elfinterp.c
@@ -358,9 +358,8 @@ _dl_do_reloc(struct elf_resolve *tpnt,struct dyn_elf *scope,
return 0;
}
-void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
- ElfW(Addr) rel_addr,
- ElfW(Word) rel_size)
+static void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
+ ElfW(Addr) rel_addr, ElfW(Word) rel_size)
{
struct elf_resolve *tpnt = rpnt->dyn;
ElfW(Word) *plt, offset, i, num_plt_entries, rel_offset_words;
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-hash.c: disable the use of weak_result
Message-ID: <20110411142454.2E7CB8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=4314dc306516c0671732555a895b8d894d1267c5
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Leave the code in for the case, that someone wants to enable support
for old style weak symbols like glibc, when LD_DYNAMIC_WEAK is exported.
Signed-off-by: Peter S. Mazinger
---
ldso/ldso/dl-hash.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/ldso/ldso/dl-hash.c b/ldso/ldso/dl-hash.c
index 1232c0d..a86bd63 100644
--- a/ldso/ldso/dl-hash.c
+++ b/ldso/ldso/dl-hash.c
@@ -272,7 +272,9 @@ char *_dl_find_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve *
unsigned long elf_hash_number = 0xffffffff;
const ElfW(Sym) *sym = NULL;
+#if 0
char *weak_result = NULL;
+#endif
#ifdef __LDSO_GNU_HASH_SUPPORT__
unsigned long gnu_hash_number = _dl_gnu_hash((const unsigned char *)name);
@@ -366,5 +368,9 @@ char *_dl_find_hash(const char *name, struct dyn_elf *rpnt, struct elf_resolve *
if (sym_ref)
sym_ref->tpnt = tpnt;
#endif
+#if 0
return weak_result;
+#else
+ return NULL;
+#endif
}
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] ldso: make _dl_strdup static
Message-ID: <20110411142455.085B38254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=e820363b0f4cf837e79f2ad7587fe295f1eb2052
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/include/ldso.h | 1 -
ldso/ldso/dl-elf.c | 2 +-
ldso/ldso/ldso.c | 2 ++
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h
index e84e64d..61e8846 100644
--- a/ldso/include/ldso.h
+++ b/ldso/include/ldso.h
@@ -108,7 +108,6 @@ extern void *_dl_malloc(size_t size);
extern void *_dl_calloc(size_t __nmemb, size_t __size);
extern void *_dl_realloc(void *__ptr, size_t __size);
extern void _dl_free(void *);
-extern char *_dl_strdup(const char *string) attribute_hidden;
extern void _dl_dprintf(int, const char *__restrict, ...) attribute_hidden;
#else
# include
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 8832c1a..39c5044 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -1032,7 +1032,7 @@ void _dl_dprintf(int fd, const char *__restrict fmt, ...)
return;
}
-char *_dl_strdup(const char *string)
+static char *_dl_strdup(const char *string)
{
char *retval;
int len;
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index b7c2a8a..eb439ef 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -108,6 +108,8 @@ uintptr_t __guard attribute_relro;
# endif
#endif
+static __attribute_noinline__ char *_dl_strdup(const char *);
+
static char *_dl_getenv(const char *symbol, char **envp)
{
char *pnt;
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-syscall.h: _dl_getpid is needed only if
SUPPORT_LD_DEBUG is defined
Message-ID: <20110411142454.9CE238254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=893a79d30f6ee7f1c954c32e1c8af181f666f7f1
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/include/dl-syscall.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h
index 1bef111..3888be0 100644
--- a/ldso/include/dl-syscall.h
+++ b/ldso/include/dl-syscall.h
@@ -89,7 +89,9 @@ static __always_inline _syscall2(int, _dl_munmap, void *, start, unsigned long,
#include "../../libc/sysdeps/linux/common/geteuid.c"
#include "../../libc/sysdeps/linux/common/getgid.c"
#include "../../libc/sysdeps/linux/common/getegid.c"
+#ifdef __SUPPORT_LD_DEBUG__
#include "../../libc/sysdeps/linux/common/getpid.c"
+#endif
#define __NR__dl_readlink __NR_readlink
static __always_inline _syscall3(int, _dl_readlink, const char *, path, char *, buf,
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-syscall.h: remove unused _dl_readlink
Message-ID: <20110411142454.CC8358254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=ff4036f9b34be03b3ebda1a14d2b1eea7a6cabdd
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/include/dl-syscall.h | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h
index 3888be0..91c723d 100644
--- a/ldso/include/dl-syscall.h
+++ b/ldso/include/dl-syscall.h
@@ -93,10 +93,6 @@ static __always_inline _syscall2(int, _dl_munmap, void *, start, unsigned long,
#include "../../libc/sysdeps/linux/common/getpid.c"
#endif
-#define __NR__dl_readlink __NR_readlink
-static __always_inline _syscall3(int, _dl_readlink, const char *, path, char *, buf,
- size_t, bufsiz)
-
#ifdef __UCLIBC_HAS_SSP__
# include
# define __NR__dl_gettimeofday __NR_gettimeofday
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] ldso.c: mark _dl_getenv noinline, size shrink
Message-ID: <20110411142455.372C78254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=0a0361104efeca0332b1da8d5ac5678fa0dbc0ab
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/ldso/ldso.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index eb439ef..83902ff 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -110,7 +110,7 @@ uintptr_t __guard attribute_relro;
static __attribute_noinline__ char *_dl_strdup(const char *);
-static char *_dl_getenv(const char *symbol, char **envp)
+static __attribute_noinline__ char *_dl_getenv(const char *symbol, char **envp)
{
char *pnt;
const char *pnt1;
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] ldso.c: move _dl_strdup and _dl_dprintf from
dl-elf.c
Message-ID: <20110411142455.97AB98254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=abd8ac564fb6ab661c91232388b54c2e518bd12d
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/ldso/dl-elf.c | 105 ----------------------------------------------------
ldso/ldso/ldso.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 102 insertions(+), 108 deletions(-)
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 97fa9a3..8c0a954 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -939,111 +939,6 @@ int _dl_fixup(struct dyn_elf *rpnt, int now_flag)
return goof;
}
-#ifdef IS_IN_rtld
-/* Minimal printf which handles only %s, %d, and %x */
-static void _dl_dprintf(int fd, const char *__restrict fmt, ...)
-{
-#if __WORDSIZE > 32
- long int num;
-#else
- int num;
-#endif
- va_list args;
- char *start, *ptr, *string;
- char *buf;
-
- if (!fmt)
- return;
-
- buf = _dl_mmap((void *) 0, _dl_pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- if (_dl_mmap_check_error(buf)) {
- _dl_write(fd, "mmap of a spare page failed!\n", 29);
- _dl_exit(20);
- }
-
- start = ptr = buf;
-
- if (_dl_strlen(fmt) >= (_dl_pagesize - 1)) {
- _dl_write(fd, "overflow\n", 11);
- _dl_exit(20);
- }
-
- _dl_strcpy(buf, fmt);
- va_start(args, fmt);
-
- while (start) {
- while (*ptr != '%' && *ptr) {
- ptr++;
- }
-
- if (*ptr == '%') {
- *ptr++ = '\0';
- _dl_write(fd, start, _dl_strlen(start));
-
- switch (*ptr++) {
- case 's':
- string = va_arg(args, char *);
-
- if (!string)
- _dl_write(fd, "(null)", 6);
- else
- _dl_write(fd, string, _dl_strlen(string));
- break;
-
- case 'i':
- case 'd':
- {
- char tmp[22];
-#if __WORDSIZE > 32
- num = va_arg(args, long int);
-#else
- num = va_arg(args, int);
-#endif
- string = _dl_simple_ltoa(tmp, num);
- _dl_write(fd, string, _dl_strlen(string));
- break;
- }
- case 'x':
- case 'p':
- {
- char tmp[22];
-#if __WORDSIZE > 32
- num = va_arg(args, long int);
-#else
- num = va_arg(args, int);
-#endif
- string = _dl_simple_ltoahex(tmp, num);
- _dl_write(fd, string, _dl_strlen(string));
- break;
- }
- default:
- _dl_write(fd, "(bad format)", 12);
- break;
- }
-
- start = ptr;
- } else {
- _dl_write(fd, start, _dl_strlen(start));
- start = NULL;
- }
- }
- _dl_munmap(buf, _dl_pagesize);
- return;
-}
-
-static char *_dl_strdup(const char *string)
-{
- char *retval;
- int len;
-
- len = _dl_strlen(string);
- retval = _dl_malloc(len + 1);
- _dl_strcpy(retval, string);
- return retval;
-}
-#endif
-
unsigned int _dl_parse_dynamic_info(ElfW(Dyn) *dpnt, ElfW(Word) dynamic_info[],
void *debug_addr, DL_LOADADDR_TYPE load_off)
{
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index dbade03..823e529 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -34,7 +34,108 @@
#include
-static void _dl_dprintf(int, const char *__restrict, ...);
+/* Minimal printf which handles only %s, %d, %x and %p */
+static void _dl_dprintf(int fd, const char *__restrict fmt, ...)
+{
+#if __WORDSIZE > 32
+ long int num;
+#else
+ int num;
+#endif
+ va_list args;
+ char *start, *ptr, *string;
+ char *buf;
+
+ if (!fmt)
+ return;
+
+ buf = _dl_mmap((void *) 0, _dl_pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (_dl_mmap_check_error(buf)) {
+ _dl_write(fd, "mmap of a spare page failed!\n", 29);
+ _dl_exit(20);
+ }
+
+ start = ptr = buf;
+
+ if (_dl_strlen(fmt) >= (_dl_pagesize - 1)) {
+ _dl_write(fd, "overflow\n", 11);
+ _dl_exit(20);
+ }
+
+ _dl_strcpy(buf, fmt);
+ va_start(args, fmt);
+
+ while (start) {
+ while (*ptr != '%' && *ptr) {
+ ptr++;
+ }
+
+ if (*ptr == '%') {
+ *ptr++ = '\0';
+ _dl_write(fd, start, _dl_strlen(start));
+
+ switch (*ptr++) {
+ case 's':
+ string = va_arg(args, char *);
+
+ if (!string)
+ _dl_write(fd, "(null)", 6);
+ else
+ _dl_write(fd, string, _dl_strlen(string));
+ break;
+
+ case 'i':
+ case 'd':
+ {
+ char tmp[22];
+#if __WORDSIZE > 32
+ num = va_arg(args, long int);
+#else
+ num = va_arg(args, int);
+#endif
+ string = _dl_simple_ltoa(tmp, num);
+ _dl_write(fd, string, _dl_strlen(string));
+ break;
+ }
+ case 'x':
+ case 'p':
+ {
+ char tmp[22];
+#if __WORDSIZE > 32
+ num = va_arg(args, long int);
+#else
+ num = va_arg(args, int);
+#endif
+ string = _dl_simple_ltoahex(tmp, num);
+ _dl_write(fd, string, _dl_strlen(string));
+ break;
+ }
+ default:
+ _dl_write(fd, "(bad format)", 12);
+ break;
+ }
+
+ start = ptr;
+ } else {
+ _dl_write(fd, start, _dl_strlen(start));
+ start = NULL;
+ }
+ }
+ _dl_munmap(buf, _dl_pagesize);
+ return;
+}
+
+static __attribute_noinline__ char *_dl_strdup(const char *string)
+{
+ char *retval;
+ int len;
+
+ len = _dl_strlen(string);
+ retval = _dl_malloc(len + 1);
+ _dl_strcpy(retval, string);
+ return retval;
+}
/* Pull in common debug code */
#include "dl-debug.c"
@@ -110,8 +211,6 @@ uintptr_t __guard attribute_relro;
# endif
#endif
-static __attribute_noinline__ char *_dl_strdup(const char *);
-
static __attribute_noinline__ char *_dl_getenv(const char *symbol, char **envp)
{
char *pnt;
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] i386/dl-sysdep.h: remove unneeded prototypes
Message-ID: <20110411142455.CBA388254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=67a803cddd0f1c6b4f05a9dc2b61102517978608
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/ldso/i386/dl-sysdep.h | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/ldso/ldso/i386/dl-sysdep.h b/ldso/ldso/i386/dl-sysdep.h
index b91bd61..a38760c 100644
--- a/ldso/ldso/i386/dl-sysdep.h
+++ b/ldso/ldso/i386/dl-sysdep.h
@@ -41,8 +41,7 @@ do { \
/* Return the link-time address of _DYNAMIC. Conveniently, this is the
first element of the GOT. This must be inlined in a function which
uses global data. */
-static __always_inline Elf32_Addr elf_machine_dynamic (void) attribute_unused;
-static __always_inline Elf32_Addr
+static __always_inline Elf32_Addr attribute_unused
elf_machine_dynamic (void)
{
register Elf32_Addr *got __asm__ ("%ebx");
@@ -51,8 +50,7 @@ elf_machine_dynamic (void)
/* Return the run-time load address of the shared object. */
-static __always_inline Elf32_Addr elf_machine_load_address (void) attribute_unused;
-static __always_inline Elf32_Addr
+static __always_inline Elf32_Addr attribute_unused
elf_machine_load_address (void)
{
/* It doesn't matter what variable this is, the reference never makes
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] libdl.c: do not read LD_LIBRARY_PATH
unconditionally
Message-ID: <20110411142456.023958254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=0ededcae1c3c793e07e5aa61160963cac37cdd55
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/libdl/libdl.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index 4a74f07..6a58ce8 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -36,6 +36,7 @@
#include
#ifndef SHARED
+#include
/* When libdl is linked as a static library, we need to replace all
* the symbols that otherwise would have been loaded in from ldso... */
@@ -273,6 +274,18 @@ void *dlopen(const char *libname, int flag)
_dl_map_cache();
+#ifndef SHARED
+ /* When statically linked, the _dl_library_path is not yet initialized */
+ {
+ static smallint _dl_library_path_set = 0;
+ if (!_dl_library_path_set) {
+ _dl_library_path_set = 1;
+ if (getuid() == geteuid() && getgid() == getegid())
+ _dl_library_path = getenv("LD_LIBRARY_PATH");
+ }
+ }
+#endif
+
/*
* Try and locate the module we were called from - we
* need this so that we get the correct RPATH/RUNPATH. Note that
@@ -298,11 +311,6 @@ void *dlopen(const char *libname, int flag)
if (getenv("LD_BIND_NOW"))
now_flag = RTLD_NOW;
-#ifndef SHARED
- /* When statically linked, the _dl_library_path is not yet initialized */
- _dl_library_path = getenv("LD_LIBRARY_PATH");
-#endif
-
/* Try to load the specified library */
_dl_if_debug_print("Trying to dlopen '%s', RTLD_GLOBAL:%d RTLD_NOW:%d\n",
(char*)libname, (flag & RTLD_GLOBAL ? 1:0), (now_flag & RTLD_NOW ? 1:0));
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] i386/dl-sysdep.h: add newer code from glibc,
requires hidden support
Message-ID: <20110411142456.6103F8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=7de778389d0040be4a21ffc326310e0eb361570a
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/ldso/i386/dl-sysdep.h | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/ldso/ldso/i386/dl-sysdep.h b/ldso/ldso/i386/dl-sysdep.h
index a38760c..f52d813 100644
--- a/ldso/ldso/i386/dl-sysdep.h
+++ b/ldso/ldso/i386/dl-sysdep.h
@@ -38,6 +38,31 @@ do { \
|| (type) == R_386_TLS_TPOFF) * ELF_RTYPE_CLASS_PLT) \
| (((type) == R_386_COPY) * ELF_RTYPE_CLASS_COPY))
+#if 1 /* this code needs .hidden support */
+/* Return the link-time address of _DYNAMIC. Conveniently, this is the
+ first element of the GOT, a special entry that is never relocated. */
+extern const Elf32_Addr _GLOBAL_OFFSET_TABLE_[] attribute_hidden;
+static __always_inline Elf32_Addr __attribute__ ((unused, const))
+elf_machine_dynamic (void)
+{
+ /* This produces a GOTOFF reloc that resolves to zero at link time, so in
+ fact just loads from the GOT register directly. By doing it without
+ an asm we can let the compiler choose any register. */
+ return _GLOBAL_OFFSET_TABLE_[0];
+}
+
+
+extern Elf32_Dyn bygotoff[] __asm__ ("_DYNAMIC") attribute_hidden;
+/* Return the run-time load address of the shared object. */
+static __always_inline Elf32_Addr attribute_unused
+elf_machine_load_address (void)
+{
+ /* Compute the difference between the runtime address of _DYNAMIC as seen
+ by a GOTOFF reference, and the link-time address found in the special
+ unrelocated first GOT entry. */
+ return (Elf32_Addr) &bygotoff - elf_machine_dynamic ();
+}
+#else
/* Return the link-time address of _DYNAMIC. Conveniently, this is the
first element of the GOT. This must be inlined in a function which
uses global data. */
@@ -63,6 +88,7 @@ elf_machine_load_address (void)
: "=r" (addr) : "m" (tmp) : "cc");
return addr;
}
+#endif
static __always_inline void
elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] no need to SSP compile libresolv/libnsl
dummies
Message-ID: <20110411142456.2D6038254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=55061e87b7e016a0d00da11bf655021eba4e4377
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Fails to compile if binutils is patched to default to as_needed,
since libc.so will be eliminated and __stack_chk_guard() will be missing.
Signed-off-by: Peter S. Mazinger
---
libnsl/Makefile.in | 2 +-
libresolv/Makefile.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libnsl/Makefile.in b/libnsl/Makefile.in
index 333c490..760be96 100644
--- a/libnsl/Makefile.in
+++ b/libnsl/Makefile.in
@@ -7,7 +7,7 @@
subdirs += libnsl
-CFLAGS-libnsl := -DNOT_IN_libc -DIS_IN_libnsl $(SSP_ALL_CFLAGS)
+CFLAGS-libnsl := -DNOT_IN_libc -DIS_IN_libnsl #$(SSP_ALL_CFLAGS)
LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libnsl.so := -Wl,--dsbt-index=6
LDFLAGS-libnsl.so := $(LDFLAGS) $(call link.asneeded,-lc)
diff --git a/libresolv/Makefile.in b/libresolv/Makefile.in
index fa3c341..c0f1a6d 100644
--- a/libresolv/Makefile.in
+++ b/libresolv/Makefile.in
@@ -7,7 +7,7 @@
subdirs += libresolv
-CFLAGS-libresolv := -DNOT_IN_libc -DIS_IN_libresolv $(SSP_ALL_CFLAGS)
+CFLAGS-libresolv := -DNOT_IN_libc -DIS_IN_libresolv #$(SSP_ALL_CFLAGS)
LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libresolv.so := -Wl,--dsbt-index=7
LDFLAGS-libresolv.so := $(LDFLAGS) $(call link.asneeded,-lc)
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] ldso/libdl: include ldso.h only in ldso.c
and libdl.c
Message-ID: <20110411142456.C8D7A8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=4e6699981c75b58297216cbfad65843f1f0daa3f
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Replace ldso.h everywhere else with ldsodefs.h
Signed-off-by: Peter S. Mazinger
---
ldso/include/ldso.h | 9 +--------
ldso/include/ldsodefs.h | 1 +
ldso/ldso/arm/elfinterp.c | 2 +-
ldso/ldso/cris/elfinterp.c | 2 +-
ldso/ldso/dl-debug.c | 3 ++-
ldso/ldso/dl-elf.c | 2 +-
ldso/ldso/dl-hash.c | 2 +-
ldso/ldso/dl-startup.c | 2 +-
ldso/ldso/dl-tls.c | 2 +-
ldso/ldso/elfinterp_common.c | 2 +-
ldso/ldso/i386/elfinterp.c | 2 +-
ldso/ldso/ldso.c | 1 +
ldso/ldso/m68k/elfinterp.c | 2 +-
ldso/ldso/mips/elfinterp.c | 2 +-
ldso/ldso/powerpc/elfinterp.c | 2 +-
ldso/ldso/sh/elfinterp.c | 2 +-
ldso/ldso/sh64/elfinterp.c | 2 +-
ldso/ldso/x86_64/elfinterp.c | 2 +-
ldso/ldso/xtensa/elfinterp.c | 2 +-
ldso/libdl/libdl.c | 4 ++--
20 files changed, 22 insertions(+), 26 deletions(-)
diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h
index 201db68..077ca2d 100644
--- a/ldso/include/ldso.h
+++ b/ldso/include/ldso.h
@@ -21,18 +21,16 @@
/* Pull in the arch specific page size */
#include
-#include
-
#ifndef __ARCH_HAS_NO_SHARED__
#include
+#include
#include
#include
#include
#include
#ifdef __UCLIBC_HAS_TLS__
# include
-# include
#endif
/* common align masks, if not specified by dl-sysdep.h */
@@ -59,7 +57,6 @@ extern void ** __attribute__ ((const)) _dl_initial_error_catch_tsd (void);
#endif
#ifdef __SUPPORT_LD_DEBUG__
-extern char *_dl_debug;
# define __dl_debug_dprint(fmt, args...) \
_dl_dprintf(_dl_debug_file, "%s:%i: " fmt, __FUNCTION__, __LINE__, ## args);
# define _dl_if_debug_dprint(fmt, args...) \
@@ -98,10 +95,6 @@ extern char *_dl_debug;
# define _dl_debug_early(fmt, args...) do {} while (0)
#endif /* __SUPPORT_LD_DEBUG_EARLY__ */
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
#ifdef IS_IN_rtld
extern void *_dl_malloc(size_t size);
extern void *_dl_calloc(size_t __nmemb, size_t __size);
diff --git a/ldso/include/ldsodefs.h b/ldso/include/ldsodefs.h
index 6454dd4..e2b517c 100644
--- a/ldso/include/ldsodefs.h
+++ b/ldso/include/ldsodefs.h
@@ -186,6 +186,7 @@ extern void *__libc_stack_end attribute_relro;
#ifdef SHARED
extern unsigned long _dl_error_number;
+extern char *_dl_debug;
extern struct r_debug *_dl_debug_addr;
extern void *(*_dl_malloc_function)(size_t);
extern void (*_dl_free_function) (void *p);
diff --git a/ldso/ldso/arm/elfinterp.c b/ldso/ldso/arm/elfinterp.c
index 630ecbe..9d04798 100644
--- a/ldso/ldso/arm/elfinterp.c
+++ b/ldso/ldso/arm/elfinterp.c
@@ -38,7 +38,7 @@
a more than adequate job of explaining everything required to get this
working. */
-#include
+#include
#if 0
static unsigned long
diff --git a/ldso/ldso/cris/elfinterp.c b/ldso/ldso/cris/elfinterp.c
index a616273..3b87cb2 100644
--- a/ldso/ldso/cris/elfinterp.c
+++ b/ldso/ldso/cris/elfinterp.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*/
-#include
+#include
static int
_dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
diff --git a/ldso/ldso/dl-debug.c b/ldso/ldso/dl-debug.c
index 19f3eef..95ab90e 100644
--- a/ldso/ldso/dl-debug.c
+++ b/ldso/ldso/dl-debug.c
@@ -37,10 +37,11 @@
* SUCH DAMAGE.
*/
-#include
+#include
#ifdef __SUPPORT_LD_DEBUG__
+#include
/* include the arch-specific _dl_reltypes_tab */
#include
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 8c0a954..c48632d 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/
-#include
+#include
static struct elf_resolve * _dl_load_elf_shared_library(int secure,
struct dyn_elf **rpnt, char *libname);
diff --git a/ldso/ldso/dl-hash.c b/ldso/ldso/dl-hash.c
index a86bd63..8a31eb8 100644
--- a/ldso/ldso/dl-hash.c
+++ b/ldso/ldso/dl-hash.c
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*/
-#include
+#include
/* Various symbol table handling functions, including symbol lookup */
/*
diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c
index 17629b5..d012716 100644
--- a/ldso/ldso/dl-startup.c
+++ b/ldso/ldso/dl-startup.c
@@ -89,7 +89,7 @@
* the user's application.
*/
-#include
+#include
/* Needed for standalone execution */
static __attribute_used__ unsigned long _dl_skip_args = 0;
diff --git a/ldso/ldso/dl-tls.c b/ldso/ldso/dl-tls.c
index b4a466d..2917702 100644
--- a/ldso/ldso/dl-tls.c
+++ b/ldso/ldso/dl-tls.c
@@ -28,7 +28,7 @@
#include
#include
-#include
+#include
void *(*_dl_calloc_function) (size_t __nmemb, size_t __size) = NULL;
void *(*_dl_realloc_function) (void *__ptr, size_t __size) = NULL;
diff --git a/ldso/ldso/elfinterp_common.c b/ldso/ldso/elfinterp_common.c
index a9f4092..5720a90 100644
--- a/ldso/ldso/elfinterp_common.c
+++ b/ldso/ldso/elfinterp_common.c
@@ -1,7 +1,7 @@
/* vi: set sw=4 ts=4: */
/* Licensed under the LGPL v2.1, see the file LICENSE in this tarball. */
-#include
+#include
/*
* dynamic_info is of type ElfW(Word)
diff --git a/ldso/ldso/i386/elfinterp.c b/ldso/ldso/i386/elfinterp.c
index b1667f1..1e73707 100644
--- a/ldso/ldso/i386/elfinterp.c
+++ b/ldso/ldso/i386/elfinterp.c
@@ -40,7 +40,7 @@
a more than adequate job of explaining everything required to get this
working. */
-#include
+#include
static int
_dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 823e529..6a6e78a 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -30,6 +30,7 @@
* SUCH DAMAGE.
*/
+#include
#include
#include
diff --git a/ldso/ldso/m68k/elfinterp.c b/ldso/ldso/m68k/elfinterp.c
index 3295fd0..42b04ff 100644
--- a/ldso/ldso/m68k/elfinterp.c
+++ b/ldso/ldso/m68k/elfinterp.c
@@ -40,7 +40,7 @@
a more than adequate job of explaining everything required to get this
working. */
-#include
+#include
static int _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
ELF_RELOC *rpnt, const ElfW(Sym) *const symtab, const char *strtab)
diff --git a/ldso/ldso/mips/elfinterp.c b/ldso/ldso/mips/elfinterp.c
index fd41c44..3459703 100644
--- a/ldso/ldso/mips/elfinterp.c
+++ b/ldso/ldso/mips/elfinterp.c
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
-#include
+#include
#define OFFSET_GP_GOT 0x7ff0
diff --git a/ldso/ldso/powerpc/elfinterp.c b/ldso/ldso/powerpc/elfinterp.c
index b96ce36..05258b3 100644
--- a/ldso/ldso/powerpc/elfinterp.c
+++ b/ldso/ldso/powerpc/elfinterp.c
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*/
-#include
+#include
#define TLS_DTV_OFFSET 0x8000
#define TLS_TP_OFFSET 0x7000
diff --git a/ldso/ldso/sh/elfinterp.c b/ldso/ldso/sh/elfinterp.c
index 0c57bde..d7ee12b 100644
--- a/ldso/ldso/sh/elfinterp.c
+++ b/ldso/ldso/sh/elfinterp.c
@@ -39,7 +39,7 @@
a more than adequate job of explaining everything required to get this
working. */
-#include
+#include
static int
_dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
diff --git a/ldso/ldso/sh64/elfinterp.c b/ldso/ldso/sh64/elfinterp.c
index fe7b3c4..d3c475c 100644
--- a/ldso/ldso/sh64/elfinterp.c
+++ b/ldso/ldso/sh64/elfinterp.c
@@ -41,7 +41,7 @@
a more than adequate job of explaining everything required to get this
working. */
-#include
+#include
static int _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
ELF_RELOC *rpnt, const ElfW(Sym) *const symtab, const char *strtab)
diff --git a/ldso/ldso/x86_64/elfinterp.c b/ldso/ldso/x86_64/elfinterp.c
index 13357bb..c95c6f6 100644
--- a/ldso/ldso/x86_64/elfinterp.c
+++ b/ldso/ldso/x86_64/elfinterp.c
@@ -40,7 +40,7 @@
a more than adequate job of explaining everything required to get this
working. */
-#include
+#include
static int
_dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
diff --git a/ldso/ldso/xtensa/elfinterp.c b/ldso/ldso/xtensa/elfinterp.c
index 27b259c..d3183ee 100644
--- a/ldso/ldso/xtensa/elfinterp.c
+++ b/ldso/ldso/xtensa/elfinterp.c
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*/
-#include
+#include
static int
_dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index 6a58ce8..d7a969a 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -29,11 +29,11 @@
* SUCH DAMAGE.
*/
-
-#include
#include
#include
#include
+#include
+#include
#ifndef SHARED
#include
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-debug.h: guard TLS relocations
Message-ID: <20110411142453.AC98B8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=ad688a0be9360850b5c1552fb135a4d335e2655c
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/ldso/arm/dl-debug.h | 4 ++++
ldso/ldso/sh/dl-debug.h | 4 ++++
ldso/ldso/x86_64/dl-debug.h | 4 ++++
3 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/ldso/ldso/arm/dl-debug.h b/ldso/ldso/arm/dl-debug.h
index 1bca6ff..48aa6fc 100644
--- a/ldso/ldso/arm/dl-debug.h
+++ b/ldso/ldso/arm/dl-debug.h
@@ -27,6 +27,8 @@
* SUCH DAMAGE.
*/
+#include
+
static const char *_dl_reltypes_tab[] =
{
[0] "R_ARM_NONE", "R_ARM_PC24", "R_ARM_ABS32", "R_ARM_REL32",
@@ -39,8 +41,10 @@ static const char *_dl_reltypes_tab[] =
[32] "R_ARM_ALU_PCREL_7_0","R_ARM_ALU_PCREL_15_8","R_ARM_ALU_PCREL_23_15","R_ARM_LDR_SBREL_11_0",
[36] "R_ARM_ALU_SBREL_19_12","R_ARM_ALU_SBREL_27_20",
[100] "R_ARM_GNU_VTENTRY","R_ARM_GNU_VTINHERIT","R_ARM_THM_PC11","R_ARM_THM_PC9",
+#ifdef __UCLIBC_HAS_TLS__
[104] "R_ARM_TLS_GD32","R_ARM_TLS_LDM32","R_ARM_TLS_LDO32","R_ARM_TLS_IE32",
[108] "R_ARM_TLS_LE32","R_ARM_TLS_LDO12","R_ARM_TLS_LE12","R_ARM_TLS_IE12GP",
+#endif
[249] "R_ARM_RXPC25", "R_ARM_RSBREL32", "R_ARM_THM_RPC22", "R_ARM_RREL32",
[253] "R_ARM_RABS22", "R_ARM_RPC24", "R_ARM_RBASE",
};
diff --git a/ldso/ldso/sh/dl-debug.h b/ldso/ldso/sh/dl-debug.h
index e2e74f8..f6e2191 100644
--- a/ldso/ldso/sh/dl-debug.h
+++ b/ldso/ldso/sh/dl-debug.h
@@ -28,6 +28,8 @@
* SUCH DAMAGE.
*/
+#include
+
static const char *_dl_reltypes_tab[] =
{
[0] "R_SH_NONE", "R_SH_DIR32", "R_SH_REL32", "R_SH_DIR8WPN",
@@ -36,8 +38,10 @@ static const char *_dl_reltypes_tab[] =
[25] "R_SH_SWITCH16","R_SH_SWITCH32","R_SH_USES",
[28] "R_SH_COUNT", "R_SH_ALIGN", "R_SH_CODE", "R_SH_DATA",
[32] "R_SH_LABEL", "R_SH_SWITCH8", "R_SH_GNU_VTINHERIT","R_SH_GNU_VTENTRY",
+#ifdef __UCLIBC_HAS_TLS__
[144] "R_SH_TLS_GD_32","R_SH_TLS_LD_32", "R_SH_TLS_LDO_32", "R_SH_TLS_IE_32",
[148] "R_SH_TLS_LE_32","R_SH_TLS_DTPMOD32", "R_SH_TLS_DTPOFF32", "R_SH_TLS_TPOFF32",
+#endif
[160] "R_SH_GOT32", "R_SH_PLT32", "R_SH_COPY", "R_SH_GLOB_DAT",
[164] "R_SH_JMP_SLOT","R_SH_RELATIVE","R_SH_GOTOFF", "R_SH_GOTPC",
};
diff --git a/ldso/ldso/x86_64/dl-debug.h b/ldso/ldso/x86_64/dl-debug.h
index d605a03..2cadc47 100644
--- a/ldso/ldso/x86_64/dl-debug.h
+++ b/ldso/ldso/x86_64/dl-debug.h
@@ -29,11 +29,15 @@
* SUCH DAMAGE.
*/
+#include
+
static const char *_dl_reltypes_tab[] = {
[ 0] "R_X86_64_NONE", "R_X86_64_64", "R_X86_64_PC32", "R_X86_64_GOT32",
[ 4] "R_X86_64_PLT32", "R_X86_64_COPY", "R_X86_64_GLOB_DAT", "R_X86_64_JUMP_SLOT",
[ 8] "R_X86_64_RELATIVE", "R_X86_64_GOTPCREL", "R_X86_64_32", "R_X86_64_32S",
[12] "R_X86_64_16", "R_X86_64_PC16", "R_X86_64_8", "R_X86_64_PC8",
+#ifdef __UCLIBC_HAS_TLS__
[16] "R_X86_64_DTPMOD64", "R_X86_64_DTPOFF64", "R_X86_64_TPOFF64", "R_X86_64_TLSGD",
[20] "R_X86_64_TLSLD", "R_X86_64_DTPOFF32", "R_X86_64_GOTTPOFF", "R_X86_64_TPOFF32"
+#endif
};
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] ldsodefs.h: move all structure and function
prototypes from dl-elf.h and dl-hash.h
Message-ID: <20110411142456.92D4F8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=aa10066065d79aff4a364be8df0a7a79008ca650
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
non-ldso files should include only this file.
Signed-off-by: Peter S. Mazinger
---
ldso/include/dl-elf.h | 34 +--------
ldso/include/dl-hash.h | 136 -------------------------------
ldso/include/ldso.h | 3 +-
ldso/include/ldsodefs.h | 170 ++++++++++++++++++++++++++++++++++++++-
ldso/ldso/dl-array.c | 2 +-
ldso/ldso/dl-symbols.c | 4 +-
libc/misc/elf/dl-iterate-phdr.c | 8 +-
7 files changed, 177 insertions(+), 180 deletions(-)
diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h
index 0103d3d..41a5997 100644
--- a/ldso/include/dl-elf.h
+++ b/ldso/include/dl-elf.h
@@ -13,26 +13,7 @@
#include
#include
-#include
-
-/* Forward declarations for stuff defined in dl-hash.h */
-struct dyn_elf;
-struct elf_resolve;
-
-#ifdef __LDSO_CACHE_SUPPORT__
-extern int _dl_map_cache(void);
-extern int _dl_unmap_cache(void);
-#else
-static __inline__ void _dl_map_cache(void) { }
-static __inline__ void _dl_unmap_cache(void) { }
-#endif
-
-/* Function prototypes for non-static stuff in dl-elf.c and elfinterp.c */
-extern struct elf_resolve * _dl_load_shared_library(int secure,
- struct dyn_elf **rpnt, struct elf_resolve *tpnt, char *full_libname,
- int trace_loaded_objects);
-extern int _dl_fixup(struct dyn_elf *rpnt, int flag);
-extern void _dl_protect_relro (struct elf_resolve *l) internal_function;
+#include
/*
* Bitsize related settings for things ElfW()
@@ -75,19 +56,6 @@ extern void _dl_protect_relro (struct elf_resolve *l) internal_function;
# define UNSUPPORTED_RELOC_STR "RELA"
#endif
-/* OS and/or GNU dynamic extensions */
-#ifdef __LDSO_GNU_HASH_SUPPORT__
-# define OS_NUM 2 /* for DT_RELOCCOUNT and DT_GNU_HASH entries */
-#else
-# define OS_NUM 1 /* for DT_RELOCCOUNT entry */
-#endif
-
-#ifndef ARCH_DYNAMIC_INFO
- /* define in arch specific code, if needed */
-# define ARCH_NUM 0
-#endif
-
-#define DYNAMIC_SIZE (DT_NUM+OS_NUM+ARCH_NUM)
/* Keep ARCH specific entries into dynamic section at the end of the array */
#define DT_RELCONT_IDX (DYNAMIC_SIZE - OS_NUM - ARCH_NUM)
diff --git a/ldso/include/dl-hash.h b/ldso/include/dl-hash.h
index 3e25692..c2cc50e 100644
--- a/ldso/include/dl-hash.h
+++ b/ldso/include/dl-hash.h
@@ -8,153 +8,17 @@
#ifndef _DL_HASH_H
#define _DL_HASH_H
-#include
-
-#include
-#include
-
#include
#ifndef RTLD_NEXT
#define RTLD_NEXT ((void*)-1)
#endif
-#include /* DYNAMIC_SIZE */
-
-struct init_fini {
- struct elf_resolve **init_fini;
- unsigned long nlist; /* Number of entries in init_fini */
-};
-
-/* For INIT/FINI dependency sorting. */
-struct init_fini_list {
- struct init_fini_list *next;
- struct elf_resolve *tpnt;
-};
-
-struct dyn_elf {
- struct elf_resolve * dyn;
- struct dyn_elf * next_handle; /* Used by dlopen et al. */
- struct init_fini init_fini;
- struct dyn_elf * next;
- struct dyn_elf * prev;
-};
-
-struct symbol_ref {
- const ElfW(Sym) *sym;
- struct elf_resolve *tpnt;
-};
-
-struct elf_resolve {
- /* These entries must be in this order to be compatible with the interface used
- by gdb to obtain the list of symbols. */
- DL_LOADADDR_TYPE loadaddr; /* Base address shared object is loaded at. */
- char *libname; /* Absolute file name object was found in. */
- ElfW(Dyn) *dynamic_addr; /* Dynamic section of the shared object. */
- struct elf_resolve * next;
- struct elf_resolve * prev;
- /* Nothing after this address is used by gdb. */
-
-#ifdef __UCLIBC_HAS_TLS__
- /* Thread-local storage related info. */
-
- /* Start of the initialization image. */
- void *l_tls_initimage;
- /* Size of the initialization image. */
- size_t l_tls_initimage_size;
- /* Size of the TLS block. */
- size_t l_tls_blocksize;
- /* Alignment requirement of the TLS block. */
- size_t l_tls_align;
- /* Offset of first byte module alignment. */
- size_t l_tls_firstbyte_offset;
-# ifndef NO_TLS_OFFSET
-# define NO_TLS_OFFSET 0
-# endif
- /* For objects present at startup time: offset in the static TLS block. */
- ptrdiff_t l_tls_offset;
- /* Index of the module in the dtv array. */
- size_t l_tls_modid;
- /* Nonzero if _dl_init_static_tls should be called for this module */
- unsigned int l_need_tls_init:1;
-#endif
-
- ElfW(Addr) mapaddr;
- enum {elf_lib, elf_executable,program_interpreter, loaded_file} libtype;
- struct dyn_elf * symbol_scope;
- unsigned short usage_count;
- unsigned short int init_flag;
- unsigned long rtld_flags; /* RTLD_GLOBAL, RTLD_NOW etc. */
- Elf_Symndx nbucket;
-
-#ifdef __LDSO_GNU_HASH_SUPPORT__
- /* Data needed to support GNU hash style */
- Elf32_Word l_gnu_bitmask_idxbits;
- Elf32_Word l_gnu_shift;
- const ElfW(Addr) *l_gnu_bitmask;
-
- union
- {
- const Elf32_Word *l_gnu_chain_zero;
- const Elf_Symndx *elf_buckets;
- };
-#else
- Elf_Symndx *elf_buckets;
-#endif
-
- struct init_fini_list *init_fini;
- struct init_fini_list *rtld_local; /* keep tack of RTLD_LOCAL libs in same group */
- /*
- * These are only used with ELF style shared libraries
- */
- Elf_Symndx nchain;
-
-#ifdef __LDSO_GNU_HASH_SUPPORT__
- union
- {
- const Elf32_Word *l_gnu_buckets;
- const Elf_Symndx *chains;
- };
-#else
- Elf_Symndx *chains;
-#endif
- ElfW(Word) dynamic_info[DYNAMIC_SIZE];
-
- unsigned long n_phent;
- ElfW(Phdr) * ppnt;
-
- ElfW(Addr) relro_addr;
- size_t relro_size;
-
- dev_t st_dev; /* device */
- ino_t st_ino; /* inode */
-
-#ifdef __powerpc__
- /* this is used to store the address of relocation data words, so
- * we don't have to calculate it every time, which requires a divide */
- unsigned long data_words;
-#endif
-
-#ifdef __FDPIC__
- /* Every loaded module holds a hashtable of function descriptors of
- functions defined in it, such that it's easy to release the
- memory when the module is dlclose()d. */
- struct funcdesc_ht *funcdesc_ht;
-#endif
-};
-
#define RELOCS_DONE 0x000001
#define JMP_RELOCS_DONE 0x000002
#define INIT_FUNCS_CALLED 0x000004
#define FINI_FUNCS_CALLED 0x000008
#define DL_OPENED 0x000010
-extern struct dyn_elf * _dl_symbol_tables;
-extern struct elf_resolve * _dl_loaded_modules;
-
-extern char *_dl_find_hash(const char *name, struct dyn_elf *rpnt,
- struct elf_resolve *mytpnt, int type_class,
- struct symbol_ref *symbol);
-
#define LD_ERROR_NOFILE 1
#define LD_ERROR_NOZERO 2
#define LD_ERROR_NOTELF 3
diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h
index 9a2fc74..201db68 100644
--- a/ldso/include/ldso.h
+++ b/ldso/include/ldso.h
@@ -21,7 +21,7 @@
/* Pull in the arch specific page size */
#include
-#include
+#include
#ifndef __ARCH_HAS_NO_SHARED__
#include
@@ -34,7 +34,6 @@
# include
# include
#endif
-#include
/* common align masks, if not specified by dl-sysdep.h */
#ifndef ADDR_ALIGN
diff --git a/ldso/include/ldsodefs.h b/ldso/include/ldsodefs.h
index ebfee72..6454dd4 100644
--- a/ldso/include/ldsodefs.h
+++ b/ldso/include/ldsodefs.h
@@ -1,14 +1,154 @@
#ifndef _LDSODEFS_H
-#define _LDSODEFS_H 1
-
-#include
+#define _LDSODEFS_H
#include
#include
+#include
+#include
+#include
+
+#include
#ifdef __UCLIBC_HAS_TLS__
-#include
+# include
+#endif
+
+/* OS and/or GNU dynamic extensions */
+#ifdef __LDSO_GNU_HASH_SUPPORT__
+# define OS_NUM 2 /* for DT_RELOCCOUNT and DT_GNU_HASH entries */
+#else
+# define OS_NUM 1 /* for DT_RELOCCOUNT entry */
+#endif
+
+#ifndef ARCH_DYNAMIC_INFO
+ /* define in arch specific code, if needed */
+# define ARCH_NUM 0
#endif
+#define DYNAMIC_SIZE (DT_NUM+OS_NUM+ARCH_NUM)
+
+struct elf_resolve;
+struct init_fini {
+ struct elf_resolve **init_fini;
+ unsigned long nlist; /* Number of entries in init_fini */
+};
+
+/* For INIT/FINI dependency sorting. */
+struct init_fini_list {
+ struct init_fini_list *next;
+ struct elf_resolve *tpnt;
+};
+
+struct dyn_elf {
+ struct elf_resolve * dyn;
+ struct dyn_elf * next_handle; /* Used by dlopen et al. */
+ struct init_fini init_fini;
+ struct dyn_elf * next;
+ struct dyn_elf * prev;
+};
+
+struct symbol_ref {
+ const ElfW(Sym) *sym;
+ struct elf_resolve *tpnt;
+};
+
+struct elf_resolve {
+ /* These entries must be in this order to be compatible with the interface used
+ by gdb to obtain the list of symbols. */
+ DL_LOADADDR_TYPE loadaddr; /* Base address shared object is loaded at. */
+ char *libname; /* Absolute file name object was found in. */
+ ElfW(Dyn) *dynamic_addr; /* Dynamic section of the shared object. */
+ struct elf_resolve * next;
+ struct elf_resolve * prev;
+ /* Nothing after this address is used by gdb. */
+
+#ifdef __UCLIBC_HAS_TLS__
+ /* Thread-local storage related info. */
+
+ /* Start of the initialization image. */
+ void *l_tls_initimage;
+ /* Size of the initialization image. */
+ size_t l_tls_initimage_size;
+ /* Size of the TLS block. */
+ size_t l_tls_blocksize;
+ /* Alignment requirement of the TLS block. */
+ size_t l_tls_align;
+ /* Offset of first byte module alignment. */
+ size_t l_tls_firstbyte_offset;
+# ifndef NO_TLS_OFFSET
+# define NO_TLS_OFFSET 0
+# endif
+ /* For objects present at startup time: offset in the static TLS block. */
+ ptrdiff_t l_tls_offset;
+ /* Index of the module in the dtv array. */
+ size_t l_tls_modid;
+ /* Nonzero if _dl_init_static_tls should be called for this module */
+ unsigned int l_need_tls_init:1;
+#endif
+
+ ElfW(Addr) mapaddr;
+ enum {elf_lib, elf_executable,program_interpreter, loaded_file} libtype;
+ struct dyn_elf * symbol_scope;
+ unsigned short usage_count;
+ unsigned short int init_flag;
+ unsigned long rtld_flags; /* RTLD_GLOBAL, RTLD_NOW etc. */
+ Elf_Symndx nbucket;
+
+#ifdef __LDSO_GNU_HASH_SUPPORT__
+ /* Data needed to support GNU hash style */
+ Elf32_Word l_gnu_bitmask_idxbits;
+ Elf32_Word l_gnu_shift;
+ const ElfW(Addr) *l_gnu_bitmask;
+
+ union
+ {
+ const Elf32_Word *l_gnu_chain_zero;
+ const Elf_Symndx *elf_buckets;
+ };
+#else
+ Elf_Symndx *elf_buckets;
+#endif
+
+ struct init_fini_list *init_fini;
+ struct init_fini_list *rtld_local; /* keep tack of RTLD_LOCAL libs in same group */
+ /*
+ * These are only used with ELF style shared libraries
+ */
+ Elf_Symndx nchain;
+
+#ifdef __LDSO_GNU_HASH_SUPPORT__
+ union
+ {
+ const Elf32_Word *l_gnu_buckets;
+ const Elf_Symndx *chains;
+ };
+#else
+ Elf_Symndx *chains;
+#endif
+ ElfW(Word) dynamic_info[DYNAMIC_SIZE];
+
+ unsigned long n_phent;
+ ElfW(Phdr) * ppnt;
+
+ ElfW(Addr) relro_addr;
+ size_t relro_size;
+
+ dev_t st_dev; /* device */
+ ino_t st_ino; /* inode */
+
+#ifdef __powerpc__
+ /* this is used to store the address of relocation data words, so
+ * we don't have to calculate it every time, which requires a divide */
+ unsigned long data_words;
+#endif
+
+#ifdef __FDPIC__
+ /* Every loaded module holds a hashtable of function descriptors of
+ functions defined in it, such that it's easy to release the
+ memory when the module is dlclose()d. */
+ struct funcdesc_ht *funcdesc_ht;
+#endif
+};
+
#ifdef __mips__
/* The MIPS ABI specifies that the dynamic section has to be read-only. */
@@ -59,6 +199,28 @@ struct elf_resolve;
extern void _dl_run_init_array(struct elf_resolve *);
extern void _dl_run_fini_array(struct elf_resolve *);
+extern struct dyn_elf * _dl_symbol_tables;
+extern struct elf_resolve * _dl_loaded_modules;
+
+extern char *_dl_find_hash(const char *name, struct dyn_elf *rpnt,
+ struct elf_resolve *mytpnt, int type_class,
+ struct symbol_ref *symbol);
+
+#ifdef __LDSO_CACHE_SUPPORT__
+extern int _dl_map_cache(void);
+extern int _dl_unmap_cache(void);
+#else
+static __inline__ void _dl_map_cache(void) { }
+static __inline__ void _dl_unmap_cache(void) { }
+#endif
+
+/* Function prototypes for non-static stuff in dl-elf.c and elfinterp.c */
+extern struct elf_resolve * _dl_load_shared_library(int secure,
+ struct dyn_elf **rpnt, struct elf_resolve *tpnt, char *full_libname,
+ int trace_loaded_objects);
+extern int _dl_fixup(struct dyn_elf *rpnt, int flag);
+extern void _dl_protect_relro (struct elf_resolve *l) internal_function;
+
#ifdef __UCLIBC_HAS_TLS__
/* Determine next available module ID. */
extern size_t _dl_next_tls_modid (void) internal_function attribute_hidden;
diff --git a/ldso/ldso/dl-array.c b/ldso/ldso/dl-array.c
index cc5e197..edbf59d 100644
--- a/ldso/ldso/dl-array.c
+++ b/ldso/ldso/dl-array.c
@@ -28,7 +28,7 @@
* SUCH DAMAGE.
*/
-#include
+#include
static void _dl_run_array_forward(unsigned long array, unsigned long size,
DL_LOADADDR_TYPE loadaddr)
diff --git a/ldso/ldso/dl-symbols.c b/ldso/ldso/dl-symbols.c
index 0997536..b03d516 100644
--- a/ldso/ldso/dl-symbols.c
+++ b/ldso/ldso/dl-symbols.c
@@ -16,7 +16,9 @@
* as well as all of the other good stuff in the binary.
*/
-#include
+#define __need_NULL
+#include
+#include
struct elf_resolve *_dl_loaded_modules = NULL;
diff --git a/libc/misc/elf/dl-iterate-phdr.c b/libc/misc/elf/dl-iterate-phdr.c
index 5b86db0..188ab1e 100644
--- a/libc/misc/elf/dl-iterate-phdr.c
+++ b/libc/misc/elf/dl-iterate-phdr.c
@@ -11,12 +11,14 @@
Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
-
-#include
-#include
+#include
/* we want this in libc but nowhere else */
#ifdef __USE_GNU
+# define __need_NULL
+# include
+# include
+# include
static int
__dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data)
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] ldso: make _dl_dprintf static
Message-ID: <20110411142455.6A39C8254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=a0902992926f78d2e1efc5ec25387bd69098eff5
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/include/ldso.h | 1 -
ldso/ldso/dl-elf.c | 2 +-
ldso/ldso/ldso.c | 2 ++
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h
index 61e8846..9a2fc74 100644
--- a/ldso/include/ldso.h
+++ b/ldso/include/ldso.h
@@ -108,7 +108,6 @@ extern void *_dl_malloc(size_t size);
extern void *_dl_calloc(size_t __nmemb, size_t __size);
extern void *_dl_realloc(void *__ptr, size_t __size);
extern void _dl_free(void *);
-extern void _dl_dprintf(int, const char *__restrict, ...) attribute_hidden;
#else
# include
# define _dl_malloc malloc
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 39c5044..97fa9a3 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -941,7 +941,7 @@ int _dl_fixup(struct dyn_elf *rpnt, int now_flag)
#ifdef IS_IN_rtld
/* Minimal printf which handles only %s, %d, and %x */
-void _dl_dprintf(int fd, const char *__restrict fmt, ...)
+static void _dl_dprintf(int fd, const char *__restrict fmt, ...)
{
#if __WORDSIZE > 32
long int num;
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 83902ff..dbade03 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -34,6 +34,8 @@
#include
+static void _dl_dprintf(int, const char *__restrict, ...);
+
/* Pull in common debug code */
#include "dl-debug.c"
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] ldso: introduce _rtld_global[_ro] and
_rtld_local[_ro] structures
Message-ID: <20110411142457.476328254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=6409a0c7a5c1ad4693e078a60d2f531dd40d0a69
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
With these structures the functions and global data provided by ldso
can be hidden,
The other libs (libdl/libc/libpthread) can access these by pointers.
Same applies to global data, pagesize, clock ... can be reused.
text data bss dec hex filename
ldso-future
25497 312 224 26033 65b1 lib/ld-uClibc-0.9.32-rc3-git.so
6679 316 8 7003 1b5b lib/libdl-0.9.32-rc3-git.so
future
28908 384 236 29528 7358 lib/ld-uClibc-0.9.32-rc3-git.so
7686 396 4 8086 1f96 lib/libdl-0.9.32-rc3-git.so
master
28956 384 236 29576 7388 lib/ld-uClibc-0.9.32-rc3-git.so
8214 396 4 8614 21a6 lib/libdl-0.9.32-rc3-git.so
Signed-off-by: Peter S. Mazinger
Patch is too large, so refusing to show it
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] ldsodefs.h: removed unused code
Message-ID: <20110411142456.F0DF38254E@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=da58a257d94eb339bfe088e549308111193b2778
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/include/ldsodefs.h | 30 ------------------------------
1 files changed, 0 insertions(+), 30 deletions(-)
diff --git a/ldso/include/ldsodefs.h b/ldso/include/ldsodefs.h
index e2b517c..548a404 100644
--- a/ldso/include/ldsodefs.h
+++ b/ldso/include/ldsodefs.h
@@ -5,7 +5,6 @@
#include
#include
#include
-#include
#include
#ifdef __UCLIBC_HAS_TLS__
@@ -149,14 +148,6 @@ struct elf_resolve {
#endif
};
-#ifdef __mips__
-/* The MIPS ABI specifies that the dynamic section has to be read-only. */
-
-#define DL_RO_DYN_SECTION 1
-
-/* TODO: Import in 64-bit relocations from glibc. */
-#endif
-
#ifndef SHARED
# define EXTERN extern
#else
@@ -306,25 +297,4 @@ EXTERN size_t _dl_tls_generation;
EXTERN void (*_dl_init_static_tls) (struct link_map *);
#endif
-/* We have the auxiliary vector. */
-#define HAVE_AUX_VECTOR
-
-/* We can assume that the kernel always provides the AT_UID, AT_EUID,
- AT_GID, and AT_EGID values in the auxiliary vector from 2.4.0 or so on. */
-#if __ASSUME_AT_XID
-# define HAVE_AUX_XID
-#endif
-
-/* We can assume that the kernel always provides the AT_SECURE value
- in the auxiliary vector from 2.5.74 or so on. */
-#if __ASSUME_AT_SECURE
-# define HAVE_AUX_SECURE
-#endif
-
-/* Starting with one of the 2.4.0 pre-releases the Linux kernel passes
- up the page size information. */
-#if __ASSUME_AT_PAGESIZE
-# define HAVE_AUX_PAGESIZE
-#endif
-
#endif
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] dl-inlines.h: fix the use of
_dl_if_debug_dprint
Message-ID: <20110411210337.7DC5F82550@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=15de054b119bf6f9b907ef2d269a66e55dc51601
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/ldso/bfin/dl-inlines.h | 2 +-
ldso/ldso/c6x/dl-inlines.h | 2 +-
ldso/ldso/frv/dl-inlines.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ldso/ldso/bfin/dl-inlines.h b/ldso/ldso/bfin/dl-inlines.h
index b3eea8b..d79f898 100644
--- a/ldso/ldso/bfin/dl-inlines.h
+++ b/ldso/ldso/bfin/dl-inlines.h
@@ -83,7 +83,7 @@ __dl_init_loadaddr_hdr (struct elf32_fdpic_loadaddr loadaddr, void *addr,
segdata->p_vaddr = phdr->p_vaddr;
segdata->p_memsz = phdr->p_memsz;
- _dl_if_debug_dprint(_dl_debug_file, "%i: mapped %x at %x, size %x\n",
+ _dl_if_debug_dprint("%i: mapped %x at %x, size %x\n",
loadaddr.map->nsegs-1,
segdata->p_vaddr, segdata->addr, segdata->p_memsz);
}
diff --git a/ldso/ldso/c6x/dl-inlines.h b/ldso/ldso/c6x/dl-inlines.h
index 03b60c2..cf493df 100644
--- a/ldso/ldso/c6x/dl-inlines.h
+++ b/ldso/ldso/c6x/dl-inlines.h
@@ -64,7 +64,7 @@ __dl_init_loadaddr_hdr (struct elf32_dsbt_loadaddr loadaddr, void *addr,
segdata->p_vaddr = phdr->p_vaddr;
segdata->p_memsz = phdr->p_memsz;
- _dl_if_debug_dprint(_dl_debug_file, "%i: mapped %x at %x, size %x\n",
+ _dl_if_debug_dprint("%i: mapped %x at %x, size %x\n",
loadaddr.map->nsegs-1,
segdata->p_vaddr, segdata->addr, segdata->p_memsz);
}
diff --git a/ldso/ldso/frv/dl-inlines.h b/ldso/ldso/frv/dl-inlines.h
index 2249eae..22b42a8 100644
--- a/ldso/ldso/frv/dl-inlines.h
+++ b/ldso/ldso/frv/dl-inlines.h
@@ -67,7 +67,7 @@ __dl_init_loadaddr_hdr (struct elf32_fdpic_loadaddr loadaddr, void *addr,
segdata->p_vaddr = phdr->p_vaddr;
segdata->p_memsz = phdr->p_memsz;
- _dl_if_debug_dprint(_dl_debug_file, "%i: mapped %x at %x, size %x\n",
+ _dl_if_debug_dprint("%i: mapped %x at %x, size %x\n",
loadaddr.map->nsegs-1,
segdata->p_vaddr, segdata->addr, segdata->p_memsz);
}
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] ldso/libdl: hide _dl_malloc and friends,
add _dl_malloc_function to _rtld_global structure
Message-ID: <20110411221925.413FB8231F@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=4f9fe3f11077989064ef448a28c9a235dc7744f0
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
ldso/include/ldso.h | 12 +++++++-----
ldso/include/ldsodefs.h | 15 ++++++++-------
ldso/ldso/dl-tls.c | 14 +++++++-------
ldso/ldso/ldso.c | 41 ++++++++++++++++++++---------------------
ldso/libdl/libdl.c | 12 +++++++++---
5 files changed, 51 insertions(+), 43 deletions(-)
diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h
index 18156dd..8f7db6c 100644
--- a/ldso/include/ldso.h
+++ b/ldso/include/ldso.h
@@ -95,11 +95,13 @@ extern void **_dl_initial_error_catch_tsd(void) __attribute__((const))
#endif /* __SUPPORT_LD_DEBUG_EARLY__ */
#ifdef IS_IN_rtld
-extern void *_dl_malloc(size_t size);
-extern void *_dl_calloc(size_t __nmemb, size_t __size);
-extern void *_dl_realloc(void *__ptr, size_t __size);
-extern void *_dl_memalign(size_t __boundary, size_t __size);
-extern void _dl_free(void *);
+extern void *_dl_malloc(size_t size) attribute_hidden;
+extern void _dl_free(void *) attribute_hidden;
+# ifdef __UCLIBC_HAS_TLS__
+extern void *_dl_calloc(size_t __nmemb, size_t __size) attribute_hidden;
+extern void *_dl_realloc(void *__ptr, size_t __size) attribute_hidden;
+extern void *_dl_memalign(size_t __boundary, size_t __size) attribute_hidden;
+# endif
#else
# include
# define _dl_malloc malloc
diff --git a/ldso/include/ldsodefs.h b/ldso/include/ldsodefs.h
index 90dee51..bf6f3b1 100644
--- a/ldso/include/ldsodefs.h
+++ b/ldso/include/ldsodefs.h
@@ -196,6 +196,9 @@ struct rtld_global
/* Used to communicate with the gdb debugger */
EXTERN struct r_debug *_dl_debug_addr;
+ EXTERN void *(*_dl_malloc_function) (size_t);
+ EXTERN void (*_dl_free_function) (void *);
+
#ifdef __UCLIBC_HAS_THREADS__
/* Function pointer for catching TLS errors. */
EXTERN void **(*_dl_error_catch_tsd) (void) __attribute__ ((const));
@@ -238,6 +241,11 @@ struct rtld_global
EXTERN size_t _dl_tls_generation;
EXTERN void (*_dl_init_static_tls) (struct link_map *);
+
+ /* uClibc-specific */
+ EXTERN void *(*_dl_calloc_function) (size_t, size_t);
+ EXTERN void *(*_dl_realloc_function) (void *, size_t);
+ EXTERN void *(*_dl_memalign_function) (size_t, size_t);
#endif
#ifdef __SUPPORT_LD_DEBUG__
@@ -269,10 +277,6 @@ struct rtld_global_ro
int (*_dl_fixup) (struct dyn_elf *, int);
void (internal_function *_dl_protect_relro) (struct elf_resolve *);
char *(*_dl_find_hash) (const char *, struct dyn_elf *, struct elf_resolve *, int, struct symbol_ref *);
-# if 0 /* psm: ask Bernd Schmid */
- void *(*_dl_malloc_function) (size_t);
- void (*_dl_free_function) (void *);
-# endif
# ifdef __LDSO_CACHE_SUPPORT__
int (*_dl_map_cache) (void);
int (*_dl_unmap_cache) (void);
@@ -327,9 +331,6 @@ extern char *_dl_find_hash(const char *name, struct dyn_elf *rpnt, struct elf_re
extern void _dl_protect_relro (struct elf_resolve *map)
internal_function attribute_shared_hidden;
-extern void *(*_dl_malloc_function) (size_t) /*attribute_shared_hidden*/;
-extern void (*_dl_free_function) (void *) /*attribute_shared_hidden*/;
-
#ifdef __LDSO_CACHE_SUPPORT__
extern int _dl_map_cache(void) attribute_shared_hidden;
extern int _dl_unmap_cache(void) attribute_shared_hidden;
diff --git a/ldso/ldso/dl-tls.c b/ldso/ldso/dl-tls.c
index fa304c6..189bf33 100644
--- a/ldso/ldso/dl-tls.c
+++ b/ldso/ldso/dl-tls.c
@@ -30,11 +30,11 @@
#include
#include
+#ifndef SHARED
void *(*_dl_calloc_function) (size_t __nmemb, size_t __size) = NULL;
void *(*_dl_realloc_function) (void *__ptr, size_t __size) = NULL;
void *(*_dl_memalign_function) (size_t __boundary, size_t __size) = NULL;
-
-void (*_dl_free_function) (void *__ptr);
+#endif
/* Round up N to the nearest multiple of P, where P is a power of 2
--- without using libgcc division routines. */
@@ -46,8 +46,8 @@ _dl_calloc (size_t __nmemb, size_t __size)
void *result;
size_t size = (__size * __nmemb);
- if (_dl_calloc_function)
- return (*_dl_calloc_function) (__nmemb, __size);
+ if (GL(dl_calloc_function))
+ return (*GL(dl_calloc_function)) (__nmemb, __size);
if ((result = _dl_malloc(size)) != NULL) {
_dl_memset(result, 0, size);
@@ -59,8 +59,8 @@ _dl_calloc (size_t __nmemb, size_t __size)
void *
_dl_realloc (void * __ptr, size_t __size)
{
- if (_dl_realloc_function)
- return (*_dl_realloc_function) (__ptr, __size);
+ if (GL(dl_realloc_function))
+ return (*GL(dl_realloc_function)) (__ptr, __size);
_dl_debug_early("NOT IMPLEMENTED PROPERLY!!!\n");
return NULL;
@@ -202,7 +202,7 @@ _dl_nothread_init_static_tls (struct link_map *map)
#endif
/* Taken from glibc/sysdeps/generic/dl-tls.c */
-static void
+static attribute_noreturn void
oom (void)
{
_dl_debug_early("cannot allocate thread-local memory: ABORT\n");
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index d96396c..49c14a1 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -39,7 +39,14 @@ struct rtld_global _rtld_global =
{
._dl_loaded_modules = NULL,
._dl_symbol_tables = NULL,
- ._dl_debug_addr = NULL
+ ._dl_debug_addr = NULL,
+ ._dl_malloc_function = NULL,
+ ._dl_free_function = NULL
+#ifdef __UCLIBC_HAS_TLS__
+, ._dl_calloc_function = NULL,
+ ._dl_realloc_function = NULL,
+ ._dl_memalign_function = NULL
+#endif
#ifdef __SUPPORT_LD_DEBUG__
, ._dl_debug = NULL
#endif
@@ -55,10 +62,6 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
._dl_fixup = _dl_fixup,
._dl_protect_relro = _dl_protect_relro,
._dl_find_hash = _dl_find_hash
-# if 0 /* psm: ask Bernd Schmid */
-, ._dl_malloc_function = _dl_malloc_function,
- ._dl_free_function = _dl_free_function
-# endif
# ifdef __LDSO_CACHE_SUPPORT__
, ._dl_map_cache = _dl_map_cache,
._dl_unmap_cache = _dl_unmap_cache
@@ -66,7 +69,7 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
# ifdef __mips__
, ._dl_perform_mips_global_got_relocations = _dl_perform_mips_global_got_relocations
# endif
-# ifdef USE_TLS
+# ifdef __UCLIBC_HAS_TLS__
# if 0
# ifdef __i386__
, ._tls_get_addr = ___tls_get_addr_internal
@@ -215,9 +218,6 @@ static char *_dl_preload = NULL; /* Things to be loaded before the libs */
char *_dl_ldsopath = NULL; /* Location of the shared lib loader */
int _dl_errno = 0; /* We can't use the real errno in ldso */
-void *(*_dl_malloc_function) (size_t size) = NULL;
-void (*_dl_free_function) (void *p) = NULL;
-
static int _dl_secure = 1; /* Are we dealing with setuid stuff? */
@@ -321,8 +321,8 @@ void *_dl_malloc(size_t size)
_dl_debug_early("request for %d bytes\n", size);
#endif
- if (_dl_malloc_function)
- return (*_dl_malloc_function) (size);
+ if (GL(dl_malloc_function))
+ return (*GL(dl_malloc_function)) (size);
if (_dl_malloc_addr - _dl_mmap_zero + size > GLRO(dl_pagesize)) {
size_t rounded_size;
@@ -372,8 +372,8 @@ static void *_dl_zalloc(size_t size)
void _dl_free(void *p)
{
- if (_dl_free_function)
- (*_dl_free_function) (p);
+ if (GL(dl_free_function))
+ (*GL(dl_free_function)) (p);
}
#ifdef __UCLIBC_HAS_TLS__
@@ -384,8 +384,8 @@ void *_dl_memalign(size_t __boundary, size_t __size)
size_t delta;
size_t rounded = 0;
- if (_dl_memalign_function)
- return (*_dl_memalign_function) (__boundary, __size);
+ if (GL(dl_memalign_function))
+ return (*GL(dl_memalign_function)) (__boundary, __size);
while (rounded < __boundary) {
rounded = (1 << i++);
@@ -1223,23 +1223,22 @@ static __always_inline void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LO
}
/* 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(__C_SYMBOL_PREFIX__ "malloc",
+ GL(dl_malloc_function) = (void* (*)(size_t)) (intptr_t) _dl_find_hash(__C_SYMBOL_PREFIX__ "malloc",
GL(dl_symbol_tables), NULL, ELF_RTYPE_CLASS_PLT, NULL);
- _dl_free_function = (void (*)(void *)) (intptr_t)
+ GL(dl_free_function) = (void (*)(void *)) (intptr_t)
_dl_find_hash(__C_SYMBOL_PREFIX__ "free", GL(dl_symbol_tables), NULL, ELF_RTYPE_CLASS_PLT, NULL);
#ifdef __UCLIBC_HAS_TLS__
/* Find the real functions and make ldso functions use them from now on */
- _dl_calloc_function = (void* (*)(size_t, size_t)) (intptr_t)
+ GL(dl_calloc_function) = (void* (*)(size_t, size_t)) (intptr_t)
_dl_find_hash(__C_SYMBOL_PREFIX__ "calloc", GL(dl_symbol_tables), NULL, ELF_RTYPE_CLASS_PLT, NULL);
- _dl_realloc_function = (void* (*)(void *, size_t)) (intptr_t)
+ GL(dl_realloc_function) = (void* (*)(void *, size_t)) (intptr_t)
_dl_find_hash(__C_SYMBOL_PREFIX__ "realloc", GL(dl_symbol_tables), NULL, ELF_RTYPE_CLASS_PLT, NULL);
- _dl_memalign_function = (void* (*)(size_t, size_t)) (intptr_t)
+ GL(dl_memalign_function) = (void* (*)(size_t, size_t)) (intptr_t)
_dl_find_hash(__C_SYMBOL_PREFIX__ "memalign", GL(dl_symbol_tables), NULL, ELF_RTYPE_CLASS_PLT, NULL);
-
#endif
/* Notify the debugger that all objects are now mapped in. */
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index 20c827a..7fb33ef 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -32,6 +32,7 @@
#include
#include
#include
+#include
#include
#include
#ifdef __UCLIBC_HAS_TLS__
@@ -46,7 +47,7 @@
static const char *_dl_progname= ""; /* Program name */
void *(*_dl_malloc_function)(size_t) = NULL;
-void (*_dl_free_function) (void *p);
+void (*_dl_free_function) (void *p) = NULL;
char *_dl_library_path = NULL; /* Where we look for libraries */
char *_dl_ldsopath = NULL; /* Location of the shared lib loader */
size_t _dl_pagesize = PAGE_SIZE; /* Store the page size for later use */
@@ -252,8 +253,13 @@ void *dlopen(const char *libname, int flag)
if (!_dl_init) {
_dl_init = true;
- _dl_malloc_function = malloc;
- _dl_free_function = free;
+ GL(dl_malloc_function) = malloc;
+ GL(dl_free_function) = free;
+#ifdef __UCLIBC_HAS_TLS__
+ GL(dl_calloc_function) = calloc;
+ GL(dl_realloc_function) = realloc;
+ GL(dl_memalign_function) = memalign;
+#endif
}
/* Cover the trivial case first */
if (!libname)
--
1.7.3.4
From bugzilla at busybox.net Tue Apr 12 06:02:38 2011
From: bugzilla at busybox.net (bugzilla at busybox.net)
Date: Tue, 12 Apr 2011 06:02:38 +0000 (UTC)
Subject: [Bug 2089] errno not threadsafe
In-Reply-To:
References:
Message-ID: <20110412060238.63C2A8259A@busybox.osuosl.org>
https://bugs.busybox.net/show_bug.cgi?id=2089
Daniel Ng changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P5 |P2
Severity|minor |critical
--- Comment #13 from Daniel Ng ---
Without this patch, my system would be broken. I am using uClibc-0.9.31 with a
PowerPC-based arch (Linux 2.6.30).
Without this patch, I would get errno==0 when read() returned -1. The code
doesn't handle such a case (and it shouldn't need to!) and so results in the
system locking up.
I've upped the Priority to P2 Critical.
The patch makes the system behave correctly.
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit future] hppa/bits/atomic.h: include errno.h to get
EFAULT/ENOSYS
Message-ID: <20110412203910.EE4CB825A1@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=09ccda6c11a2a424abe1f1488667a76392ee557e
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
Signed-off-by: Peter S. Mazinger
---
libc/sysdeps/linux/hppa/bits/atomic.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libc/sysdeps/linux/hppa/bits/atomic.h b/libc/sysdeps/linux/hppa/bits/atomic.h
index 87aeb84..08a7c3e 100644
--- a/libc/sysdeps/linux/hppa/bits/atomic.h
+++ b/libc/sysdeps/linux/hppa/bits/atomic.h
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include
+#include
#include
#define ABORT_INSTRUCTION __asm__(__UCLIBC_ABORT_INSTRUCTION__)
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit future] getpt.c: no need for hidden posix_openpt
Message-ID: <20110412203910.A5514825A1@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=3981a59eb3efd3af78f4bc7379aec80e0d0275bd
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
Prefer static inline instead of hidden (__bsd_getpt)
Signed-off-by: Peter S. Mazinger
---
include/stdlib.h | 1 -
libc/stdlib/bsd_getpt.c | 2 +-
libc/stdlib/getpt.c | 10 +++++-----
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/include/stdlib.h b/include/stdlib.h
index 7b35840..b2e51f5 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -856,7 +856,6 @@ extern void setkey (__const char *__key) __THROW __nonnull ((1));
#ifdef __USE_XOPEN2K
/* Return a master pseudo-terminal handle. */
extern int posix_openpt (int __oflag) __wur;
-libc_hidden_proto(posix_openpt)
#endif
#ifdef __USE_XOPEN
diff --git a/libc/stdlib/bsd_getpt.c b/libc/stdlib/bsd_getpt.c
index e704e23..d8c46f5 100644
--- a/libc/stdlib/bsd_getpt.c
+++ b/libc/stdlib/bsd_getpt.c
@@ -40,7 +40,7 @@ const char __libc_ptyname1[] attribute_hidden = PTYNAME1;
const char __libc_ptyname2[] attribute_hidden = PTYNAME2;
/* Open a master pseudo terminal and return its file descriptor. */
-int
+static __inline__ int
__getpt (void)
{
char buf[sizeof (_PATH_PTY) + 2];
diff --git a/libc/stdlib/getpt.c b/libc/stdlib/getpt.c
index 2d8b207..adebec7 100644
--- a/libc/stdlib/getpt.c
+++ b/libc/stdlib/getpt.c
@@ -43,12 +43,12 @@ extern __typeof(statfs) __libc_statfs;
#if !defined __UNIX98PTY_ONLY__ && defined __UCLIBC_HAS_GETPT__
/* Prototype for function that opens BSD-style master pseudo-terminals. */
-extern int __bsd_getpt (void) attribute_hidden;
+static __inline__ int __bsd_getpt (void);
#endif
/* Open a master pseudo terminal and return its file descriptor. */
-int
-posix_openpt (int flags)
+static int
+__posix_openpt (int flags)
{
#define have_no_dev_ptmx (1<<0)
#define devpts_mounted (1<<1)
@@ -112,14 +112,14 @@ posix_openpt (int flags)
#endif
return -1;
}
-libc_hidden_def(posix_openpt)
+strong_alias(__posix_openpt,posix_openpt)
#undef have_no_dev_ptmx
#undef devpts_mounted
#if defined __USE_GNU && defined __UCLIBC_HAS_GETPT__
int getpt (void)
{
- return posix_openpt(O_RDWR);
+ return __posix_openpt(O_RDWR);
}
#if !defined __UNIX98PTY_ONLY__ && defined __UCLIBC_HAS_GETPT__
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit future] add lcong48[_r]
Message-ID: <20110412203910.CF5ED825A1@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=46374dd9effb20c13e26f70e23f269c14e551cee
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
Signed-off-by: Peter S. Mazinger
---
libc/stdlib/Makefile.in | 2 +-
libc/stdlib/lcong48.c | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletions(-)
create mode 100644 libc/stdlib/lcong48.c
diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in
index 760ccf7..4407d63 100644
--- a/libc/stdlib/Makefile.in
+++ b/libc/stdlib/Makefile.in
@@ -15,7 +15,7 @@ CSRC-y := \
abort.c getenv.c mkdtemp.c realpath.c canonicalize.c mkstemp.c \
rand.c random.c random_r.c setenv.c div.c ldiv.c lldiv.c \
getpt.c drand48-iter.c jrand48.c \
- jrand48_r.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
+ jrand48_r.c lcong48.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
nrand48_r.c rand_r.c srand48.c srand48_r.c seed48.c seed48_r.c \
valloc.c a64l.c l64a.c __uc_malloc.c
CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_memalign.c
diff --git a/libc/stdlib/lcong48.c b/libc/stdlib/lcong48.c
new file mode 100644
index 0000000..06cab66
--- /dev/null
+++ b/libc/stdlib/lcong48.c
@@ -0,0 +1,29 @@
+/* vi: set sw=4 ts=4: */
+/* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */
+
+#include
+
+#if defined __USE_SVID || defined __USE_XOPEN
+#include
+#include
+#include
+
+static int __lcong48_r (unsigned short int param[7], struct drand48_data *buffer)
+{
+ /* Store the given values. */
+ memcpy (buffer->__x, ¶m[0], sizeof (buffer->__x));
+ buffer->__a = ((uint64_t) param[5] << 32 | (uint32_t) param[4] << 16 | param[3]);
+ buffer->__c = param[6];
+ buffer->__init = 1;
+
+ return 0;
+}
+# ifdef __USE_MISC
+strong_alias(__lcong48_r,lcong48_r)
+# endif
+
+void lcong48 (unsigned short int param[7])
+{
+ (void) __lcong48_r (param, &__libc_drand48_data);
+}
+#endif
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit future] stdlib.c: remove comment about _Exit,
it is provided in _exit.c
Message-ID: <20110412203911.1DE7B825A1@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=11e8ad9c4d2242631ff7694b290b9e3951403305
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
Signed-off-by: Peter S. Mazinger
---
libc/stdlib/stdlib.c | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)
diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c
index 6ce04e1..98c202e 100644
--- a/libc/stdlib/stdlib.c
+++ b/libc/stdlib/stdlib.c
@@ -659,16 +659,7 @@ unsigned long long attribute_hidden __XL_NPP(_stdlib_strto_ll)(register const Wc
#endif /* defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) */
#endif
-/**********************************************************************/
-/* Made _Exit() an alias for _exit(), as per C99. */
-/* #ifdef L__Exit */
-/* void _Exit(int status) */
-/* { */
-/* _exit(status); */
-/* } */
-
-/* #endif */
-/**********************************************************************/
+
#ifdef L_bsearch
void *bsearch(const void *key, const void *base, size_t /* nmemb */ high,
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] use _dl_pagesize and _dl_stack_end from ldso
in other libs
Message-ID: <20110412203911.BD155825A1@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=c360cf016f11484f85f21f9ef40979ab1f30ea34
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Export __libc_stack_end only on ppc (see ldsodefs.h for details)
Signed-off-by: Peter S. Mazinger
---
ldso/include/ldsodefs.h | 12 ++++++------
ldso/ldso/dl-startup.c | 8 ++------
ldso/ldso/ldso.c | 3 ++-
libc/misc/internals/__uClibc_main.c | 14 ++++++++++++--
libpthread/linuxthreads/attr.c | 4 ++--
libpthread/nptl/init.c | 2 +-
libpthread/nptl/pthread_getattr_np.c | 4 ++--
7 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/ldso/include/ldsodefs.h b/ldso/include/ldsodefs.h
index bf6f3b1..8afddc0 100644
--- a/ldso/include/ldsodefs.h
+++ b/ldso/include/ldsodefs.h
@@ -257,15 +257,15 @@ struct rtld_global
struct rtld_global_ro
{
#endif
-#ifdef SHARED
/* Store the page size for later use */
- size_t _dl_pagesize;
+ EXTERN size_t _dl_pagesize;
/* Variable pointing to the end of the stack (or close to it). This value
must be constant over the runtime of the application. Some programs
might use the variable which results in copy relocations on some
platforms. But this does not matter, ld.so can always use the local
copy. */
- void *_dl_stack_end;
+ EXTERN void *_dl_stack_end;
+#ifdef SHARED
/* We add a function table to _rtld_global_ro which is then used to
call the function instead of going through the PLT. The result
is that we can avoid exporting the functions and we do not jump
@@ -373,10 +373,10 @@ extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb) internal_function a
might use the variable which results in copy relocations on some
platforms. But this does not matter, ld.so can always use the local
copy. */
-/* gcc uses it in rs6000/linux-unwind.c, could be patched to use
- * _dl_stack_end from the structure */
+/* gcc uses it in rs6000/linux-unwind.h, ckecked up to 4.5.2
+ * could be patched to use _dl_stack_end from the structure */
/* gcc's boehm-gc has fallback if not found */
-#if 1 /*!defined SHARED || (defined IS_IN_rtld && defined __powerpc__)*/
+#if defined IS_IN_rtld && defined __powerpc__
extern void *__libc_stack_end attribute_relro;
#endif
diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c
index 76826ed..78bed69 100644
--- a/ldso/ldso/dl-startup.c
+++ b/ldso/ldso/dl-startup.c
@@ -100,11 +100,6 @@ static __attribute_used__ unsigned long _dl_skip_args = 0;
/* Static declarations */
static int (*_dl_elf_main) (int, char **, char **);
-#if 1 /*def __powerpc__*/
-/* see ldsodefs.h why only for ppc */
-void * __libc_stack_end attribute_relro = NULL; /* Points to argc on stack, e.g. *((long *)__libc_stack_end) == argc */
-#endif
-
/* When we enter this piece of code, the program stack looks like this:
argc argument counter (integer)
argv[0] program name (pointer)
@@ -325,7 +320,8 @@ DL_START(unsigned long args)
since the dynamic resolver is not yet ready. */
GLRO(dl_stack_end) = (void *)(argv - 1);
-#if 1 /*def __powerpc__*/
+#ifdef __powerpc__
+ /* see ldsodefs.h why only for ppc */
__libc_stack_end = GLRO(dl_stack_end);
#endif
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 49c14a1..142de79 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -54,7 +54,8 @@ struct rtld_global _rtld_global =
struct rtld_global_ro _rtld_global_ro attribute_relro =
{
- ._dl_pagesize = 0
+ ._dl_pagesize = 0,
+ ._dl_stack_end = NULL
#ifdef SHARED
, ._dl_run_init_array = _dl_run_init_array,
._dl_run_fini_array = _dl_run_fini_array,
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 0783c26..4bdc9ea 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -42,7 +42,7 @@
#include
#ifndef SHARED
-void *__libc_stack_end attribute_relro = NULL;
+void *_dl_stack_end attribute_relro = NULL;
# ifdef __UCLIBC_HAS_SSP__
# include
@@ -217,9 +217,13 @@ void __uClibc_init(void)
if (__pagesize)
return;
+#ifdef SHARED
+ __pagesize = GLRO(dl_pagesize);
+#else
/* Setup an initial value. This may not be perfect, but is
* better than malloc using __pagesize=0 for atexit, ctors, etc. */
__pagesize = PAGE_SIZE;
+#endif
#ifdef __UCLIBC_HAS_THREADS__
/* Before we start initializing uClibc we have to call
@@ -318,7 +322,10 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,
#endif
#ifndef SHARED
- __libc_stack_end = stack_end;
+ GLRO(dl_stack_end) = stack_end;
+# ifdef __powerpc__
+ __libc_stack_end = GLRO(dl_stack_end);
+# endif
#endif
__rtld_fini = rtld_fini;
@@ -363,7 +370,10 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,
#ifndef __ARCH_HAS_NO_LDSO__
/* Make certain getpagesize() gives the correct answer */
+# ifndef SHARED
+ /* for SHARED this was already set in __uClibc_init() */
__pagesize = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;
+# endif
/* Prevent starting SUID binaries where the stdin. stdout, and
* stderr file descriptors are not already opened. */
diff --git a/libpthread/linuxthreads/attr.c b/libpthread/linuxthreads/attr.c
index 313d850..f142675 100644
--- a/libpthread/linuxthreads/attr.c
+++ b/libpthread/linuxthreads/attr.c
@@ -435,8 +435,8 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
uintptr_t to;
if (sscanf (line, "%" SCNxPTR "-%" SCNxPTR, &from, &to) != 2)
continue;
- if (from <= (uintptr_t) __libc_stack_end
- && (uintptr_t) __libc_stack_end < to)
+ if (from <= (uintptr_t) GLRO(dl_stack_end)
+ && (uintptr_t) GLRO(dl_stack_end) < to)
{
/* Found the entry. Now we have the info we need. */
attr->__stacksize = rl.rlim_cur;
diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c
index 379c4bb..6dbe975 100644
--- a/libpthread/nptl/init.c
+++ b/libpthread/nptl/init.c
@@ -342,7 +342,7 @@ __pthread_initialize_minimal_internal (void)
/* Set initial thread's stack block from 0 up to __libc_stack_end.
It will be bigger than it actually is, but for unwind.c/pt-longjmp.c
purposes this is good enough. */
- THREAD_SETMEM (pd, stackblock_size, (size_t) __libc_stack_end);
+ THREAD_SETMEM (pd, stackblock_size, (size_t) GLRO(dl_stack_end));
/* Initialize the list of all running threads with the main thread. */
INIT_LIST_HEAD (&__stack_user);
diff --git a/libpthread/nptl/pthread_getattr_np.c b/libpthread/nptl/pthread_getattr_np.c
index 86a4385..3635aef 100644
--- a/libpthread/nptl/pthread_getattr_np.c
+++ b/libpthread/nptl/pthread_getattr_np.c
@@ -105,8 +105,8 @@ pthread_getattr_np (
uintptr_t to;
if (sscanf (line, "%" SCNxPTR "-%" SCNxPTR, &from, &to) != 2)
continue;
- if (from <= (uintptr_t) __libc_stack_end
- && (uintptr_t) __libc_stack_end < to)
+ if (from <= (uintptr_t) GLRO(dl_stack_end)
+ && (uintptr_t) GLRO(dl_stack_end) < to)
{
/* Found the entry. Now we have the info we need. */
iattr->stacksize = rl.rlim_cur;
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit future] _exit.c: add ABORT_INSTRUCTION
Message-ID: <20110412203911.47B51825A1@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=3c84dc1ede65aaca391a229b96693526bc748aba
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
Warn if the arch has no __UCLIBC_ABORT_INSTRUCTION__.
Run only one syscall, exit_group is not an exclusivity, use it if THREADS are enabled.
Guard according header.
Signed-off-by: Peter S. Mazinger
---
libc/sysdeps/linux/common/_exit.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/libc/sysdeps/linux/common/_exit.c b/libc/sysdeps/linux/common/_exit.c
index 2196a98..c9e73c5 100644
--- a/libc/sysdeps/linux/common/_exit.c
+++ b/libc/sysdeps/linux/common/_exit.c
@@ -10,17 +10,33 @@
#include
#include
#include
+#include
+
+#ifdef __UCLIBC_ABORT_INSTRUCTION__
+# define ABORT_INSTRUCTION __asm__(__UCLIBC_ABORT_INSTRUCTION__)
+#else
+# warning "no abort instruction defined for this arch"
+#endif
+
+/* have to check for kernel 2.5.35 too, since NR was earlier present */
+#if defined __NR_exit_group && __LINUX_KERNEL_VERSION >= 0x020600 \
+ && defined __UCLIBC_HAS_THREADS__
+# undef __NR_exit
+# define __NR_exit __NR_exit_group
+#endif
void _exit(int status)
{
/* The loop is added only to keep gcc happy. */
while(1)
{
-#if defined __NR_exit_group && defined __UCLIBC_HAS_THREADS_NATIVE__
- INLINE_SYSCALL(exit_group, 1, status);
-#endif
INLINE_SYSCALL(exit, 1, status);
+#ifdef ABORT_INSTRUCTION
+ ABORT_INSTRUCTION;
+#endif
}
}
libc_hidden_def(_exit)
+#ifdef __USE_ISOC99
weak_alias(_exit,_Exit)
+#endif
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] getpt.c: no need for hidden posix_openpt
Message-ID: <20110412204019.45AA5825A1@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=3981a59eb3efd3af78f4bc7379aec80e0d0275bd
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Prefer static inline instead of hidden (__bsd_getpt)
Signed-off-by: Peter S. Mazinger
Patch is too large, so refusing to show it
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] stdlib.c: remove comment about _Exit,
it is provided in _exit.c
Message-ID: <20110412204020.22277825A1@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=11e8ad9c4d2242631ff7694b290b9e3951403305
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
libc/stdlib/stdlib.c | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)
diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c
index 6ce04e1..98c202e 100644
--- a/libc/stdlib/stdlib.c
+++ b/libc/stdlib/stdlib.c
@@ -659,16 +659,7 @@ unsigned long long attribute_hidden __XL_NPP(_stdlib_strto_ll)(register const Wc
#endif /* defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) */
#endif
-/**********************************************************************/
-/* Made _Exit() an alias for _exit(), as per C99. */
-/* #ifdef L__Exit */
-/* void _Exit(int status) */
-/* { */
-/* _exit(status); */
-/* } */
-
-/* #endif */
-/**********************************************************************/
+
#ifdef L_bsearch
void *bsearch(const void *key, const void *base, size_t /* nmemb */ high,
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] add lcong48[_r]
Message-ID: <20110412204019.9A262825A1@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=46374dd9effb20c13e26f70e23f269c14e551cee
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
libc/stdlib/Makefile.in | 2 +-
libc/stdlib/lcong48.c | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletions(-)
create mode 100644 libc/stdlib/lcong48.c
diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in
index 760ccf7..4407d63 100644
--- a/libc/stdlib/Makefile.in
+++ b/libc/stdlib/Makefile.in
@@ -15,7 +15,7 @@ CSRC-y := \
abort.c getenv.c mkdtemp.c realpath.c canonicalize.c mkstemp.c \
rand.c random.c random_r.c setenv.c div.c ldiv.c lldiv.c \
getpt.c drand48-iter.c jrand48.c \
- jrand48_r.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
+ jrand48_r.c lcong48.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
nrand48_r.c rand_r.c srand48.c srand48_r.c seed48.c seed48_r.c \
valloc.c a64l.c l64a.c __uc_malloc.c
CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_memalign.c
diff --git a/libc/stdlib/lcong48.c b/libc/stdlib/lcong48.c
new file mode 100644
index 0000000..06cab66
--- /dev/null
+++ b/libc/stdlib/lcong48.c
@@ -0,0 +1,29 @@
+/* vi: set sw=4 ts=4: */
+/* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */
+
+#include
+
+#if defined __USE_SVID || defined __USE_XOPEN
+#include
+#include
+#include
+
+static int __lcong48_r (unsigned short int param[7], struct drand48_data *buffer)
+{
+ /* Store the given values. */
+ memcpy (buffer->__x, ¶m[0], sizeof (buffer->__x));
+ buffer->__a = ((uint64_t) param[5] << 32 | (uint32_t) param[4] << 16 | param[3]);
+ buffer->__c = param[6];
+ buffer->__init = 1;
+
+ return 0;
+}
+# ifdef __USE_MISC
+strong_alias(__lcong48_r,lcong48_r)
+# endif
+
+void lcong48 (unsigned short int param[7])
+{
+ (void) __lcong48_r (param, &__libc_drand48_data);
+}
+#endif
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] hppa/bits/atomic.h: include errno.h to get
EFAULT/ENOSYS
Message-ID: <20110412204019.E0A2F825A1@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=09ccda6c11a2a424abe1f1488667a76392ee557e
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Signed-off-by: Peter S. Mazinger
---
libc/sysdeps/linux/hppa/bits/atomic.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libc/sysdeps/linux/hppa/bits/atomic.h b/libc/sysdeps/linux/hppa/bits/atomic.h
index 87aeb84..08a7c3e 100644
--- a/libc/sysdeps/linux/hppa/bits/atomic.h
+++ b/libc/sysdeps/linux/hppa/bits/atomic.h
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include
+#include
#include
#define ABORT_INSTRUCTION __asm__(__UCLIBC_ABORT_INSTRUCTION__)
--
1.7.3.4
From ps.m at gmx.net Mon Apr 11 11:27:03 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Mon, 11 Apr 2011 13:27:03 +0200
Subject: [git commit ldso-future] _exit.c: add ABORT_INSTRUCTION
Message-ID: <20110412204020.7092E825A1@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=3c84dc1ede65aaca391a229b96693526bc748aba
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future
Warn if the arch has no __UCLIBC_ABORT_INSTRUCTION__.
Run only one syscall, exit_group is not an exclusivity, use it if THREADS are enabled.
Guard according header.
Signed-off-by: Peter S. Mazinger
---
libc/sysdeps/linux/common/_exit.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/libc/sysdeps/linux/common/_exit.c b/libc/sysdeps/linux/common/_exit.c
index 2196a98..c9e73c5 100644
--- a/libc/sysdeps/linux/common/_exit.c
+++ b/libc/sysdeps/linux/common/_exit.c
@@ -10,17 +10,33 @@
#include
#include
#include
+#include
+
+#ifdef __UCLIBC_ABORT_INSTRUCTION__
+# define ABORT_INSTRUCTION __asm__(__UCLIBC_ABORT_INSTRUCTION__)
+#else
+# warning "no abort instruction defined for this arch"
+#endif
+
+/* have to check for kernel 2.5.35 too, since NR was earlier present */
+#if defined __NR_exit_group && __LINUX_KERNEL_VERSION >= 0x020600 \
+ && defined __UCLIBC_HAS_THREADS__
+# undef __NR_exit
+# define __NR_exit __NR_exit_group
+#endif
void _exit(int status)
{
/* The loop is added only to keep gcc happy. */
while(1)
{
-#if defined __NR_exit_group && defined __UCLIBC_HAS_THREADS_NATIVE__
- INLINE_SYSCALL(exit_group, 1, status);
-#endif
INLINE_SYSCALL(exit, 1, status);
+#ifdef ABORT_INSTRUCTION
+ ABORT_INSTRUCTION;
+#endif
}
}
libc_hidden_def(_exit)
+#ifdef __USE_ISOC99
weak_alias(_exit,_Exit)
+#endif
--
1.7.3.4
From rep.dot.nop at gmail.com Wed Apr 13 08:26:38 2011
From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer)
Date: Wed, 13 Apr 2011 10:26:38 +0200
Subject: [git commit] resolv: fix res_close not to hang with ipv6
Message-ID: <20110413082920.3D09B825CB@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=c277cc3c99a2499183fed84cdeb25c45a06f141d
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master
Timo Ter?s writes:
The memory release loop is missing an obvious counter increment.
Signed-off-by: Bernhard Reutner-Fischer
---
libc/inet/resolv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 47bab75..05a1335 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -3008,7 +3008,7 @@ void res_close(void)
char *p1 = (char*) &(_res.nsaddr_list[0]);
int m = 0;
/* free nsaddrs[m] if they do not point to nsaddr_list[x] */
- while (m < ARRAY_SIZE(_res._u._ext.nsaddrs)) {
+ while (m++ < ARRAY_SIZE(_res._u._ext.nsaddrs)) {
char *p2 = (char*)(_res._u._ext.nsaddrs[m]);
if (p2 < p1 || (p2 - p1) > sizeof(_res.nsaddr_list))
free(p2);
--
1.7.3.4
From rep.dot.nop at gmail.com Wed Apr 13 08:26:38 2011
From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer)
Date: Wed, 13 Apr 2011 10:26:38 +0200
Subject: [git commit] buildsys: do not use $(and)
Message-ID: <20110413082920.A4F2C825CB@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=7da4d1e7553a766f2ddc6a9a7d36423c1cf68a80
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master
make-3.80 does not have $(and) and $(or), so workaround for now.
Signed-off-by: Bernhard Reutner-Fischer
---
Rules.mak | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Rules.mak b/Rules.mak
index 0aa6843..49ca207 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -531,7 +531,7 @@ ifdef LD_FLAG_NO_ASNEEDED
export CC_FLAG_NO_ASNEEDED:=-Wl,$(LD_FLAG_NO_ASNEEDED)
endif
endif
-link.asneeded = $(if $(and $(CC_FLAG_ASNEEDED),$(CC_FLAG_NO_ASNEEDED)),$(CC_FLAG_ASNEEDED) $(1) $(CC_FLAG_NO_ASNEEDED))
+link.asneeded = $(if $(findstring yy,$(CC_FLAG_ASNEEDED)$(CC_FLAG_NO_ASNEEDED)),$(CC_FLAG_ASNEEDED) $(1) $(CC_FLAG_NO_ASNEEDED))
# Check for AS_NEEDED support in linker script (binutils>=2.16.1 has it)
ifndef ASNEEDED
--
1.7.3.4
From carmelo73 at gmail.com Wed Apr 13 12:44:27 2011
From: carmelo73 at gmail.com (Carmelo Amoroso)
Date: Wed, 13 Apr 2011 14:44:27 +0200
Subject: [git commit] resolv: fix res_close not to hang with ipv6
In-Reply-To: <20110413082920.3D09B825CB@busybox.osuosl.org>
References: <20110413082920.3D09B825CB@busybox.osuosl.org>
Message-ID: <4DA59AAB.2030400@gmail.com>
On 13/04/11 10:26, Bernhard Reutner-Fischer wrote:
>
> commit: http://git.uclibc.org/uClibc/commit/?id=c277cc3c99a2499183fed84cdeb25c45a06f141d
> branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master
>
> Timo Ter?s writes:
> The memory release loop is missing an obvious counter increment.
>
> Signed-off-by: Bernhard Reutner-Fischer
> ---
> libc/inet/resolv.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
> index 47bab75..05a1335 100644
> --- a/libc/inet/resolv.c
> +++ b/libc/inet/resolv.c
> @@ -3008,7 +3008,7 @@ void res_close(void)
> char *p1 = (char*) &(_res.nsaddr_list[0]);
> int m = 0;
> /* free nsaddrs[m] if they do not point to nsaddr_list[x] */
> - while (m < ARRAY_SIZE(_res._u._ext.nsaddrs)) {
> + while (m++ < ARRAY_SIZE(_res._u._ext.nsaddrs)) {
> char *p2 = (char*)(_res._u._ext.nsaddrs[m]);
> if (p2 < p1 || (p2 - p1) > sizeof(_res.nsaddr_list))
> free(p2);
Just noted that the git commit subject does not specifies he head (master,prelink, future etc) as before.
It was a nice feature.
Carmelo
From rep.dot.nop at gmail.com Wed Apr 13 17:38:40 2011
From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer)
Date: Wed, 13 Apr 2011 19:38:40 +0200
Subject: [git commit] resolv: really fix res_close not to hang with ipv6
Message-ID: <20110413173905.A34B08255C@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=d37cda884e573638aa3fafcb7505d733cf8d9eae
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master
Fix goof in previous commit.
Signed-off-by: Bernhard Reutner-Fischer
---
libc/inet/resolv.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 05a1335..021d5bf 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -3008,8 +3008,8 @@ void res_close(void)
char *p1 = (char*) &(_res.nsaddr_list[0]);
int m = 0;
/* free nsaddrs[m] if they do not point to nsaddr_list[x] */
- while (m++ < ARRAY_SIZE(_res._u._ext.nsaddrs)) {
- char *p2 = (char*)(_res._u._ext.nsaddrs[m]);
+ while (m < ARRAY_SIZE(_res._u._ext.nsaddrs)) {
+ char *p2 = (char*)(_res._u._ext.nsaddrs[m++]);
if (p2 < p1 || (p2 - p1) > sizeof(_res.nsaddr_list))
free(p2);
}
--
1.7.3.4
From rep.dot.nop at gmail.com Thu Apr 14 16:05:17 2011
From: rep.dot.nop at gmail.com (Bernhard Reutner-Fischer)
Date: Thu, 14 Apr 2011 18:05:17 +0200
Subject: [git commit] resolv: fix res_close not to hang with ipv6
In-Reply-To: <4DA59AAB.2030400@gmail.com>
References: <20110413082920.3D09B825CB@busybox.osuosl.org>
<4DA59AAB.2030400@gmail.com>
Message-ID:
Carmelo Amoroso wrote:
>On 13/04/11 10:26, Bernhard Reutner-Fischer wrote:
>>
>Just noted that the git commit subject does not specifies he head
>(master,prelink, future etc) as before.
>It was a nice feature.
Hm, master was never prefixed as opposed to branches. Are you sure that this does not work for branches anymore?
>
>Carmelo
>
>_______________________________________________
>uClibc-cvs mailing list
>uClibc-cvs at uclibc.org
>http://lists.busybox.net/mailman/listinfo/uclibc-cvs
From ps.m at gmx.net Wed Apr 13 17:38:40 2011
From: ps.m at gmx.net (Peter S. Mazinger)
Date: Wed, 13 Apr 2011 19:38:40 +0200
Subject: [git commit future] getgroups.c: reorganize,
include param.h instead of defining MIN
Message-ID: <20110414223530.3958982631@busybox.osuosl.org>
commit: http://git.uclibc.org/uClibc/commit/?id=804c1b0a31b2763d001841205dd6bac534201c76
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
Include only what is necessary.
Mark __syscall_getgroups __always_inline.
Signed-off-by: Peter S. Mazinger
---
libc/sysdeps/linux/common/getgroups.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/libc/sysdeps/linux/common/getgroups.c b/libc/sysdeps/linux/common/getgroups.c
index ddc2cae..87fecce 100644
--- a/libc/sysdeps/linux/common/getgroups.c
+++ b/libc/sysdeps/linux/common/getgroups.c
@@ -8,10 +8,7 @@
*/
#include
-#include
#include
-#include
-
#if defined(__NR_getgroups32)
# undef __NR_getgroups
@@ -22,12 +19,14 @@ _syscall2(int, getgroups, int, size, gid_t *, list)
_syscall2(int, getgroups, int, size, gid_t *, list)
#else
+# include