[dietlibc] rediffed

ensc ensc at fedoraproject.org
Fri Dec 24 12:25:56 UTC 2010


commit 1db3978d8feafa662065d06f9ed4add27e9bab0d
Author: Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
Date:   Fri Dec 24 13:22:00 2010 +0100

    rediffed

 dietlibc-0.31-no-stack-protector.patch |    8 ++--
 dietlibc-0.31-pagesize.patch           |   55 +++++++++++++++++---------------
 dietlibc-0.31-smp-fix.patch            |   24 +++++++------
 dietlibc-0.31-stackgap-minor.patch     |   12 +++---
 dietlibc-0.31-stacksmash.patch         |    8 ++--
 dietlibc-0.31-strip.patch              |   14 ++++----
 6 files changed, 63 insertions(+), 58 deletions(-)
---
diff --git a/dietlibc-0.31-no-stack-protector.patch b/dietlibc-0.31-no-stack-protector.patch
index 18eaf12..4f82c4c 100644
--- a/dietlibc-0.31-no-stack-protector.patch
+++ b/dietlibc-0.31-no-stack-protector.patch
@@ -1,4 +1,4 @@
-From f49499c7c3a6791249588ab4863d6e9eb1ba1010 Mon Sep 17 00:00:00 2001
+From 114b8b213688bfe34755d5d419dce287347a87b5 Mon Sep 17 00:00:00 2001
 From: Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
 Date: Sat, 28 Feb 2009 13:32:45 +0100
 Subject: [PATCH 04/18] Build some files without stack-protector
@@ -8,7 +8,7 @@ Subject: [PATCH 04/18] Build some files without stack-protector
  1 files changed, 4 insertions(+), 0 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index dc23d1a..ec97fe9 100644
