LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1014|回复: 11

glibc-2.2.5-2.patch 这个包在那里可以下载

[复制链接]
发表于 2003-1-12 21:54:54 | 显示全部楼层 |阅读模式
前面贴子的网址我上不去
还有那里可以下载
发表于 2003-1-12 22:02:38 | 显示全部楼层

  1. diff -Naur glibc-2.2.5/login/Makefile glibc-2.2.5-2/login/Makefile
  2. --- glibc-2.2.5/login/Makefile        Thu Jul  5 21:55:34 2001
  3. +++ glibc-2.2.5-2/login/Makefile        Tue May 28 17:58:59 2002
  4. @@ -52,10 +52,10 @@
  5.              $(resolvobjdir)/libresolv.a $(common-objpfx)libc.a
  6. endif

  7. -# pt_chown needs to be setuid root.
  8. +# pt_chown needs to be setuid 0.
  9. $(inst_libexecdir)/pt_chown: $(objpfx)pt_chown $(+force)
  10.         $(make-target-directory)
  11. -        -$(INSTALL_PROGRAM) -m 4755 -o root $< $@
  12. +        -$(INSTALL_PROGRAM) -m 4755 -o 0 $< $@

  13. # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
  14. # This ensures they will load libc.so for needed symbols if loaded by
  15. diff -Naur glibc-2.2.5/malloc/Makefile glibc-2.2.5-2/malloc/Makefile
  16. --- glibc-2.2.5/malloc/Makefile        Wed Aug 29 15:45:25 2001
  17. +++ glibc-2.2.5-2/malloc/Makefile        Tue May 28 17:58:59 2002
  18. @@ -56,7 +56,7 @@
  19. include ../Makeconfig

  20. # The Perl script to analyze the output of the mtrace functions.
  21. -ifneq ($(PERL),no)
  22. +ifneq (/usr/bin/perl,no)
  23. install-bin-script = mtrace
  24. generated = mtrace

  25. @@ -100,7 +100,7 @@

  26. ifeq (no,$(cross-compiling))
  27. ifeq (yes,$(build-shared))
  28. -ifneq ($(PERL),no)
  29. +ifneq (/usr/bin/perl,no)
  30. tests: $(objpfx)tst-mtrace.out
  31. $(objpfx)tst-mtrace.out: tst-mtrace.sh $(objpfx)tst-mtrace
  32.         $(SHELL) -e $< $(common-objpfx)
  33. @@ -113,7 +113,7 @@

  34. $(objpfx)mtrace: mtrace.pl
  35.         rm -f $@.new
  36. -        sed -e 's|@PERL@|$(PERL)|' -e 's|@XXX@|$(address-width)|' \
  37. +        sed -e 's|@PERL@|/usr/bin/perl|' -e 's|@XXX@|$(address-width)|' \
  38.             -e 's|@VERSION@|$(version)|' $^ > $@.new \
  39.         && rm -f $@ && mv $@.new $@ && chmod +x $@

  40. diff -uNr glibc-2.2.5.orig/iconv/skeleton.c glibc-2.2.5/iconv/skeleton.c
  41. --- glibc-2.2.5.orig/iconv/skeleton.c        2001-07-06 14:54:47.000000000 +1000
  42. +++ glibc-2.2.5/iconv/skeleton.c        2002-08-10 09:24:57.000000000 +1000
  43. @@ -193,15 +193,20 @@
  44.     character set we can define RESET_INPUT_BUFFER in a very fast way.  */
  45. #if !defined RESET_INPUT_BUFFER && !defined SAVE_RESET_STATE
  46. # if MIN_NEEDED_FROM == MAX_NEEDED_FROM && MIN_NEEDED_TO == MAX_NEEDED_TO
  47. -/* We have to use these `if's here since the compiler cannot know that
  48. -   (outbuf - outerr) is always divisible by MIN_NEEDED_TO.  */
  49. -#  define RESET_INPUT_BUFFER \
  50. -  if (MIN_NEEDED_FROM % MIN_NEEDED_TO == 0)                                      \
  51. -    *inptrp -= (outbuf - outerr) * (MIN_NEEDED_FROM / MIN_NEEDED_TO);              \
  52. -  else if (MIN_NEEDED_TO % MIN_NEEDED_FROM == 0)                              \
  53. -    *inptrp -= (outbuf - outerr) / (MIN_NEEDED_TO / MIN_NEEDED_FROM);              \
  54. -  else                                                                              \
  55. -    *inptrp -= ((outbuf - outerr) / MIN_NEEDED_TO) * MIN_NEEDED_FROM
  56. +/* We have to use these `#if's here since the compiler cannot know that
  57. +   (outbuf - outerr) is always divisible by MIN_NEEDED_TO.  We have to
  58. +   use preprocessor arithmetic and no C code because gcc 3.2 complains
  59. +   about division by zero even in obviously dead code.  */
  60. +#  if MIN_NEEDED_FROM % MIN_NEEDED_TO == 0
  61. +#   define RESET_INPUT_BUFFER \
  62. +  *inptrp -= (outbuf - outerr) * (MIN_NEEDED_FROM / MIN_NEEDED_TO)
  63. +#  elif MIN_NEEDED_TO % MIN_NEEDED_FROM == 0
  64. +#   define RESET_INPUT_BUFFER \
  65. +  *inptrp -= (outbuf - outerr) / (MIN_NEEDED_TO / MIN_NEEDED_FROM)
  66. +#  else
  67. +#   define RESET_INPUT_BUFFER \
  68. +  *inptrp -= ((outbuf - outerr) / MIN_NEEDED_TO) * MIN_NEEDED_FROM
  69. +#  endif
  70. # endif
  71. #endif

  72. diff -uNr glibc-2.2.5.orig/linuxthreads/signals.c glibc-2.2.5/linuxthreads/signals.c
  73. --- glibc-2.2.5.orig/linuxthreads/signals.c        2002-01-21 14:21:16.000000000 +1100
  74. +++ glibc-2.2.5/linuxthreads/signals.c        2002-08-10 09:24:57.000000000 +1000
  75. @@ -198,7 +198,7 @@
  76.          s != __pthread_sig_cancel &&
  77.          s != __pthread_sig_debug) {
  78.        sigdelset(&mask, s);
  79. -      if (sighandler[s].old == NULL ||
  80. +      if (sighandler[s].old == (arch_sighandler_t) SIG_ERR ||
  81.            sighandler[s].old == (arch_sighandler_t) SIG_DFL ||
  82.            sighandler[s].old == (arch_sighandler_t) SIG_IGN) {
  83.          sa.sa_handler = pthread_null_sighandler;
  84. diff -uNr glibc-2.2.5.orig/malloc/malloc.c glibc-2.2.5/malloc/malloc.c
  85. --- glibc-2.2.5.orig/malloc/malloc.c        2001-09-19 13:23:27.000000000 +1000
  86. +++ glibc-2.2.5/malloc/malloc.c        2002-08-10 09:24:57.000000000 +1000
  87. @@ -3795,14 +3795,26 @@
  88. {
  89.    arena *ar_ptr;
  90.    mchunkptr p, oldtop;
  91. -  INTERNAL_SIZE_T sz, csz, oldtopsize;
  92. +  INTERNAL_SIZE_T bytes, sz, csz, oldtopsize;
  93.    Void_t* mem;

  94. #if defined _LIBC || defined MALLOC_HOOKS
  95.    __malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, __const __malloc_ptr_t)) =
  96.      __malloc_hook;
  97. +
  98. +  /* size_t is unsigned so the behavior on overflow is defined.  */
  99. +    bytes = n * elem_size;
  100. +#define HALF_INTERNAL_SIZE_T \
  101. +  (((INTERNAL_SIZE_T) 1) << (8 * sizeof (INTERNAL_SIZE_T) / 2))
  102. +  if (__builtin_expect ((n | elem_size) >= HALF_INTERNAL_SIZE_T, 0)) {
  103. +    if (elem_size != 0 && bytes / elem_size != n) {
  104. +      __set_errno (ENOMEM);
  105. +      return 0;
  106. +    }
  107. +  }
  108. +
  109.    if (hook != NULL) {
  110. -    sz = n * elem_size;
  111. +    sz = bytes;
  112. #if defined __GNUC__ && __GNUC__ >= 2
  113.      mem = (*hook)(sz, RETURN_ADDRESS (0));
  114. #else
  115. @@ -3819,7 +3831,7 @@
  116.    }
  117. #endif

  118. -  if(request2size(n * elem_size, sz))
  119. +  if(request2size(bytes, sz))
  120.      return 0;
  121.    arena_get(ar_ptr, sz);
  122.    if(!ar_ptr)
  123. @@ -3862,7 +3874,7 @@
  124.      }
  125.      if (p == 0) return 0;
  126.    }
  127. -  mem = BOUNDED_N(chunk2mem(p), n * elem_size);
  128. +  mem = BOUNDED_N(chunk2mem(p), bytes);

  129.    /* Two optional cases in which clearing not necessary */

  130. diff -uNr glibc-2.2.5.orig/posix/regex.h glibc-2.2.5/posix/regex.h
  131. --- glibc-2.2.5.orig/posix/regex.h        2001-07-06 14:55:38.000000000 +1000
  132. +++ glibc-2.2.5/posix/regex.h        2002-08-10 09:24:57.000000000 +1000
  133. @@ -529,10 +529,14 @@
  134. #  endif
  135. # endif
  136. #endif
  137. -/* For now unconditionally define __restrict_arr to expand to nothing.
  138. -   Ideally we would have a test for the compiler which allows defining
  139. -   it to restrict.  */
  140. -#define __restrict_arr
  141. +/* gcc 3.1 and up support the [restrict] syntax.  */
  142. +#ifndef __restrict_arr
  143. +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
  144. +#  define __restrict_arr __restrict
  145. +# else
  146. +#  define __restrict_arr
  147. +# endif
  148. +#endif

  149. /* POSIX compatibility.  */
  150. extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
  151. diff -uNr glibc-2.2.5.orig/resolv/nss_dns/dns-network.c glibc-2.2.5/resolv/nss_dns/dns-network.c
  152. --- glibc-2.2.5.orig/resolv/nss_dns/dns-network.c        2001-07-06 14:55:39.000000000 +1000
  153. +++ glibc-2.2.5/resolv/nss_dns/dns-network.c        2002-08-10 09:24:57.000000000 +1000
  154. @@ -328,7 +328,9 @@
  155.             }
  156.           cp += n;
  157.           *alias_pointer++ = bp;
  158. -          bp += strlen (bp) + 1;
  159. +          n = strlen (bp) + 1;
  160. +          bp += n;
  161. +          linebuflen -= n;
  162.           result->n_addrtype = class == C_IN ? AF_INET : AF_UNSPEC;
  163.           ++have_answer;
  164.         }
  165. diff -uNr glibc-2.2.5.orig/sunrpc/xdr_array.c glibc-2.2.5/sunrpc/xdr_array.c
  166. --- glibc-2.2.5.orig/sunrpc/xdr_array.c        2001-08-17 14:48:31.000000000 +1000
  167. +++ glibc-2.2.5/sunrpc/xdr_array.c        2002-08-10 09:24:57.000000000 +1000
  168. @@ -45,6 +45,7 @@
  169. #include <rpc/types.h>
  170. #include <rpc/xdr.h>
  171. #include <libintl.h>
  172. +#include <limits.h>

  173. #ifdef USE_IN_LIBIO
  174. # include <wchar.h>
  175. @@ -81,7 +82,11 @@
  176.        return FALSE;
  177.      }
  178.    c = *sizep;
  179. -  if ((c > maxsize) && (xdrs->x_op != XDR_FREE))
  180. +  /*
  181. +   * XXX: Let the overflow possibly happen with XDR_FREE because mem_free()
  182. +   * doesn't actually use its second argument anyway.
  183. +   */
  184. +  if ((c > maxsize || c > UINT_MAX / elsize) && (xdrs->x_op != XDR_FREE))
  185.      {
  186.        return FALSE;
  187.      }
  188. diff -uNr glibc-2.2.5.orig/sysdeps/i386/Makefile glibc-2.2.5/sysdeps/i386/Makefile
  189. --- glibc-2.2.5.orig/sysdeps/i386/Makefile        1999-09-18 02:59:13.000000000 +1000
  190. +++ glibc-2.2.5/sysdeps/i386/Makefile        2002-08-10 09:24:57.000000000 +1000
  191. @@ -9,6 +9,12 @@
  192. # On i686 we must avoid generating the trampoline functions generated
  193. # to get the GOT pointer.
  194. CFLAGS-initfini.s += -march=i386 -mcpu=i386
  195. +
  196. +ifeq (yes,$(build-shared))
  197. +# Compatibility
  198. +sysdep_routines += divdi3
  199. +shared-only-routines += divdi3
  200. +endif
  201. endif

  202. ifeq ($(subdir),db2)
  203. diff -uNr glibc-2.2.5.orig/sysdeps/i386/fpu/libm-test-ulps glibc-2.2.5/sysdeps/i386/fpu/libm-test-ulps
  204. --- glibc-2.2.5.orig/sysdeps/i386/fpu/libm-test-ulps        2001-08-27 23:55:13.000000000 +1000
  205. +++ glibc-2.2.5/sysdeps/i386/fpu/libm-test-ulps        2002-08-10 09:24:57.000000000 +1000
  206. @@ -96,9 +96,9 @@
  207. # cacosh
  208. Test "Real part of: cacosh (-2 - 3 i) == -1.9833870299165354323470769028940395 + 2.1414491111159960199416055713254211 i":
  209. double: 1
  210. -float: 4
  211. +float: 9
  212. idouble: 1
  213. -ifloat: 4
  214. +ifloat: 9
  215. ildouble: 6
  216. ldouble: 6
  217. Test "Imaginary part of: cacosh (-2 - 3 i) == -1.9833870299165354323470769028940395 + 2.1414491111159960199416055713254211 i":
  218. @@ -1234,9 +1234,9 @@

  219. Function: Real part of "cacosh":
  220. double: 1
  221. -float: 4
  222. +float: 9
  223. idouble: 1
  224. -ifloat: 4
  225. +ifloat: 9
  226. ildouble: 328
  227. ldouble: 328

  228. diff -uNr glibc-2.2.5.orig/sysdeps/m68k/Makefile glibc-2.2.5/sysdeps/m68k/Makefile
  229. --- glibc-2.2.5.orig/sysdeps/m68k/Makefile        2001-07-06 14:55:55.000000000 +1000
  230. +++ glibc-2.2.5/sysdeps/m68k/Makefile        2002-08-10 09:24:57.000000000 +1000
  231. @@ -33,6 +33,14 @@
  232. # The 68k `long double' is a distinct type we support.
  233. long-double-fcts = yes

  234. +ifeq ($(subdir),csu)
  235. +ifeq (yes,$(build-shared))
  236. +# Compatibility
  237. +sysdep_routines += divdi3
  238. +shared-only-routines += divdi3
  239. +endif
  240. +endif
  241. +
  242. ifeq ($(subdir),elf)
  243. CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
  244. endif
  245. diff -uNr glibc-2.2.5.orig/sysdeps/s390/s390-32/Makefile glibc-2.2.5/sysdeps/s390/s390-32/Makefile
  246. --- glibc-2.2.5.orig/sysdeps/s390/s390-32/Makefile        2001-03-16 19:59:44.000000000 +1100
  247. +++ glibc-2.2.5/sysdeps/s390/s390-32/Makefile        2002-08-10 09:24:57.000000000 +1000
  248. @@ -1,5 +1,13 @@
  249. pic-ccflag = -fpic

  250. +ifeq ($(subdir),csu)
  251. +ifeq (yes,$(build-shared))
  252. +# Compatibility
  253. +sysdep_routines += divdi3
  254. +shared-only-routines += divdi3
  255. +endif
  256. +endif
  257. +
  258. ifeq ($(subdir),gmon)
  259. sysdep_routines += s390-mcount
  260. endif
  261. diff -uNr glibc-2.2.5.orig/sysdeps/unix/sysv/linux/errlist.c glibc-2.2.5/sysdeps/unix/sysv/linux/errlist.c
  262. --- glibc-2.2.5.orig/sysdeps/unix/sysv/linux/errlist.c        2001-07-06 14:56:12.000000000 +1000
  263. +++ glibc-2.2.5/sysdeps/unix/sysv/linux/errlist.c        2002-08-10 09:24:57.000000000 +1000
  264. @@ -38,10 +38,9 @@
  265. const int __old_sys_nerr = OLD_ERRLIST_SIZE;

  266. strong_alias (__old_sys_nerr, _old_sys_nerr);
  267. -weak_alias (__old_sys_nerr, _old_sys_nerr)
  268. compat_symbol (libc, __old_sys_nerr, _sys_nerr, GLIBC_2_0);
  269. compat_symbol (libc, _old_sys_nerr, sys_nerr, GLIBC_2_0);
  270. -weak_alias (__old_sys_errlist, _old_sys_errlist);
  271. +strong_alias (__old_sys_errlist, _old_sys_errlist);
  272. compat_symbol (libc, __old_sys_errlist, _sys_errlist, GLIBC_2_0);
  273. compat_symbol (libc, _old_sys_errlist, sys_errlist, GLIBC_2_0);
  274. #endif
  275. diff -uNr glibc-2.2.5.orig/sysdeps/wordsize-32/divdi3.c glibc-2.2.5/sysdeps/wordsize-32/divdi3.c
  276. --- glibc-2.2.5.orig/sysdeps/wordsize-32/divdi3.c        1970-01-01 10:00:00.000000000 +1000
  277. +++ glibc-2.2.5/sysdeps/wordsize-32/divdi3.c        2002-08-10 09:24:57.000000000 +1000
  278. @@ -0,0 +1,324 @@
  279. +/* 64-bit multiplication and division
  280. +   Copyright (C) 1989, 1992-1999, 2000, 2001, 2002
  281. +   Free Software Foundation, Inc.
  282. +   This file is part of the GNU C Library.
  283. +
  284. +   The GNU C Library is free software; you can redistribute it and/or
  285. +   modify it under the terms of the GNU Lesser General Public
  286. +   License as published by the Free Software Foundation; either
  287. +   version 2.1 of the License, or (at your option) any later version.
  288. +
  289. +   The GNU C Library is distributed in the hope that it will be useful,
  290. +   but WITHOUT ANY WARRANTY; without even the implied warranty of
  291. +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  292. +   Lesser General Public License for more details.
  293. +
  294. +   You should have received a copy of the GNU Lesser General Public
  295. +   License along with the GNU C Library; if not, write to the Free
  296. +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  297. +   02111-1307 USA.  */
  298. +
  299. +#include <endian.h>
  300. +#include <stdlib.h>
  301. +#include <bits/wordsize.h>
  302. +
  303. +#if __WORDSIZE != 32
  304. +#error This is for 32-bit targets only
  305. +#endif
  306. +
  307. +typedef unsigned int UQItype        __attribute__ ((mode (QI)));
  308. +typedef          int SItype        __attribute__ ((mode (SI)));
  309. +typedef unsigned int USItype        __attribute__ ((mode (SI)));
  310. +typedef          int DItype        __attribute__ ((mode (DI)));
  311. +typedef unsigned int UDItype        __attribute__ ((mode (DI)));
  312. +#define Wtype SItype
  313. +#define HWtype SItype
  314. +#define DWtype DItype
  315. +#define UWtype USItype
  316. +#define UHWtype USItype
  317. +#define UDWtype UDItype
  318. +#define W_TYPE_SIZE 32
  319. +
  320. +#include <stdlib/longlong.h>
  321. +
  322. +#if __BYTE_ORDER == __BIG_ENDIAN
  323. +struct DWstruct { Wtype high, low;};
  324. +#elif __BYTE_ORDER == __LITTLE_ENDIAN
  325. +struct DWstruct { Wtype low, high;};
  326. +#else
  327. +#error Unhandled endianity
  328. +#endif
  329. +typedef union { struct DWstruct s; DWtype ll; } DWunion;
  330. +
  331. +static UDWtype
  332. +__udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp)
  333. +{
  334. +  DWunion ww;
  335. +  DWunion nn, dd;
  336. +  DWunion rr;
  337. +  UWtype d0, d1, n0, n1, n2;
  338. +  UWtype q0, q1;
  339. +  UWtype b, bm;
  340. +
  341. +  nn.ll = n;
  342. +  dd.ll = d;
  343. +
  344. +  d0 = dd.s.low;
  345. +  d1 = dd.s.high;
  346. +  n0 = nn.s.low;
  347. +  n1 = nn.s.high;
  348. +
  349. +#if !UDIV_NEEDS_NORMALIZATION
  350. +  if (d1 == 0)
  351. +    {
  352. +      if (d0 > n1)
  353. +        {
  354. +          /* 0q = nn / 0D */
  355. +
  356. +          udiv_qrnnd (q0, n0, n1, n0, d0);
  357. +          q1 = 0;
  358. +
  359. +          /* Remainder in n0.  */
  360. +        }
  361. +      else
  362. +        {
  363. +          /* qq = NN / 0d */
  364. +
  365. +          if (d0 == 0)
  366. +            d0 = 1 / d0;        /* Divide intentionally by zero.  */
  367. +
  368. +          udiv_qrnnd (q1, n1, 0, n1, d0);
  369. +          udiv_qrnnd (q0, n0, n1, n0, d0);
  370. +
  371. +          /* Remainder in n0.  */
  372. +        }
  373. +
  374. +      if (rp != 0)
  375. +        {
  376. +          rr.s.low = n0;
  377. +          rr.s.high = 0;
  378. +          *rp = rr.ll;
  379. +        }
  380. +    }
  381. +
  382. +#else /* UDIV_NEEDS_NORMALIZATION */
  383. +
  384. +  if (d1 == 0)
  385. +    {
  386. +      if (d0 > n1)
  387. +        {
  388. +          /* 0q = nn / 0D */
  389. +
  390. +          count_leading_zeros (bm, d0);
  391. +
  392. +          if (bm != 0)
  393. +            {
  394. +              /* Normalize, i.e. make the most significant bit of the
  395. +                 denominator set.  */
  396. +
  397. +              d0 = d0 << bm;
  398. +              n1 = (n1 << bm) | (n0 >> (W_TYPE_SIZE - bm));
  399. +              n0 = n0 << bm;
  400. +            }
  401. +
  402. +          udiv_qrnnd (q0, n0, n1, n0, d0);
  403. +          q1 = 0;
  404. +
  405. +          /* Remainder in n0 >> bm.  */
  406. +        }
  407. +      else
  408. +        {
  409. +          /* qq = NN / 0d */
  410. +
  411. +          if (d0 == 0)
  412. +            d0 = 1 / d0;        /* Divide intentionally by zero.  */
  413. +
  414. +          count_leading_zeros (bm, d0);
  415. +
  416. +          if (bm == 0)
  417. +            {
  418. +              /* From (n1 >= d0) /\ (the most significant bit of d0 is set),
  419. +                 conclude (the most significant bit of n1 is set) /\ (the
  420. +                 leading quotient digit q1 = 1).
  421. +
  422. +                 This special case is necessary, not an optimization.
  423. +                 (Shifts counts of W_TYPE_SIZE are undefined.)  */
  424. +
  425. +              n1 -= d0;
  426. +              q1 = 1;
  427. +            }
  428. +          else
  429. +            {
  430. +              /* Normalize.  */
  431. +
  432. +              b = W_TYPE_SIZE - bm;
  433. +
  434. +              d0 = d0 << bm;
  435. +              n2 = n1 >> b;
  436. +              n1 = (n1 << bm) | (n0 >> b);
  437. +              n0 = n0 << bm;
  438. +
  439. +              udiv_qrnnd (q1, n1, n2, n1, d0);
  440. +            }
  441. +
  442. +          /* n1 != d0...  */
  443. +
  444. +          udiv_qrnnd (q0, n0, n1, n0, d0);
  445. +
  446. +          /* Remainder in n0 >> bm.  */
  447. +        }
  448. +
  449. +      if (rp != 0)
  450. +        {
  451. +          rr.s.low = n0 >> bm;
  452. +          rr.s.high = 0;
  453. +          *rp = rr.ll;
  454. +        }
  455. +    }
  456. +#endif /* UDIV_NEEDS_NORMALIZATION */
  457. +
  458. +  else
  459. +    {
  460. +      if (d1 > n1)
  461. +        {
  462. +          /* 00 = nn / DD */
  463. +
  464. +          q0 = 0;
  465. +          q1 = 0;
  466. +
  467. +          /* Remainder in n1n0.  */
  468. +          if (rp != 0)
  469. +            {
  470. +              rr.s.low = n0;
  471. +              rr.s.high = n1;
  472. +              *rp = rr.ll;
  473. +            }
  474. +        }
  475. +      else
  476. +        {
  477. +          /* 0q = NN / dd */
  478. +
  479. +          count_leading_zeros (bm, d1);
  480. +          if (bm == 0)
  481. +            {
  482. +              /* From (n1 >= d1) /\ (the most significant bit of d1 is set),
  483. +                 conclude (the most significant bit of n1 is set) /\ (the
  484. +                 quotient digit q0 = 0 or 1).
  485. +
  486. +                 This special case is necessary, not an optimization.  */
  487. +
  488. +              /* The condition on the next line takes advantage of that
  489. +                 n1 >= d1 (true due to program flow).  */
  490. +              if (n1 > d1 || n0 >= d0)
  491. +                {
  492. +                  q0 = 1;
  493. +                  sub_ddmmss (n1, n0, n1, n0, d1, d0);
  494. +                }
  495. +              else
  496. +                q0 = 0;
  497. +
  498. +              q1 = 0;
  499. +
  500. +              if (rp != 0)
  501. +                {
  502. +                  rr.s.low = n0;
  503. +                  rr.s.high = n1;
  504. +                  *rp = rr.ll;
  505. +                }
  506. +            }
  507. +          else
  508. +            {
  509. +              UWtype m1, m0;
  510. +              /* Normalize.  */
  511. +
  512. +              b = W_TYPE_SIZE - bm;
  513. +
  514. +              d1 = (d1 << bm) | (d0 >> b);
  515. +              d0 = d0 << bm;
  516. +              n2 = n1 >> b;
  517. +              n1 = (n1 << bm) | (n0 >> b);
  518. +              n0 = n0 << bm;
  519. +
  520. +              udiv_qrnnd (q0, n1, n2, n1, d1);
  521. +              umul_ppmm (m1, m0, q0, d0);
  522. +
  523. +              if (m1 > n1 || (m1 == n1 && m0 > n0))
  524. +                {
  525. +                  q0--;
  526. +                  sub_ddmmss (m1, m0, m1, m0, d1, d0);
  527. +                }
  528. +
  529. +              q1 = 0;
  530. +
  531. +              /* Remainder in (n1n0 - m1m0) >> bm.  */
  532. +              if (rp != 0)
  533. +                {
  534. +                  sub_ddmmss (n1, n0, n1, n0, m1, m0);
  535. +                  rr.s.low = (n1 << b) | (n0 >> bm);
  536. +                  rr.s.high = n1 >> bm;
  537. +                  *rp = rr.ll;
  538. +                }
  539. +            }
  540. +        }
  541. +    }
  542. +
  543. +  ww.s.low = q0;
  544. +  ww.s.high = q1;
  545. +  return ww.ll;
  546. +}
  547. +
  548. +DWtype
  549. +__divdi3 (DWtype u, DWtype v)
  550. +{
  551. +  Wtype c = 0;
  552. +  DWtype w;
  553. +
  554. +  if (u < 0)
  555. +    {
  556. +      c = ~c;
  557. +      u = -u;
  558. +    }
  559. +  if (v < 0)
  560. +    {
  561. +      c = ~c;
  562. +      v = -v;
  563. +    }
  564. +  w = __udivmoddi4 (u, v, NULL);
  565. +  if (c)
  566. +    w = -w;
  567. +  return w;
  568. +}
  569. +
  570. +DWtype
  571. +__moddi3 (DWtype u, DWtype v)
  572. +{
  573. +  Wtype c = 0;
  574. +  DWtype w;
  575. +
  576. +  if (u < 0)
  577. +    {
  578. +      c = ~c;
  579. +      u = -u;
  580. +    }
  581. +  if (v < 0)
  582. +    v = -v;
  583. +  __udivmoddi4 (u, v, &w);
  584. +  if (c)
  585. +    w = -w;
  586. +  return w;
  587. +}
  588. +
  589. +UDWtype
  590. +__udivdi3 (UDWtype u, UDWtype v)
  591. +{
  592. +  return __udivmoddi4 (u, v, NULL);
  593. +}
  594. +
  595. +UDWtype
  596. +__umoddi3 (UDWtype u, UDWtype v)
  597. +{
  598. +  UDWtype w;
  599. +
  600. +  __udivmoddi4 (u, v, &w);
  601. +  return w;
  602. +}
