summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2003-11-16 00:21:02 +0000
committerNed Ludd <solar@gentoo.org>2003-11-16 00:21:02 +0000
commit8df81f51948f7ba7739debf34deb853d799a232b (patch)
treecde68db2eae77b6221b47769809495d7820d7a23 /dev-libs/uclibc/files
parentversion bump, 0.9.22 was braindead.. In this release we continue support for ... (diff)
downloadgentoo-2-8df81f51948f7ba7739debf34deb853d799a232b.tar.gz
gentoo-2-8df81f51948f7ba7739debf34deb853d799a232b.tar.bz2
gentoo-2-8df81f51948f7ba7739debf34deb853d799a232b.zip
version bump, 0.9.22 was braindead.. In this release we continue support for PaX etdyn executabes thanks to the PaX Team and Peter S. Mazinger as well as add a small patch that was submited to the uClibc by Rob McMullen
Diffstat (limited to 'dev-libs/uclibc/files')
-rw-r--r--dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-etdyn.patch169
-rw-r--r--dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-flipturn.patch43
-rw-r--r--dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-pax.patch81
-rw-r--r--dev-libs/uclibc/files/digest-uclibc-0.9.231
4 files changed, 294 insertions, 0 deletions
diff --git a/dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-etdyn.patch b/dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-etdyn.patch
new file mode 100644
index 000000000000..f0e00371b63a
--- /dev/null
+++ b/dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-etdyn.patch
@@ -0,0 +1,169 @@
+diff -Nru uClibc-0.9.23/libc/misc/internals/Makefile uClibc-0.9.23-etdyn/libc/misc/internals/Makefile
+--- uClibc-0.9.23/libc/misc/internals/Makefile 2003-10-18 06:18:58.000000000 -0400
++++ uClibc-0.9.23-etdyn/libc/misc/internals/Makefile 2003-11-15 18:56:41.000000000 -0500
+@@ -47,6 +47,7 @@
+ interp.o: interp.c
+ $(CC) $(CFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
++ $(INSTALL) $@ $(TOPDIR)lib/
+
+ $(COBJS): %.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+diff -Nru uClibc-0.9.23/libc/sysdeps/linux/i386/Makefile uClibc-0.9.23-etdyn/libc/sysdeps/linux/i386/Makefile
+--- uClibc-0.9.23/libc/sysdeps/linux/i386/Makefile 2003-11-08 16:21:19.000000000 -0500
++++ uClibc-0.9.23-etdyn/libc/sysdeps/linux/i386/Makefile 2003-11-15 18:56:41.000000000 -0500
+@@ -25,6 +25,9 @@
+ CRT0_DEPS=gmon-start.S
+ CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
+
++CRT0S_SRC = crt0S.S
++CRT0S_OBJ = crt0S.o crt1S.o
++
+ SSRC=__longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \
+ bsd-_setjmp.S syscall.S mmap64.S
+ ifeq ($(strip $(UCLIBC_PROFILING)),y)
+@@ -49,14 +52,23 @@
+
+ $(LIBC): ar-target
+
+-ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
++ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) $(CRT0S_OBJ)
+ $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+ cp $(CRT0_OBJ) $(TOPDIR)lib/
++ifneq ($(strip $(UCLIBC_CTOR_DTOR)),y)
++ cp crt0S.o $(TOPDIR)lib/crt1S.o
++else
++ cp crt1S.o $(TOPDIR)lib/
++endif
+
+ $(CRT0_OBJ): $(CRT0_SRC)
+ $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+
++$(CRT0S_OBJ): $(CRT0S_SRC)
++ $(CC) $(CFLAGS) -fPIC -DL_$* $< -c -o $*.o
++ $(STRIPTOOL) -x -R .note -R .comment $*.o
++
+ $(SOBJS): %.o : %.S
+ $(CC) $(CFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+diff -Nru uClibc-0.9.23/libc/sysdeps/linux/i386/crt0S.S uClibc-0.9.23-etdyn/libc/sysdeps/linux/i386/crt0S.S
+--- uClibc-0.9.23/libc/sysdeps/linux/i386/crt0S.S 1969-12-31 19:00:00.000000000 -0500
++++ uClibc-0.9.23-etdyn/libc/sysdeps/linux/i386/crt0S.S 2003-11-15 19:01:04.000000000 -0500
+@@ -0,0 +1,116 @@
++/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
++This file is part of the GNU C Library.
++
++The GNU C Library is free software; you can redistribute it and/or
++modify it under the terms of the GNU Library General Public License as
++published by the Free Software Foundation; either version 2 of the
++License, or (at your option) any later version.
++
++The GNU C Library is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++Library General Public License for more details.
++
++You should have received a copy of the GNU Library General Public
++License along with the GNU C Library; see the file COPYING.LIB. If
++not, write to the Free Software Foundation, Inc., 675 Mass Ave,
++Cambridge, MA 02139, USA. */
++
++
++/* Based on the code from GNU libc, but hacked up by John Beppu and Erik Andersen */
++/* crt0.S adapted by Pax Team for ET_DYN binaries */
++
++/*
++ When we enter this piece of code, the program stack looks like this:
++ argc argument counter (integer)
++ argv[0] program name (pointer)
++ argv[1...N] program args (pointers)
++ argv[argc-1] end of args (integer)
++ NULL
++ env[0...N] environment variables (pointers)
++ NULL
++*/
++
++#include <features.h>
++
++.text
++ .align 4
++
++ .global _start
++ .type _start,%function
++#if defined L_crt0S || ! defined __UCLIBC_CTOR_DTOR__
++ .type __uClibc_main,%function
++#else
++ .weak _init
++ .weak _fini
++ .type __uClibc_start_main,%function
++#endif
++/* Stick in a dummy reference to main(), so that if an application
++ * is linking when the main() function is in a static library (.a)
++ * we can be sure that main() actually gets linked in */
++ .type main,%function
++
++_start:
++ /* locate the start of the environment variables */
++ popl %ecx /* Store argc into %ecx */
++ movl %esp,%ebx /* Store argv into ebx */
++ movl %esp,%eax /* Store argv into eax as well*/
++ movl %ecx,%edx /* Stick argc into %edx so we can do some math in a sec */
++ leal 4(%eax,%edx,4),%eax
++
++ /* [ register layout ]
++
++ sizeof(char*) == 4
++ %ecx = argc ; 0(esp)
++ %ebx = argv ; 4(esp)
++ %eax = env ; argv + (argc * 4) + 4
++ */
++
++ /* Set up an invalid (NULL return address, NULL frame pointer)
++ callers stack frame so anybody unrolling the stack knows where
++ to stop */
++ xorl %ebp,%ebp /* NULL */
++ pushl %ebp /* callers %cs */
++ pushl %ebp /* callers %eip (return address) */
++ pushl %ebp /* callers %ebp (frame pointer) */
++ movl %esp,%ebp /* mark callers stack frame as invalid */
++
++ call .L0
++.L0:
++ pop %edx
++ addl $_GLOBAL_OFFSET_TABLE_+[.-.L0],%edx
++
++#if (defined L_crt1S || defined L_gcrt1 ) && defined __UCLIBC_CTOR_DTOR__
++ /* Push .init and .fini arguments to __uClibc_start_main() on the stack */
++ pushl _fini@GOT(%edx)
++ pushl _init@GOT(%edx)
++
++ /* Push envp, argc, and argc arguments to __uClibc_start_main() on the stack */
++ pushl %eax /* Environment pointer */
++ pushl %ebx /* Argument pointer */
++ pushl %ecx /* And the argument count */
++
++ /* Ok, now run uClibc's main() -- shouldn't return */
++ pushl .hlt@GOT(%edx)
++ pushl __uClibc_start_main@GOT(%edx)
++ ret
++#else
++ /* Push envp, argc, and argc arguments to __uClibc_start_main() on the stack */
++ pushl %eax /* Environment pointer */
++ pushl %ebx /* Argument pointer */
++ pushl %ecx /* And the argument count */
++
++ pushl .hlt@GOT(%edx)
++ pushl __uClibc_main@GOT(%edx)
++ ret
++#endif
++
++ /* Crash if somehow `exit' returns anyways. */
++ hlt
++.size _start,.-_start
++
++/* We disable profiling in crt0S.S, because it introduces text relocations.
++#if defined L_gcrt1 && defined __UCLIBC_PROFILING__
++# include "./gmon-start.S"
++#endif
++*/
diff --git a/dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-flipturn.patch b/dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-flipturn.patch
new file mode 100644
index 000000000000..b58f8cb13db9
--- /dev/null
+++ b/dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-flipturn.patch
@@ -0,0 +1,43 @@
+diff -ur -x '*.[oa]' /tmp/uClibc-0.9.23/libc/misc/gnu/obstack.c /opt/src/buildroot/build_i386/uClibc-0.9.23/libc/misc/gnu/obstack.c
+--- libc/misc/gnu/obstack.c 2003-09-03 03:23:15.000000000 -0400
++++ /opt/src/buildroot/build_i386/uClibc-0.9.23/libc/misc/gnu/obstack.c 2003-11-14 14:06:19.000000000 -0500
+@@ -466,6 +466,7 @@
+ /* # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC */
+ # ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+ # include <libintl.h>
++# include <locale.h>
+ # ifndef _
+ # define _(Str) __dcgettext (NULL, Str, LC_MESSAGES)
+ # endif
+diff -ur -x '*.[oa]' /tmp/uClibc-0.9.23/libc/misc/wchar/Makefile /opt/src/buildroot/build_i386/uClibc-0.9.23/libc/misc/wchar/Makefile
+--- libc/misc/wchar/Makefile 2003-11-08 03:06:04.000000000 -0500
++++ /opt/src/buildroot/build_i386/uClibc-0.9.23/libc/misc/wchar/Makefile 2003-11-15 07:34:30.000000000 -0500
+@@ -30,7 +30,7 @@
+ __mbsnrtowcs.o __wcsnrtombs.o wcwidth.o wcswidth.o
+
+ #ifeq ($(UCLIBC_HAS_LOCALE),y)
+-# MOBJ1 += iconv.o
++ MOBJ1 += iconv.o
+ #endif
+
+ MSRC2= wstdio.c
+@@ -67,3 +67,6 @@
+ clean:
+ $(RM) *.[oa] *~ core #iconv.target
+
++
++.PHONY: print-%
++print-%: ; @ echo $* = $($*)
+diff -ur -x '*.[oa]' /tmp/uClibc-0.9.23/utils/ldconfig.c /opt/src/buildroot/build_i386/uClibc-0.9.23/utils/ldconfig.c
+--- utils/ldconfig.c 2003-11-06 17:38:46.000000000 -0500
++++ /opt/src/buildroot/build_i386/uClibc-0.9.23/utils/ldconfig.c 2003-11-14 19:00:30.000000000 -0500
+@@ -189,8 +189,7 @@
+ char buff[4096];
+
+ /* see if name is of the form libZ.so* */
+- if ((strncmp(name, "lib", 3) == 0 || strncmp(name, "ld-", 3) == 0) && \
+- name[strlen(name)-1] != '~' && (cp = strstr(name, ".so")))
++ if (name[strlen(name)-1] != '~' && (cp = strstr(name, ".so")))
+ {
+ /* find the start of the Vminor part, if any */
+ if (cp[3] == '.' && (cp2 = strchr(cp + 4, '.')))
diff --git a/dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-pax.patch b/dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-pax.patch
new file mode 100644
index 000000000000..be6600b8cb83
--- /dev/null
+++ b/dev-libs/uclibc/files/0.9.23/uClibc-0.9.23-pax.patch
@@ -0,0 +1,81 @@
+diff -Nurp -x sysdeps -x internals -x '*.a' -x '*swp' -x '*.so*' -x '*.o' -x '*progname*' -x include -x '*config*' uClibc-0.9.23/ldso/ldso/ldso.c uClibc-0.9.23-pax/ldso/ldso/ldso.c
+--- uClibc-0.9.23/ldso/ldso/ldso.c 2003-10-04 19:31:22.000000000 +0200
++++ uClibc-0.9.23-pax/ldso/ldso/ldso.c 2003-11-14 17:32:00.000000000 +0100
+@@ -371,6 +371,26 @@ LD_BOOT(unsigned long args)
+ app_tpnt = LD_MALLOC(sizeof(struct elf_resolve));
+ _dl_memset(app_tpnt, 0, sizeof(struct elf_resolve));
+
++ /* Find the runtime load address of the main executable, this may be
++ * different from what the ELF header says for ET_DYN/PIE executables.
++ */
++ {
++ ElfW(Phdr) *ppnt;
++ int i;
++
++ ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_ptr;
++ for (i = 0; i < auxvt[AT_PHNUM].a_un.a_val; i++, ppnt++)
++ if (ppnt->p_type == PT_PHDR) {
++ app_tpnt->loadaddr = (ElfW(Addr)) (auxvt[AT_PHDR].a_un.a_val - ppnt->p_vaddr);
++ break;
++ }
++ }
++
++#ifdef __SUPPORT_LD_DEBUG_EARLY__
++ SEND_STDERR("app_tpnt->loadaddr=");
++ SEND_ADDRESS_STDERR(app_tpnt->loadaddr, 1);
++#endif
++
+ /*
+ * This is used by gdb to locate the chain of shared libraries that are currently loaded.
+ */
+@@ -407,7 +427,7 @@ LD_BOOT(unsigned long args)
+ ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_ptr;
+ for (i = 0; i < auxvt[AT_PHNUM].a_un.a_val; i++, ppnt++)
+ if (ppnt->p_type == PT_DYNAMIC) {
+- dpnt = (Elf32_Dyn *) ppnt->p_vaddr;
++ dpnt = (Elf32_Dyn *) (ppnt->p_vaddr + app_tpnt->loadaddr);
+ while (dpnt->d_tag) {
+ #if defined(__mips__)
+ if (dpnt->d_tag == DT_MIPS_GOTSYM)
+@@ -501,8 +521,8 @@ LD_BOOT(unsigned long args)
+ ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_ptr;
+ for (i = 0; i < auxvt[AT_PHNUM].a_un.a_val; i++, ppnt++) {
+ if (ppnt->p_type == PT_LOAD && !(ppnt->p_flags & PF_W))
+- _dl_mprotect((void *) (ppnt->p_vaddr & PAGE_ALIGN),
+- (ppnt->p_vaddr & ADDR_ALIGN) +
++ _dl_mprotect((void *) ((ppnt->p_vaddr + app_tpnt->loadaddr) & PAGE_ALIGN),
++ ((ppnt->p_vaddr + app_tpnt->loadaddr) & ADDR_ALIGN) +
+ (unsigned long) ppnt->p_filesz,
+ PROT_READ | PROT_WRITE | PROT_EXEC);
+ }
+@@ -715,8 +735,8 @@ static void _dl_get_ready_to_run(struct
+ ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_ptr;
+ for (i = 0; i < auxvt[AT_PHNUM].a_un.a_val; i++, ppnt++) {
+ if (ppnt->p_type == PT_LOAD) {
+- if (ppnt->p_vaddr + ppnt->p_memsz > brk_addr)
+- brk_addr = ppnt->p_vaddr + ppnt->p_memsz;
++ if (ppnt->p_vaddr + app_tpnt->loadaddr + ppnt->p_memsz > brk_addr)
++ brk_addr = ppnt->p_vaddr + app_tpnt->loadaddr + ppnt->p_memsz;
+ }
+ if (ppnt->p_type == PT_DYNAMIC) {
+ #ifndef ALLOW_ZERO_PLTGOT
+@@ -725,8 +745,8 @@ static void _dl_get_ready_to_run(struct
+ continue;
+ #endif
+ /* OK, we have what we need - slip this one into the list. */
+- app_tpnt = _dl_add_elf_hash_table("", 0,
+- app_tpnt->dynamic_info, ppnt->p_vaddr, ppnt->p_filesz);
++ app_tpnt = _dl_add_elf_hash_table("", (char *)app_tpnt->loadaddr,
++ app_tpnt->dynamic_info, ppnt->p_vaddr + app_tpnt->loadaddr, ppnt->p_filesz);
+ _dl_loaded_modules->libtype = elf_executable;
+ _dl_loaded_modules->ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_ptr;
+ _dl_loaded_modules->n_phent = auxvt[AT_PHNUM].a_un.a_val;
+@@ -735,7 +755,7 @@ static void _dl_get_ready_to_run(struct
+ rpnt->dyn = _dl_loaded_modules;
+ app_tpnt->usage_count++;
+ app_tpnt->symbol_scope = _dl_symbol_tables;
+- lpnt = (unsigned long *) (app_tpnt->dynamic_info[DT_PLTGOT]);
++ lpnt = (unsigned long *) (app_tpnt->dynamic_info[DT_PLTGOT] + app_tpnt->loadaddr);
+ #ifdef ALLOW_ZERO_PLTGOT
+ if (lpnt)
+ #endif
diff --git a/dev-libs/uclibc/files/digest-uclibc-0.9.23 b/dev-libs/uclibc/files/digest-uclibc-0.9.23
new file mode 100644
index 000000000000..0d10281bfa8e
--- /dev/null
+++ b/dev-libs/uclibc/files/digest-uclibc-0.9.23
@@ -0,0 +1 @@
+MD5 42001a50d982d0f5d0c0e68e53c9d7a1 uClibc-0.9.23.tar.bz2 1571053