+index 7186116..c274e3a 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -129,6 +129,8 @@ LIBPTHREAD_OBJS=$(patsubst libpthread/%.c,$(OBJDIR)/%.o,$(shell ./threadsafe.sh)
@@ -20,7 +20,7 @@ index dc23d1a..ec97fe9 100644
  include $(ARCH)/Makefile.add
  
  LIBMATHOBJ=$(patsubst %,$(OBJDIR)/%,$(LIBMATH))
-@@ -177,6 +179,8 @@ $(OBJDIR)/pthread_%.o: libpthread/pthread_%.c $(OBJDIR)/.dirstamp
+@@ -178,6 +180,8 @@ $(OBJDIR)/pthread_%.o: libpthread/pthread_%.c $(OBJDIR)/.dirstamp
  $(OBJDIR)/%.o: %.c $(OBJDIR)/.dirstamp
  	$(CROSS)$(CC) $(INC) $(CFLAGS) -c $< -o $@ -D__dietlibc__
  	$(COMMENT) -$(STRIP) -x -R .comment -R .note $@
@@ -30,5 +30,5 @@ index dc23d1a..ec97fe9 100644
  
  ifeq ($(shell $(CC) -v 2>&1 | grep "gcc version"),gcc version 4.0.0)
 -- 
-1.6.2.5
+1.7.3.3
 
diff --git a/dietlibc-0.31-pagesize.patch b/dietlibc-0.31-pagesize.patch
index 92b89d5..7bba7fb 100644
--- a/dietlibc-0.31-pagesize.patch
+++ b/dietlibc-0.31-pagesize.patch
@@ -1,4 +1,4 @@
-From e6aa8f40136da35a259bcc92026aa2c8f0c935ff Mon Sep 17 00:00:00 2001
+From abcbc90e768b431ce4e063de8a47ab236feeacf5 Mon Sep 17 00:00:00 2001
 From: Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
 Date: Sat, 19 Apr 2008 17:35:14 +0200
 Subject: [PATCH 11/18] Support for dynamic PAGE_SIZE
@@ -82,7 +82,7 @@ use a type derived from __WORD_SIZE.
  lib/opendir.c             |    4 ++-
  lib/readdir.c             |    2 +-
  lib/readdir64.c           |    6 ++--
- lib/stackgap.c            |   28 +++++++++++++++-
+ lib/stackgap.c            |   31 +++++++++++++++++-
  libcruft/getpagesize.c    |   28 +++++++--------
  libcruft/sysconf.c        |   17 +++++++---
  mips/start.S              |    9 +++++
@@ -99,7 +99,7 @@ use a type derived from __WORD_SIZE.
  test/runtests.sh          |    2 +-
  test/sysconf.c            |   80 +++++++++++++++++++++++++++++++++++++++++++++
  x86_64/start.S            |   16 +++++++++
- 34 files changed, 400 insertions(+), 51 deletions(-)
+ 34 files changed, 403 insertions(+), 51 deletions(-)
  create mode 100644 dietelfinfo.h
  create mode 100644 dietpagesize.h
  create mode 100644 lib/__get_elf_aux_value.c
@@ -198,10 +198,10 @@ index 0000000..de8c717
 +	__attribute__((__visibility__("hidden"),__const__)) __pure;
 +#endif
 diff --git a/dietfeatures.h b/dietfeatures.h
-index 7ba02ec..ab892d6 100644
+index dcdda39..0d44425 100644
 --- a/dietfeatures.h
 +++ b/dietfeatures.h
-@@ -119,6 +119,16 @@
+@@ -138,6 +138,16 @@
  #define WANT_SSP
  #endif
  
@@ -218,7 +218,7 @@ index 7ba02ec..ab892d6 100644
  
  
  /* stop uncommenting here ;-) */
-@@ -150,4 +160,8 @@
+@@ -169,4 +179,8 @@
  #endif
  #endif
  
@@ -505,42 +505,45 @@ index 924f0a8..06d073b 100644
        if (errno==ENOSYS) {
  	trygetdents64=0;
 diff --git a/lib/stackgap.c b/lib/stackgap.c
-index e974e2c..5d51c5d 100644
+index 3ba6954..98f6874 100644
 --- a/lib/stackgap.c
 +++ b/lib/stackgap.c
-@@ -6,6 +6,7 @@
- #include <endian.h>
+@@ -16,6 +16,7 @@
  #include <elf.h>
+ #include <stdlib.h>
  #include "dietfeatures.h"
 +#include "dietelfinfo.h"
  
- extern int main(int argc,char* argv[],char* envp[]);
- 
-@@ -30,6 +31,7 @@ static void findtlsdata(long* auxvec) {
+ #ifdef WANT_GNU_STARTUP_BLOAT
+ char* program_invocation_name;
+@@ -53,6 +54,7 @@ static void findtlsdata(long* auxvec) {
    Elf32_Phdr* x=0;
  #endif
-   size_t i,n;
+   size_t i,n=0;
 +#ifndef WANT_ELFINFO
    while (*auxvec) {
-     if (auxvec[0]==3) {
+     if (auxvec[0]==3) {	/* AT_PHDR */
        x=(void*)auxvec[1];
-@@ -37,6 +39,15 @@ static void findtlsdata(long* auxvec) {
+@@ -63,6 +65,18 @@ static void findtlsdata(long* auxvec) {
      }
      auxvec+=2;
    } /* if we don't find the entry, the kernel let us down */
 +#else
 +  {
 +    __diet_elf_addr_t const	*x_addr = __get_elf_aux_value(AT_PHDR);
++    __diet_elf_addr_t const	*n_addr = __get_elf_aux_value(AT_PHNUM);
 +
 +    (void)auxvec;
 +    if (x_addr)
 +      x = (__typeof__(x)) *x_addr;
++    if (n_addr)
++      n = *n_addr;
 +  }
 +#endif
-   if (!x) return;	/* a kernel this old does not support thread local storage anyway */
-   if (x->p_type!=PT_PHDR) return;	/* should start with PT_PHDR */
-   /* if it doesn't, assume there is no thread local storage */
-@@ -92,6 +103,7 @@ static void setup_tls(tcbhead_t* mainthread) {
+   if (!x || !n) return;	/* a kernel this old does not support thread local storage anyway */
+   for (i=0; i<n; ++i)
+     if (x[i].p_type==PT_TLS) {
+@@ -122,6 +136,7 @@ void __setup_tls(tcbhead_t* mainthread) {
  }
  #endif
  
@@ -548,7 +551,7 @@ index e974e2c..5d51c5d 100644
  static void* find_rand(long* x) {
    while (*x) {
      if (*x==25)
-@@ -100,20 +112,30 @@ static void* find_rand(long* x) {
+@@ -130,20 +145,30 @@ static void* find_rand(long* x) {
    }
    return NULL;
  }
@@ -580,18 +583,18 @@ index e974e2c..5d51c5d 100644
    if (!rand) {
      char myrand[10];
      int fd=open("/dev/urandom",O_RDONLY);
-@@ -134,7 +156,11 @@ int stackgap(int argc,char* argv[],char* envp[]) {
+@@ -164,7 +189,11 @@ int stackgap(int argc,char* argv[],char* envp[]) {
  #endif
  
- #if defined(WANT_SSP) || defined(WANT_TLS)
+ #ifdef WANT_TLS
 +#ifndef WANT_ELFINFO
    findtlsdata(auxvec);
 +#else
 +  findtlsdata(NULL);
 +#endif
-   tlsdata=alloca(__tmemsize+sizeof(tcbhead_t));
-   memcpy(tlsdata,__tdataptr,__tdatasize);
-   memset(tlsdata+__tdatasize,0,__tmemsize-__tdatasize);
+   if (__unlikely(__tmemsize+sizeof(tcbhead_t)<sizeof(tcbhead_t)) ||
+       __unlikely(__tmemsize>512*1024*1024) ||
+       __unlikely(__tmemsize<__tdatasize))
 diff --git a/libcruft/getpagesize.c b/libcruft/getpagesize.c
 index 5ff8973..ac701cf 100644
 --- a/libcruft/getpagesize.c
@@ -1047,5 +1050,5 @@ index adc461a..8b4f3c9 100644
  #ifdef PROFILING
  	pushq	%rdi			/* save reg args */
 -- 
-1.6.2.5
+1.7.3.3
 
diff --git a/dietlibc-0.31-smp-fix.patch b/dietlibc-0.31-smp-fix.patch
index d98a405..90cce1b 100644
--- a/dietlibc-0.31-smp-fix.patch
+++ b/dietlibc-0.31-smp-fix.patch
@@ -1,4 +1,4 @@
-From c1354c051ff98683508272385834d35198253542 Mon Sep 17 00:00:00 2001
+From 6d56724a14f6b490c4312368d0124310b8825b5c Mon Sep 17 00:00:00 2001
 From: Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
 Date: Sat, 25 Jul 2009 13:54:39 +0200
 Subject: [PATCH 02/18] Fixed SMP build
@@ -11,11 +11,11 @@ dependency for object files and executes an 'mkdir'.
 
 Ditto for $(PICODIR)
 ---
- Makefile |   42 +++++++++++++++++++++---------------------
- 1 files changed, 21 insertions(+), 21 deletions(-)
+ Makefile |   43 +++++++++++++++++++++----------------------
+ 1 files changed, 21 insertions(+), 22 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index adc2779..8009cb4 100644
+index 143113b..166c8a5 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -88,7 +88,7 @@ ILIBDIR=$(LIBDIR)-$(ARCH)
@@ -27,7 +27,7 @@ index adc2779..8009cb4 100644
  	$(OBJDIR)/dietlibc.a $(OBJDIR)/liblatin1.a \
  	$(OBJDIR)/libcompat.a $(OBJDIR)/libm.a \
  	$(OBJDIR)/librpc.a $(OBJDIR)/libpthread.a \
-@@ -150,30 +150,30 @@ PWD=$(shell pwd)
+@@ -150,32 +150,31 @@ PWD=$(shell pwd)
  # added real dynamic dietlibc.so
  PICODIR = pic-$(ARCH)
  
@@ -36,9 +36,11 @@ index adc2779..8009cb4 100644
 -
  % :: %,v
  
+-$(OBJDIR)/%.o: $(OBJDIR)
 +%/.dirstamp:
 +	mkdir $*
 +	@touch $@
+ 
  ifeq ($(CC),tcc)
 -$(OBJDIR)/%.o: %.S $(ARCH)/syscalls.h
 +$(OBJDIR)/%.o: %.S $(ARCH)/syscalls.h $(OBJDIR)/.dirstamp
@@ -67,7 +69,7 @@ index adc2779..8009cb4 100644
  	$(CROSS)$(CC) $(INC) $(CFLAGS) -c $< -o $@ -D__dietlibc__
  	$(COMMENT) -$(CROSS)strip -x -R .comment -R .note $@
  endif
-@@ -188,7 +188,7 @@ endif
+@@ -190,7 +189,7 @@ endif
  
  CC+=-D__dietlibc__
  
@@ -76,7 +78,7 @@ index adc2779..8009cb4 100644
  	$(CROSS)$(CC) $(INC) $(SAFER_CFLAGS) -c $< -o $@
  
  DIETLIBC_OBJ = $(OBJDIR)/unified.o \
-@@ -203,7 +203,7 @@ $(OBJDIR)/dietlibc.a: $(DIETLIBC_OBJ) $(OBJDIR)/start.o
+@@ -205,7 +204,7 @@ $(OBJDIR)/dietlibc.a: $(DIETLIBC_OBJ) $(OBJDIR)/start.o
  $(OBJDIR)/librpc.a: $(LIBRPCOBJ)
  	$(CROSS)ar cru $@ $(LIBRPCOBJ)
  
@@ -85,7 +87,7 @@ index adc2779..8009cb4 100644
  	touch dummy.c
  	$(CROSS)$(CC) -c dummy.c
  	$(CROSS)ar cru $@ dummy.o
-@@ -235,26 +235,26 @@ dyn: dyn_lib
+@@ -237,26 +236,26 @@ dyn: dyn_lib
  $(OBJDIR)/libdl.a: $(LIBDLOBJ)
  	$(CROSS)ar cru $@ $(LIBDLOBJ)
  
@@ -118,7 +120,7 @@ index adc2779..8009cb4 100644
  	$(CROSS)$(CC) $(INC) $(CFLAGS) -fPIC -D__DYN_LIB -D__DYN_LIB_SHARED -c $< -o $@
  	$(COMMENT) $(CROSS)strip -x -R .comment -R .note $@
  
-@@ -272,13 +272,13 @@ DYN_LIBCOMPAT_OBJS = $(patsubst $(OBJDIR)/%.o,$(PICODIR)/%.o,$(LIBCOMPATOBJ))
+@@ -274,13 +273,13 @@ DYN_LIBCOMPAT_OBJS = $(patsubst $(OBJDIR)/%.o,$(PICODIR)/%.o,$(LIBCOMPATOBJ))
  
  DYN_LIBMATH_OBJS = $(patsubst $(OBJDIR)/%.o,$(PICODIR)/%.o,$(LIBMATHOBJ))
  
@@ -134,7 +136,7 @@ index adc2779..8009cb4 100644
  	$(LD_UNSET) $(CROSS)$(CC) -D__OD_CLEAN_ROOM -DNODIETREF -fPIC -nostdlib -shared -Bsymbolic -Wl,-Bsymbolic \
  		-o $@ $(SAFE_CFLAGS) $(INC) libdl/_dl_main.c -Wl,-soname=libdl.so
  
-@@ -330,7 +330,7 @@ $(OBJDIR)/load:
+@@ -335,7 +334,7 @@ $(OBJDIR)/load:
  	chmod 755 $@
  
  clean:
@@ -144,5 +146,5 @@ index adc2779..8009cb4 100644
  	$(MAKE) -C examples clean
  	$(MAKE) -C dynlinker clean
 -- 
-1.6.2.5
+1.7.3.3
 
diff --git a/dietlibc-0.31-stackgap-minor.patch b/dietlibc-0.31-stackgap-minor.patch
index 201b721..ac9b4d0 100644
--- a/dietlibc-0.31-stackgap-minor.patch
+++ b/dietlibc-0.31-stackgap-minor.patch
@@ -1,4 +1,4 @@
-From b993cb8bebea6870771bb66eae8b6d41f9e6e9e6 Mon Sep 17 00:00:00 2001
+From ff124a1717fd6308da2f2f6eb0bd3837c4ba8d5a Mon Sep 17 00:00:00 2001
 From: Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
 Date: Sat, 25 Jul 2009 15:34:44 +0200
 Subject: [PATCH 17/18] minor cleanups in stackgap.c
@@ -8,10 +8,10 @@ Subject: [PATCH 17/18] minor cleanups in stackgap.c
  1 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/lib/stackgap.c b/lib/stackgap.c
-index 5d51c5d..f30b58a 100644
+index 98f6874..d4a505b 100644
 --- a/lib/stackgap.c
 +++ b/lib/stackgap.c
-@@ -26,9 +26,9 @@ void* __tdataptr;
+@@ -49,9 +49,9 @@ void* __tdataptr;
  
  static void findtlsdata(long* auxvec) {
  #if (__WORDSIZE == 64)
@@ -21,9 +21,9 @@ index 5d51c5d..f30b58a 100644
 -  Elf32_Phdr* x=0;
 +  Elf32_Phdr const * x=0;
  #endif
-   size_t i,n;
+   size_t i,n=0;
  #ifndef WANT_ELFINFO
-@@ -125,9 +125,9 @@ int stackgap(int argc,char* argv[],char* envp[]) {
+@@ -158,9 +158,9 @@ int stackgap(int argc,char* argv[],char* envp[]) {
  #endif
  #ifdef WANT_STACKGAP
    unsigned short s;
@@ -35,5 +35,5 @@ index 5d51c5d..f30b58a 100644
    rand=find_rand(auxvec);
  #else
 -- 
-1.6.2.5
+1.7.3.3
 
diff --git a/dietlibc-0.31-stacksmash.patch b/dietlibc-0.31-stacksmash.patch
index 894a0d4..9a56262 100644
--- a/dietlibc-0.31-stacksmash.patch
+++ b/dietlibc-0.31-stacksmash.patch
@@ -1,4 +1,4 @@
-From 6838387d66f76e8acb227102d46549a26e7b217c Mon Sep 17 00:00:00 2001
+From 06ee7369e5e24d23222c3f0f7ef949eaecd86cc4 Mon Sep 17 00:00:00 2001
 From: Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
 Date: Sat, 19 Apr 2008 17:56:07 +0200
 Subject: [PATCH 08/18] Enhanced __stack_chk_fail
@@ -15,10 +15,10 @@ Subject: [PATCH 08/18] Enhanced __stack_chk_fail
  2 files changed, 11 insertions(+), 2 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index ec97fe9..9ea5078 100644
+index c274e3a..575b138 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -175,9 +175,10 @@ $(OBJDIR)/%.o: %.S $(ARCH)/syscalls.h $(OBJDIR)/.dirstamp
+@@ -176,9 +176,10 @@ $(OBJDIR)/%.o: %.S $(ARCH)/syscalls.h $(OBJDIR)/.dirstamp
  $(OBJDIR)/pthread_%.o: libpthread/pthread_%.c $(OBJDIR)/.dirstamp
  	$(CROSS)$(CC) $(INC) $(CFLAGS) -c $< -o $@
  	$(COMMENT) -$(STRIP) -x -R .comment -R .note $@
@@ -50,5 +50,5 @@ index 9e85099..ecefeb8 100644
 +	  *(char *)0 = 0;
  }
 -- 
-1.6.2.5
+1.7.3.3
 
diff --git a/dietlibc-0.31-strip.patch b/dietlibc-0.31-strip.patch
index 3ceaaae..421d75d 100644
--- a/dietlibc-0.31-strip.patch
+++ b/dietlibc-0.31-strip.patch
@@ -1,4 +1,4 @@
-From 87682b6ad631272dfdc45e1c760331d803851c06 Mon Sep 17 00:00:00 2001
+From a3616a3e74164644dae72379224ce5bf70210734 Mon Sep 17 00:00:00 2001
 From: Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
 Date: Sat, 25 Jul 2009 15:12:43 +0200
 Subject: [PATCH 03/18] Define and use $(STRIP) makefile variable
@@ -10,7 +10,7 @@ of debug symbols.
  1 files changed, 11 insertions(+), 10 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index 8009cb4..dc23d1a 100644
+index 166c8a5..7186116 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -105,6 +105,7 @@ CROSS=
@@ -21,7 +21,7 @@ index 8009cb4..dc23d1a 100644
  
  VPATH=lib:libstdio:libugly:libcruft:libcrypt:libshell:liblatin1:libcompat:libdl:librpc:libregex:libm:profiling
  
-@@ -161,7 +162,7 @@ $(OBJDIR)/%.o: %.S $(ARCH)/syscalls.h $(OBJDIR)/.dirstamp
+@@ -162,7 +163,7 @@ $(OBJDIR)/%.o: %.S $(ARCH)/syscalls.h $(OBJDIR)/.dirstamp
  
  $(OBJDIR)/%.o: %.c $(OBJDIR)/.dirstamp
  	tcc -I. -Iinclude -c $< -o $@
@@ -30,7 +30,7 @@ index 8009cb4..dc23d1a 100644
  else
  $(OBJDIR)/pstart.o: start.S $(OBJDIR)/.dirstamp
  	$(CROSS)$(CC) $(INC) $(CFLAGS) -DPROFILING -c $< -o $@
-@@ -171,11 +172,11 @@ $(OBJDIR)/%.o: %.S $(ARCH)/syscalls.h $(OBJDIR)/.dirstamp
+@@ -172,11 +173,11 @@ $(OBJDIR)/%.o: %.S $(ARCH)/syscalls.h $(OBJDIR)/.dirstamp
  
  $(OBJDIR)/pthread_%.o: libpthread/pthread_%.c $(OBJDIR)/.dirstamp
  	$(CROSS)$(CC) $(INC) $(CFLAGS) -c $< -o $@
@@ -44,7 +44,7 @@ index 8009cb4..dc23d1a 100644
  endif
  
  ifeq ($(shell $(CC) -v 2>&1 | grep "gcc version"),gcc version 4.0.0)
-@@ -245,18 +246,18 @@ $(PICODIR)/%.o: %.S $(ARCH)/syscalls.h $(PICODIR)/.dirstamp
+@@ -246,18 +247,18 @@ $(PICODIR)/%.o: %.S $(ARCH)/syscalls.h $(PICODIR)/.dirstamp
  
  $(PICODIR)/pthread_%.o: libpthread/pthread_%.c $(PICODIR)/.dirstamp
  	$(CROSS)$(CC) $(INC) $(CFLAGS) -fPIC -D__DYN_LIB -c $< -o $@
@@ -66,7 +66,7 @@ index 8009cb4..dc23d1a 100644
  
  DYN_LIBC_PIC = $(LIBOBJ) $(LIBSTDIOOBJ) $(LIBUGLYOBJ) \
  $(LIBCRUFTOBJ) $(LIBCRYPTOBJ) $(LIBSHELLOBJ) $(LIBREGEXOBJ)
-@@ -305,19 +306,19 @@ CURNAME=$(notdir $(shell pwd))
+@@ -309,19 +310,19 @@ CURNAME=$(notdir $(shell pwd))
  
  $(OBJDIR)/diet: $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o diet.c $(OBJDIR)/dietlibc.a $(OBJDIR)/dyn_stop.o
  	$(CROSS)$(CC) -isystem include $(CFLAGS) -nostdlib -o $@ $^ -DDIETHOME=\"$(HOME)\" -DVERSION=\"$(VERSION)\" -lgcc
@@ -91,5 +91,5 @@ index 8009cb4..dc23d1a 100644
  $(OBJDIR)/djb: $(OBJDIR)/compile $(OBJDIR)/load
  
 -- 
-1.6.2.5
+1.7.3.3
 


More information about the scm-commits mailing list