复制代码
 楼主| 发表于 2003-1-12 22:51:46 | 显示全部楼层
再问一下
--- glibc-2.2.5/login/Makefile  Thu Jul  5 21:55:34 2001
+++ glibc-2.2.5-2/login/Makefile        Tue May 28 17:58:59 2002
这个是什么意思

我打补丁时候出问题了
说找不到要打补丁的文件

所以问一下
发表于 2003-1-12 23:02:56 | 显示全部楼层
是不是方法不对。你是怎么打补丁的?
发表于 2003-1-12 23:08:00 | 显示全部楼层
上面的是补丁的全文,你贴到一个文件里就行了。像用一般补丁那样用。
 楼主| 发表于 2003-1-12 23:08:09 | 显示全部楼层
是patch -Np1 -i fielname
帮我解释一下我问的
发表于 2003-1-12 23:11:54 | 显示全部楼层
最初由 chenaj 发布
是patch -Np1 -i fielname
帮我解释一下我问的

你的补丁是放在解压后的源代码目录中,还是放在源代码目录的旁边?
发表于 2003-1-12 23:14:27 | 显示全部楼层
一句两句说不清的,你有兴趣就看info patch和info diff
`-i PATCHFILE'
`--input=PATCHFILE'
     Read the patch from PATCHFILE rather than from standard input.
     *Note patch Options::.
`-N'
`--forward'
     Ignore patches that `patch' thinks are reversed or already applied.
     See also `-R'.  *Note Reversed Patches::.
`-pNUMBER'
`--strip=NUMBER'
     Set the file name strip count to NUMBER.  *Note patch
     Directories::.
发表于 2003-1-12 23:16:02 | 显示全部楼层
最初由 chenaj 发布
再问一下
--- glibc-2.2.5/login/Makefile  Thu Jul  5 21:55:34 2001
+++ glibc-2.2.5-2/login/Makefile        Tue May 28 17:58:59 2002
这个是什么意思

所以问一下

这个表示比较的两个文件。前面一个有“---”的是旧文件,后面一个有“+++”的是新文件,glibc-2.2.5/login/Makefile是相对路径。后面的是文件的生成时间。
 楼主| 发表于 2003-1-13 03:37:55 | 显示全部楼层
谢谢kj501
我应该在目录中
而不是旁边
或者将patch包拿到目录中
用上面的命令
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表