#! /bin/sh -e # All lines beginning with `# DP:' are a description of the patch. # DP: Description: TLS fixes for xmms/nvidia crash # DP: Related bugs: #219352 # DP: Dpatch author: Jeff Bailey # DP: Patch author: # DP: Upstream status: In CVS # DP: Status Details: # DP: Date: 2005-03-22, 2005-04-16 updated by gotom PATCHLEVEL=1 if [ $# -ne 2 ]; then echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 fi case "$1" in -patch) patch -d "$2" -f --no-backup-if-mismatch -p$PATCHLEVEL < $0;; -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p$PATCHLEVEL < $0;; *) echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 esac exit 0 # append the patch here and adjust the -p? flag in the patch calls. 2005-03-15 Jakub Jelinek [BZ#786] * sysdeps/generic/dl-tls.c (_dl_next_tls_modid): Handle GL(dl_tls_static_nelem) == GL(dl_tls_max_dtv_idx). --- libc/sysdeps/generic/dl-tls.c.jj 2005-02-25 14:45:06.000000000 +0100 +++ libc/sysdeps/generic/dl-tls.c 2005-03-15 15:36:55.593127093 +0100 @@ -71,26 +71,24 @@ _dl_next_tls_modid (void) NB: the offset +1 is due to the fact that DTV[0] is used for something else. */ result = GL(dl_tls_static_nelem) + 1; - /* If the following would not be true we mustn't have assumed - there is a gap. */ - assert (result <= GL(dl_tls_max_dtv_idx)); - do - { - while (result - disp < runp->len) - { - if (runp->slotinfo[result - disp].map == NULL) - break; - - ++result; - assert (result <= GL(dl_tls_max_dtv_idx) + 1); - } - - if (result - disp < runp->len) - break; - - disp += runp->len; - } - while ((runp = runp->next) != NULL); + if (result <= GL(dl_tls_max_dtv_idx)) + do + { + while (result - disp < runp->len) + { + if (runp->slotinfo[result - disp].map == NULL) + break; + + ++result; + assert (result <= GL(dl_tls_max_dtv_idx) + 1); + } + + if (result - disp < runp->len) + break; + + disp += runp->len; + } + while ((runp = runp->next) != NULL); if (result > GL(dl_tls_max_dtv_idx)) {