From drepper@redhat.com Sat Mar 3 10:38:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 03 Mar 2001 10:38:00 -0000 Subject: libanl + atexit + more Message-ID: I've landed the libanl (asynchronous name lookup library) code. It entirely based on the proposal I circulated several months ago. Please give it a try (there is the code for a test program called ga_test; this is just for some initial testing, it'll go away). I'm also still open for a different name than libanl. I think it's OK but if somebody doesn't agree... Second, I haven't gotten any comments on the atexit() implementation changes I made. They are so non-obvious that I thought the one or other would comment. The good thing is that this implementation should be very robust. The bad thing is that old programs cannot be fixed, everything (means DSOs) has to be relinked (if they have this problem which is fortunately rare). I don't think this is a problem. Note that today (until sometime next week :-) this atexit() implementation is not Unix conforming. Unix currently forbids this behavior (this means the registered functions are called at dlclose() time). I've filed an defect report which will be handled next week. Which brings us to the next point: I'll be off next week to the Unix standard meeting. Not a long trip this time, fortunately (just up the East Bay). I'll probably handle mail (maybe we have a network connection, otherwise I'll dial in at night). And a final point. With the libanl stuff in I have two more things on my plate which I want to see done before a 2.2.3 release and these are integrating the math library IBM contributed and one more ELF extension (needed for a correct librt and libanl implementation). I'll start on this once I'm back. In the meantime, there are still various projects listed in the PROJECTS file. Especially #22, #21, and #25 are interesting (in that order). -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Sun Mar 4 11:02:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Sun, 04 Mar 2001 11:02:00 -0000 Subject: avoid multi-line string in version-info.h Message-ID: GCC now deprecates now multi-line strings: /builds/glibc/20010106-gcc-2.97.test/csu/version-info.h:3:1: warning: multi-line string literals are deprecated Here's a patch for the first files. Ok to commit? Andreas 2001-03-04 Andreas Jaeger * stdlib/longlong.h: Don't use multi-line strings. * csu/Makefile ($(objpfx)version-info.h): Don't use multi-line string. ============================================================ Index: csu/Makefile --- csu/Makefile 2000/12/06 04:02:21 1.46 +++ csu/Makefile 2001/03/04 18:21:47 @@ -1,6 +1,6 @@ # Makefile for csu code for GNU C library. -# Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc. +# Copyright (C) 1995,1996,1997,1998,1999,2000,2001 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 @@ -204,8 +204,8 @@ esac; \ files="$(all-Banner-files)"; \ if test -n "$$files"; then \ - echo "\"Available extensions:"; \ - sed -e '/^#/d' -e 's/^[[:space:]]*/ /' $$files; \ - echo "\""; \ + echo "\"Available extensions:\\n\""; \ + sed -e '/^#/d' -e 's/^[[:space:]]*/ /' \ + -e 's/\(^.*$$\)/\"\1\\n\"/' $$files; \ fi) > $@T mv -f $@T $@ ============================================================ Index: stdlib/longlong.h --- stdlib/longlong.h 2000/01/17 06:11:53 1.23 +++ stdlib/longlong.h 2001/03/04 18:21:48 @@ -1,5 +1,5 @@ /* longlong.h -- definitions for mixed size 32/64 bit arithmetic. - Copyright (C) 1991,92,94,95,96,97,98,99,2000 Free Software Foundation, Inc. + Copyright (C) 1991,92,94,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. This definition file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Boston, MA 02111-1307, USA. */ /* You have to define the following before including this file: @@ -55,7 +55,7 @@ 3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator, denominator) divides a UDWtype, composed by the UWtype integers HIGH_NUMERATOR and LOW_NUMERATOR, by DENOMINATOR and places the quotient - in QUOTIENT and the remainder in REMAINDER. HIGH_NUMERATOR must be less + in QUOTIENT and the remainder in REMAINDER. HIGH_NUMERATOR must be less than DENOMINATOR for correct operation. If, in addition, the most significant bit of DENOMINATOR must be 1, then the pre-processor symbol UDIV_NEEDS_NORMALIZATION is defined to 1. @@ -75,14 +75,14 @@ 7) add_ssaaaa(high_sum, low_sum, high_addend_1, low_addend_1, high_addend_2, low_addend_2) adds two UWtype integers, composed by HIGH_ADDEND_1 and LOW_ADDEND_1, and HIGH_ADDEND_2 and LOW_ADDEND_2 - respectively. The result is placed in HIGH_SUM and LOW_SUM. Overflow + respectively. The result is placed in HIGH_SUM and LOW_SUM. Overflow (i.e. carry out) is not stored anywhere, and is lost. 8) sub_ddmmss(high_difference, low_difference, high_minuend, low_minuend, high_subtrahend, low_subtrahend) subtracts two two-word UWtype integers, composed by HIGH_MINUEND_1 and LOW_MINUEND_1, and HIGH_SUBTRAHEND_2 and LOW_SUBTRAHEND_2 respectively. The result is placed in HIGH_DIFFERENCE - and LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere, + and LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere, and is lost. If any of these macros are left undefined for a particular CPU, @@ -97,7 +97,7 @@ #if defined (__GNUC__) && !defined (NO_ASM) /* We sometimes need to clobber "cc" with gcc2, but that would not be - understood by gcc1. Use cpp to avoid major code duplication. */ + understood by gcc1. Use cpp to avoid major code duplication. */ #if __GNUC__ < 2 #define __CLOBBER_CC #define __AND_CLOBBER_CC @@ -108,8 +108,8 @@ #if (defined (__a29k__) || defined (_AM29K)) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("add %1,%4,%5 - addc %0,%2,%3" \ + __asm__ ("add %1,%4,%5\n" \ + "addc %0,%2,%3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "%r" ((USItype) (ah)), \ @@ -117,8 +117,8 @@ "%r" ((USItype) (al)), \ "rI" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("sub %1,%4,%5 - subc %0,%2,%3" \ + __asm__ ("sub %1,%4,%5\n" \ + "subc %0,%2,%3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "r" ((USItype) (ah)), \ @@ -175,8 +175,8 @@ #if defined (__arc__) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("add.f %1, %4, %5 - adc %0, %2, %3" \ + __asm__ ("add.f %1, %4, %5\n" \ + "adc %0, %2, %3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "%r" ((USItype) (ah)), \ @@ -184,8 +184,8 @@ "%r" ((USItype) (al)), \ "rIJ" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("sub.f %1, %4, %5 - sbc %0, %2, %3" \ + __asm__ ("sub.f %1, %4, %5\n" \ + "sbc %0, %2, %3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "r" ((USItype) (ah)), \ @@ -206,8 +206,8 @@ #if defined (__arm__) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("adds %1, %4, %5 - adc %0, %2, %3" \ + __asm__ ("adds %1, %4, %5\n" \ + "adc %0, %2, %3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "%r" ((USItype) (ah)), \ @@ -215,8 +215,8 @@ "%r" ((USItype) (al)), \ "rI" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("subs %1, %4, %5 - sbc %0, %2, %3" \ + __asm__ ("subs %1, %4, %5\n" \ + "sbc %0, %2, %3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "r" ((USItype) (ah)), \ @@ -225,19 +225,19 @@ "rI" ((USItype) (bl))) #define umul_ppmm(xh, xl, a, b) \ {register USItype __t0, __t1, __t2; \ - __asm__ ("%@ Inlined umul_ppmm - mov %2, %5, lsr #16 - mov %0, %6, lsr #16 - bic %3, %5, %2, lsl #16 - bic %4, %6, %0, lsl #16 - mul %1, %3, %4 - mul %4, %2, %4 - mul %3, %0, %3 - mul %0, %2, %0 - adds %3, %4, %3 - addcs %0, %0, #65536 - adds %1, %1, %3, lsl #16 - adc %0, %0, %3, lsr #16" \ + __asm__ ("%@ Inlined umul_ppmm\n" \ + "mov %2, %5, lsr #16\n" \ + "mov %0, %6, lsr #16\n" \ + "bic %3, %5, %2, lsl #16\n" \ + "bic %4, %6, %0, lsl #16\n" \ + "mul %1, %3, %4\n" \ + "mul %4, %2, %4\n" \ + "mul %3, %0, %3\n" \ + "mul %0, %2, %0\n" \ + "adds %3, %4, %3\n" \ + "addcs %0, %0, #65536\n" \ + "adds %1, %1, %3, lsl #16\n" \ + "adc %0, %0, %3, lsr #16" \ : "=&r" ((USItype) (xh)), \ "=r" ((USItype) (xl)), \ "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \ @@ -277,8 +277,8 @@ #if defined (__gmicro__) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("add.w %5,%1 - addx %3,%0" \ + __asm__ ("add.w %5,%1\n" \ + "addx %3,%0" \ : "=g" ((USItype) (sh)), \ "=&g" ((USItype) (sl)) \ : "%0" ((USItype) (ah)), \ @@ -286,8 +286,8 @@ "%1" ((USItype) (al)), \ "g" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("sub.w %5,%1 - subx %3,%0" \ + __asm__ ("sub.w %5,%1\n" \ + "subx %3,%0" \ : "=g" ((USItype) (sh)), \ "=&g" ((USItype) (sl)) \ : "0" ((USItype) (ah)), \ @@ -316,8 +316,8 @@ #if defined (__hppa) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("add %4,%5,%1 - addc %2,%3,%0" \ + __asm__ ("add %4,%5,%1\n" \ + "addc %2,%3,%0" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "%rM" ((USItype) (ah)), \ @@ -325,8 +325,8 @@ "%rM" ((USItype) (al)), \ "rM" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("sub %4,%5,%1 - subb %2,%3,%0" \ + __asm__ ("sub %4,%5,%1\n" \ + "subb %2,%3,%0" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "rM" ((USItype) (ah)), \ @@ -354,25 +354,25 @@ #endif #define UDIV_TIME 40 #define count_leading_zeros(count, x) \ - do { \ - USItype __tmp; \ - __asm__ ( \ - "ldi 1,%0 - extru,= %1,15,16,%%r0 ; Bits 31..16 zero? - extru,tr %1,15,16,%1 ; No. Shift down, skip add. - ldo 16(%0),%0 ; Yes. Perform add. - extru,= %1,23,8,%%r0 ; Bits 15..8 zero? - extru,tr %1,23,8,%1 ; No. Shift down, skip add. - ldo 8(%0),%0 ; Yes. Perform add. - extru,= %1,27,4,%%r0 ; Bits 7..4 zero? - extru,tr %1,27,4,%1 ; No. Shift down, skip add. - ldo 4(%0),%0 ; Yes. Perform add. - extru,= %1,29,2,%%r0 ; Bits 3..2 zero? - extru,tr %1,29,2,%1 ; No. Shift down, skip add. - ldo 2(%0),%0 ; Yes. Perform add. - extru %1,30,1,%1 ; Extract bit 1. - sub %0,%1,%0 ; Subtract it. - " : "=r" (count), "=r" (__tmp) : "1" (x)); \ + do { \ + USItype __tmp; \ + __asm__ ( \ + "ldi 1,%0\n" \ + "extru,= %1,15,16,%%r0 ; Bits 31..16 zero?\n" \ + "extru,tr %1,15,16,%1 ; No. Shift down, skip add.\n" \ + "ldo 16(%0),%0 ; Yes. Perform add.\n" \ + "extru,= %1,23,8,%%r0 ; Bits 15..8 zero?\n" \ + "extru,tr %1,23,8,%1 ; No. Shift down, skip add.\n" \ + "ldo 8(%0),%0 ; Yes. Perform add.\n" \ + "extru,= %1,27,4,%%r0 ; Bits 7..4 zero?\n" \ + "extru,tr %1,27,4,%1 ; No. Shift down, skip add.\n" \ + "ldo 4(%0),%0 ; Yes. Perform add.\n" \ + "extru,= %1,29,2,%%r0 ; Bits 3..2 zero?\n" \ + "extru,tr %1,29,2,%1 ; No. Shift down, skip add.\n" \ + "ldo 2(%0),%0 ; Yes. Perform add.\n" \ + "extru %1,30,1,%1 ; Extract bit 1.\n" \ + "sub %0,%1,%0 ; Subtract it." \ + : "=r" (count), "=r" (__tmp) : "1" (x)); \ } while (0) #endif @@ -419,8 +419,8 @@ #if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("addl %5,%1 - adcl %3,%0" \ + __asm__ ("addl %5,%1\n" \ + "adcl %3,%0" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "%0" ((USItype) (ah)), \ @@ -428,8 +428,8 @@ "%1" ((USItype) (al)), \ "g" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("subl %5,%1 - sbbl %3,%0" \ + __asm__ ("subl %5,%1\n" \ + "sbbl %3,%0" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "0" ((USItype) (ah)), \ @@ -472,7 +472,7 @@ { \ DItype __ll; \ struct {USItype __l, __h;} __i; \ - } __a, __b, __s; \ + } __a, __b, __s; \ __a.__i.__l = (al); \ __a.__i.__h = (ah); \ __b.__i.__l = (bl); \ @@ -489,7 +489,7 @@ { \ DItype __ll; \ struct {USItype __l, __h;} __i; \ - } __a, __b, __s; \ + } __a, __b, __s; \ __a.__i.__l = (al); \ __a.__i.__h = (ah); \ __b.__i.__l = (bl); \ @@ -524,10 +524,10 @@ #if defined (__M32R__) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - /* The cmp clears the condition bit. */ \ - __asm__ ("cmp %0,%0 - addx %%5,%1 - addx %%3,%0" \ + /* The cmp clears the condition bit. */ \ + __asm__ ("cmp %0,%0\n" \ + "addx %%5,%1\n" \ + "addx %%3,%0" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "%0" ((USItype) (ah)), \ @@ -536,10 +536,10 @@ "r" ((USItype) (bl)) \ : "cbit") #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - /* The cmp clears the condition bit. */ \ - __asm__ ("cmp %0,%0 - subx %5,%1 - subx %3,%0" \ + /* The cmp clears the condition bit. */ \ + __asm__ ("cmp %0,%0\n" \ + "subx %5,%1\n" \ + "subx %3,%0" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "0" ((USItype) (ah)), \ @@ -551,8 +551,8 @@ #if defined (__mc68000__) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("add%.l %5,%1 - addx%.l %3,%0" \ + __asm__ ("add%.l %5,%1\n" \ + "addx%.l %3,%0" \ : "=d" ((USItype) (sh)), \ "=&d" ((USItype) (sl)) \ : "%0" ((USItype) (ah)), \ @@ -560,8 +560,8 @@ "%1" ((USItype) (al)), \ "g" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("sub%.l %5,%1 - subx%.l %3,%0" \ + __asm__ ("sub%.l %5,%1\n" \ + "subx%.l %3,%0" \ : "=d" ((USItype) (sh)), \ "=&d" ((USItype) (sl)) \ : "0" ((USItype) (ah)), \ @@ -602,32 +602,32 @@ #if !defined(__mcf5200__) /* %/ inserts REGISTER_PREFIX, %# inserts IMMEDIATE_PREFIX. */ #define umul_ppmm(xh, xl, a, b) \ - __asm__ ("| Inlined umul_ppmm - move%.l %2,%/d0 - move%.l %3,%/d1 - move%.l %/d0,%/d2 - swap %/d0 - move%.l %/d1,%/d3 - swap %/d1 - move%.w %/d2,%/d4 - mulu %/d3,%/d4 - mulu %/d1,%/d2 - mulu %/d0,%/d3 - mulu %/d0,%/d1 - move%.l %/d4,%/d0 - eor%.w %/d0,%/d0 - swap %/d0 - add%.l %/d0,%/d2 - add%.l %/d3,%/d2 - jcc 1f - add%.l %#65536,%/d1 -1: swap %/d2 - moveq %#0,%/d0 - move%.w %/d2,%/d0 - move%.w %/d4,%/d2 - move%.l %/d2,%1 - add%.l %/d1,%/d0 - move%.l %/d0,%0" \ + __asm__ ("| Inlined umul_ppmm\n" \ +" move%.l %2,%/d0\n" \ +" move%.l %3,%/d1\n" \ +" move%.l %/d0,%/d2\n" \ +" swap %/d0\n" \ +" move%.l %/d1,%/d3\n" \ +" swap %/d1\n" \ +" move%.w %/d2,%/d4\n" \ +" mulu %/d3,%/d4\n" \ +" mulu %/d1,%/d2\n" \ +" mulu %/d0,%/d3\n" \ +" mulu %/d0,%/d1\n" \ +" move%.l %/d4,%/d0\n" \ +" eor%.w %/d0,%/d0\n" \ +" swap %/d0\n" \ +" add%.l %/d0,%/d2\n" \ +" add%.l %/d3,%/d2\n" \ +" jcc 1f\n" \ +" add%.l %#65536,%/d1\n" \ +"1: swap %/d2\n" \ +" moveq %#0,%/d0\n" \ +" move%.w %/d2,%/d0\n" \ +" move%.w %/d4,%/d2\n" \ +" move%.l %/d2,%1\n" \ +" add%.l %/d1,%/d0\n" \ +" move%.l %/d0,%0" \ : "=g" ((USItype) (xh)), \ "=g" ((USItype) (xl)) \ : "g" ((USItype) (a)), \ @@ -653,8 +653,8 @@ #if defined (__m88000__) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("addu.co %1,%r4,%r5 - addu.ci %0,%r2,%r3" \ + __asm__ ("addu.co %1,%r4,%r5\n" \ + "addu.ci %0,%r2,%r3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "%rJ" ((USItype) (ah)), \ @@ -662,8 +662,8 @@ "%rJ" ((USItype) (al)), \ "rJ" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("subu.co %1,%r4,%r5 - subu.ci %0,%r2,%r3" \ + __asm__ ("subu.co %1,%r4,%r5\n" \ + "subu.ci %0,%r2,%r3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "rJ" ((USItype) (ah)), \ @@ -751,10 +751,10 @@ (r) = __xx.__i.__l; (q) = __xx.__i.__h; }) #define count_trailing_zeros(count,x) \ do { - __asm__ ("ffsd %2,%0" \ - : "=r" ((USItype) (count)) \ - : "0" ((USItype) 0), \ - "r" ((USItype) (x))); \ + __asm__ ("ffsd %2,%0" \ + : "=r" ((USItype) (count)) \ + : "0" ((USItype) 0), \ + "r" ((USItype) (x))); \ } while (0) #endif /* __ns32000__ */ @@ -876,12 +876,12 @@ : "r" ((SItype) (nh)), "1" ((SItype) (nl)), "r" ((SItype) (d))) #define UDIV_TIME 100 #endif -#endif /* Power architecture variants. */ +#endif /* Power architecture variants. */ #if defined (__pyr__) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("addw %5,%1 - addwc %3,%0" \ + __asm__ ("addw %5,%1\n" \ + "addwc %3,%0" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "%0" ((USItype) (ah)), \ @@ -889,8 +889,8 @@ "%1" ((USItype) (al)), \ "g" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("subw %5,%1 - subwb %3,%0" \ + __asm__ ("subw %5,%1\n" \ + "subwb %3,%0" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "0" ((USItype) (ah)), \ @@ -902,8 +902,8 @@ ({union {UDItype __ll; \ struct {USItype __h, __l;} __i; \ } __xx; \ - __asm__ ("movw %1,%R0 - uemul %2,%0" \ + __asm__ ("movw %1,%R0\n" \ + "uemul %2,%0" \ : "=&r" (__xx.__ll) \ : "g" ((USItype) (u)), \ "g" ((USItype) (v))); \ @@ -912,8 +912,8 @@ #if defined (__ibm032__) /* RT/ROMP */ && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("a %1,%5 - ae %0,%3" \ + __asm__ ("a %1,%5\n" \ + "ae %0,%3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "%0" ((USItype) (ah)), \ @@ -921,8 +921,8 @@ "%1" ((USItype) (al)), \ "r" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("s %1,%5 - se %0,%3" \ + __asm__ ("s %1,%5\n" \ + "se %0,%3" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "0" ((USItype) (ah)), \ @@ -933,26 +933,26 @@ do { \ USItype __m0 = (m0), __m1 = (m1); \ __asm__ ( \ - "s r2,r2 - mts r10,%2 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - m r2,%3 - cas %0,r2,r0 - mfs r10,%1" \ + "s r2,r2\n" \ + "mts r10,%2\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "m r2,%3\n" \ + "cas %0,r2,r0\n" \ + "mfs r10,%1" \ : "=r" ((USItype) (ph)), \ "=r" ((USItype) (pl)) \ : "%r" (__m0), \ @@ -982,9 +982,9 @@ #if defined (__sh2__) && W_TYPE_SIZE == 32 #define umul_ppmm(w1, w0, u, v) \ __asm__ ( \ - "dmulu.l %2,%3 - sts macl,%1 - sts mach,%0" \ + "dmulu.l %2,%3\n" \ + "sts macl,%1\n" \ + "sts mach,%0" \ : "=r" ((USItype)(w1)), \ "=r" ((USItype)(w0)) \ : "r" ((USItype)(u)), \ @@ -996,8 +996,8 @@ #if defined (__sparc__) && !defined(__arch64__) \ && !defined(__sparcv9) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("addcc %r4,%5,%1 - addx %r2,%3,%0" \ + __asm__ ("addcc %r4,%5,%1\n" \ + "addx %r2,%3,%0" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "%rJ" ((USItype) (ah)), \ @@ -1006,8 +1006,8 @@ "rI" ((USItype) (bl)) \ __CLOBBER_CC) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("subcc %r4,%5,%1 - subx %r2,%3,%0" \ + __asm__ ("subcc %r4,%5,%1\n" \ + "subx %r2,%3,%0" \ : "=r" ((USItype) (sh)), \ "=&r" ((USItype) (sl)) \ : "rJ" ((USItype) (ah)), \ @@ -1040,45 +1040,45 @@ : "r" ((USItype) (u)), \ "r" ((USItype) (v))) #define udiv_qrnnd(q, r, n1, n0, d) \ - __asm__ ("! Inlined udiv_qrnnd - wr %%g0,%2,%%y ! Not a delayed write for sparclite - tst %%g0 - divscc %3,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%%g1 - divscc %%g1,%4,%0 - rd %%y,%1 - bl,a 1f - add %1,%4,%1 -1: ! End of inline udiv_qrnnd" \ + __asm__ ("! Inlined udiv_qrnnd\n" \ +" wr %%g0,%2,%%y ! Not a delayed write for sparclite\n" \ +" tst %%g0\n" \ +" divscc %3,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%%g1\n" \ +" divscc %%g1,%4,%0\n" \ +" rd %%y,%1\n" \ +" bl,a 1f\n" \ +" add %1,%4,%1\n" \ +"1: ! End of inline udiv_qrnnd" \ : "=r" ((USItype) (q)), \ "=r" ((USItype) (r)) \ : "r" ((USItype) (n1)), \ @@ -1087,10 +1087,10 @@ : "g1" __AND_CLOBBER_CC) #define UDIV_TIME 37 #define count_leading_zeros(count, x) \ - do { \ - __asm__ ("scan %1,1,%0" \ - : "=r" ((USItype) (count)) \ - : "r" ((USItype) (x))); \ + do { \ + __asm__ ("scan %1,1,%0" \ + : "=r" ((USItype) (count)) \ + : "r" ((USItype) (x))); \ } while (0) /* Early sparclites return 63 for an argument of 0, but they warn that future implementations might change this. Therefore, leave COUNT_LEADING_ZEROS_0 @@ -1099,46 +1099,46 @@ /* SPARC without integer multiplication and divide instructions. (i.e. at least Sun4/20,40,60,65,75,110,260,280,330,360,380,470,490) */ #define umul_ppmm(w1, w0, u, v) \ - __asm__ ("! Inlined umul_ppmm - wr %%g0,%2,%%y ! SPARC has 0-3 delay insn after a wr - sra %3,31,%%o5 ! Don't move this insn - and %2,%%o5,%%o5 ! Don't move this insn - andcc %%g0,0,%%g1 ! Don't move this insn - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,%3,%%g1 - mulscc %%g1,0,%%g1 - add %%g1,%%o5,%0 - rd %%y,%1" \ + __asm__ ("! Inlined umul_ppmm\n" \ +" wr %%g0,%2,%%y ! SPARC has 0-3 delay insn after a wr\n"\ +" sra %3,31,%%o5 ! Don't move this insn\n" \ +" and %2,%%o5,%%o5 ! Don't move this insn\n" \ +" andcc %%g0,0,%%g1 ! Don't move this insn\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,%3,%%g1\n" \ +" mulscc %%g1,0,%%g1\n" \ +" add %%g1,%%o5,%0\n" \ +" rd %%y,%1" \ : "=r" ((USItype) (w1)), \ "=r" ((USItype) (w0)) \ : "%rI" ((USItype) (u)), \ @@ -1146,32 +1146,32 @@ : "g1", "o5" __AND_CLOBBER_CC) #define UMUL_TIME 39 /* 39 instructions */ /* It's quite necessary to add this much assembler for the sparc. - The default udiv_qrnnd (in C) is more than 10 times slower! */ + The default udiv_qrnnd (in C) is more than 10 times slower! */ #define udiv_qrnnd(q, r, n1, n0, d) \ - __asm__ ("! Inlined udiv_qrnnd - mov 32,%%g1 - subcc %1,%2,%%g0 -1: bcs 5f - addxcc %0,%0,%0 ! shift n1n0 and a q-bit in lsb - sub %1,%2,%1 ! this kills msb of n - addx %1,%1,%1 ! so this can't give carry - subcc %%g1,1,%%g1 -2: bne 1b - subcc %1,%2,%%g0 - bcs 3f - addxcc %0,%0,%0 ! shift n1n0 and a q-bit in lsb - b 3f - sub %1,%2,%1 ! this kills msb of n -4: sub %1,%2,%1 -5: addxcc %1,%1,%1 - bcc 2b - subcc %%g1,1,%%g1 -! Got carry from n. Subtract next step to cancel this carry. - bne 4b - addcc %0,%0,%0 ! shift n1n0 and a 0-bit in lsb - sub %1,%2,%1 -3: xnor %0,0,%0 - ! End of inline udiv_qrnnd" \ + __asm__ ("! Inlined udiv_qrnnd\n" \ +" mov 32,%%g1\n" \ +" subcc %1,%2,%%g0\n" \ +"1: bcs 5f\n" \ +" addxcc %0,%0,%0 ! shift n1n0 and a q-bit in lsb\n" \ +" sub %1,%2,%1 ! this kills msb of n\n" \ +" addx %1,%1,%1 ! so this can't give carry\n" \ +" subcc %%g1,1,%%g1\n" \ +"2: bne 1b\n" \ +" subcc %1,%2,%%g0\n" \ +" bcs 3f\n" \ +" addxcc %0,%0,%0 ! shift n1n0 and a q-bit in lsb\n" \ +" b 3f\n" \ +" sub %1,%2,%1 ! this kills msb of n\n" \ +"4: sub %1,%2,%1\n" \ +"5: addxcc %1,%1,%1\n" \ +" bcc 2b\n" \ +" subcc %%g1,1,%%g1\n" \ +"! Got carry from n. Subtract next step to cancel this carry.\n" \ +" bne 4b\n" \ +" addcc %0,%0,%0 ! shift n1n0 and a 0-bit in lsb\n" \ +" sub %1,%2,%1\n" \ +"3: xnor %0,0,%0\n" \ +" ! End of inline udiv_qrnnd" \ : "=&r" ((USItype) (q)), \ "=&r" ((USItype) (r)) \ : "r" ((USItype) (d)), \ @@ -1185,58 +1185,58 @@ #if ((defined (__sparc__) && defined (__arch64__)) \ || defined (__sparcv9)) && W_TYPE_SIZE == 64 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("addcc %r4,%5,%1 - add %r2,%3,%0 - bcs,a,pn %%xcc, 1f - add %0, 1, %0 - 1:" \ - : "=r" ((UDItype)(sh)), \ - "=&r" ((UDItype)(sl)) \ - : "%rJ" ((UDItype)(ah)), \ - "rI" ((UDItype)(bh)), \ - "%rJ" ((UDItype)(al)), \ - "rI" ((UDItype)(bl)) \ + __asm__ ("addcc %r4,%5,%1\n" \ + "add %r2,%3,%0\n" \ + "bcs,a,pn %%xcc, 1f\n" \ + "add %0, 1, %0\n" \ + "1:" \ + : "=r" ((UDItype)(sh)), \ + "=&r" ((UDItype)(sl)) \ + : "%rJ" ((UDItype)(ah)), \ + "rI" ((UDItype)(bh)), \ + "%rJ" ((UDItype)(al)), \ + "rI" ((UDItype)(bl)) \ __CLOBBER_CC) -#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("subcc %r4,%5,%1 - sub %r2,%3,%0 - bcs,a,pn %%xcc, 1f - sub %0, 1, %0 - 1:" \ - : "=r" ((UDItype)(sh)), \ - "=&r" ((UDItype)(sl)) \ - : "rJ" ((UDItype)(ah)), \ - "rI" ((UDItype)(bh)), \ - "rJ" ((UDItype)(al)), \ - "rI" ((UDItype)(bl)) \ +#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ + __asm__ ("subcc %r4,%5,%1\n" \ + "sub %r2,%3,%0\n" \ + "bcs,a,pn %%xcc, 1f\n" \ + "sub %0, 1, %0\n" \ + "1:" \ + : "=r" ((UDItype)(sh)), \ + "=&r" ((UDItype)(sl)) \ + : "rJ" ((UDItype)(ah)), \ + "rI" ((UDItype)(bh)), \ + "rJ" ((UDItype)(al)), \ + "rI" ((UDItype)(bl)) \ __CLOBBER_CC) #define umul_ppmm(wh, wl, u, v) \ do { \ UDItype tmp1, tmp2, tmp3, tmp4; \ __asm__ __volatile__ ( \ - "srl %7,0,%3 - mulx %3,%6,%1 - srlx %6,32,%2 - mulx %2,%3,%4 - sllx %4,32,%5 - srl %6,0,%3 - sub %1,%5,%5 - srlx %5,32,%5 - addcc %4,%5,%4 - srlx %7,32,%5 - mulx %3,%5,%3 - mulx %2,%5,%5 - sethi %%hi(0x80000000),%2 - addcc %4,%3,%4 - srlx %4,32,%4 - add %2,%2,%2 - movcc %%xcc,%%g0,%2 - addcc %5,%4,%5 - sllx %3,32,%3 - add %1,%3,%1 - add %5,%2,%0" \ + "srl %7,0,%3\n" \ + "mulx %3,%6,%1\n" \ + "srlx %6,32,%2\n" \ + "mulx %2,%3,%4\n" \ + "sllx %4,32,%5\n" \ + "srl %6,0,%3\n" \ + "sub %1,%5,%5\n" \ + "srlx %5,32,%5\n" \ + "addcc %4,%5,%4\n" \ + "srlx %7,32,%5\n" \ + "mulx %3,%5,%3\n" \ + "mulx %2,%5,%5\n" \ + "sethi %%hi(0x80000000),%2\n" \ + "addcc %4,%3,%4\n" \ + "srlx %4,32,%4\n" \ + "add %2,%2,%2\n" \ + "movcc %%xcc,%%g0,%2\n" \ + "addcc %5,%4,%5\n" \ + "sllx %3,32,%3\n" \ + "add %1,%3,%1\n" \ + "add %5,%2,%0" \ : "=r" ((UDItype)(wh)), \ "=&r" ((UDItype)(wl)), \ "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) \ @@ -1250,8 +1250,8 @@ #if defined (__vax__) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ - __asm__ ("addl2 %5,%1 - adwc %3,%0" \ + __asm__ ("addl2 %5,%1\n" \ + "adwc %3,%0" \ : "=g" ((USItype) (sh)), \ "=&g" ((USItype) (sl)) \ : "%0" ((USItype) (ah)), \ @@ -1259,8 +1259,8 @@ "%1" ((USItype) (al)), \ "g" ((USItype) (bl))) #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ - __asm__ ("subl2 %5,%1 - sbwc %3,%0" \ + __asm__ ("subl2 %5,%1\n" \ + "sbwc %3,%0" \ : "=g" ((USItype) (sh)), \ "=&g" ((USItype) (sl)) \ : "0" ((USItype) (ah)), \ -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Sun Mar 4 11:17:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 04 Mar 2001 11:17:00 -0000 Subject: avoid multi-line string in version-info.h References: Message-ID: In general OK but > @@ -55,7 +55,7 @@ > 3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator, > denominator) divides a UDWtype, composed by the UWtype integers > HIGH_NUMERATOR and LOW_NUMERATOR, by DENOMINATOR and places the quotient > - in QUOTIENT and the remainder in REMAINDER. HIGH_NUMERATOR must be less > + in QUOTIENT and the remainder in REMAINDER. HIGH_NUMERATOR must be less > than DENOMINATOR for correct operation. If, in addition, the most > significant bit of DENOMINATOR must be 1, then the pre-processor symbol > UDIV_NEEDS_NORMALIZATION is defined to 1. All these comment changes are not. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Mon Mar 5 10:31:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 05 Mar 2001 10:31:00 -0000 Subject: [PATCH] Use .note.ABI-tag in DSOs Message-ID: <20010305193313.B573@sunsite.ms.mff.cuni.cz> Hi! The following patch adds .note.ABI-tag to glibc DSOs, and disallows loading DSOs which are built for newer kernels than installed. The --enable-kernel info is stored in ld.so.cache as well. Note to Ulrich, the patch I've sent earlier today contained a bug in dl-cache.c, this one seems to work properly. 2001-03-05 Jakub Jelinek * csu/Makefile (abi-tag.h): Define OS and version separately, allow version to be overriden from config.h. * csu/abi-note.S: Use OS and version separately, include config.h. * elf/dl-load.c (_dl_osversion): New. (_dl_map_object_from_fd): Kill some warnings. (open_verify): Check .note.ABI-tag of the library if present. * elf/Makefile (CPPFLAGS-dl-load.c): Add -I$(csu-objpfx). * elf/cache.c (struct cache_entry): Add osversion. (print_entry): Print osversion. (print_cache): Pass osversion to it. (compare): Sort according to osversion. (save_cache): Set osversion. (add_to_cache): Add osversion argument. * elf/ldconfig.h (add_to_cache, process_file, process_elf_file): Add osversion argument. * elf/readlib.c (process_file): Likewise. * sysdeps/generic/readelflib.c (process_elf_file): Likewise. * sysdeps/unix/sysv/linux/ia64/readelflib.c (process_elf_file, process_elf32_file, process_elf64_file): Likewise. * sysdeps/unix/sysv/linux/i386/readelflib.c (process_elf_file, process_elf32_file, process_elf64_file): Likewise. * sysdeps/unix/sysv/linux/sparc/readelflib.c (process_elf_file, process_elf32_file, process_elf64_file): Likewise. * elf/ldconfig.c (manual_link, search_dir): Pass it. * sysdeps/generic/dl-cache.c (_dl_load_cache_lookup): Check osversion. * sysdeps/generic/ldsodefs.h (_dl_osversion): Declare. * sysdeps/unix/sysv/linux/init-first.c: Include ldsodefs.h. * sysdeps/unix/sysv/linux/dl-osinfo.h (DL_SYSDEP_OSCHECK): Save kernel version in _dl_osversion. * sysdeps/unix/sysv/linux/configure.in: Define __ABI_TAG_VERSION. * sysdeps/unix/sysv/linux/configure: Rebuilt. * Makerules (build-shlib-helper, build-module-helper): New. (build-shlib, build-module-helper): Make sure .note.ABI-tag comes early. * config.h.in (__ABI_TAG_VERSION): Add. --- libc/csu/Makefile.jj Mon Mar 5 11:57:45 2001 +++ libc/csu/Makefile Mon Mar 5 12:52:56 2001 @@ -168,12 +168,17 @@ $(objpfx)abi-tag.h: $(..)abi-tags $(make-target-directory) rm -f $@.new sed -e 's/#.*$$//' -e '/^[ ]*$$/d' $< | \ - while read conf tag; do \ + while read conf tagos tagver; do \ test `expr '$(config-machine)-$(config-vendor)-$(config-os)' \ : "$$conf"` != 0 || continue; \ - echo "$$tag" | \ - sed -e 's/[^0-9xXa-fA-F]/ /g' -e 's/ *$$//' \ - -e 's/ /,/g' -e 's/^ */#define ABI_TAG /' > $@.new; \ + ( echo "$$tagos" | \ + sed -e 's/[^0-9xXa-fA-F ]//' \ + -e 's/^/#define __ABI_TAG_OS /'; \ + echo "#ifndef __ABI_TAG_VERSION"; \ + echo "$$tagver" | \ + sed -e 's/[^0-9xXa-fA-F]/ /g' -e 's/ *$$//' \ + -e 's/ /,/g' -e 's/^/# define __ABI_TAG_VERSION /'; \ + echo "#endif" ) > $@.new; \ done if test -r $@.new; then mv -f $@.new $@; \ else echo >&2 'This configuration not matched in $<'; exit 1; fi --- libc/csu/abi-note.S.jj Thu Nov 23 14:41:37 2000 +++ libc/csu/abi-note.S Mon Mar 5 12:53:09 2001 @@ -1,5 +1,5 @@ /* Special .init and .fini section support. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it @@ -54,6 +54,7 @@ offset length contents identify the earliest release of that OS that supports this ABI. See abi-tags (top level) for details. */ +#include #include /* OS-specific ABI tag value */ /* The linker (GNU ld 2.8 and later) recognizes an allocated section whose @@ -67,5 +68,6 @@ offset length contents .long 1 /* note type */ 0: .asciz "GNU" /* vendor name */ 1: .align 4 -2: .long ABI_TAG /* note data: the ABI tag */ +2: .long __ABI_TAG_OS /* note data: the ABI tag */ + .long __ABI_TAG_VERSION 3: .align 4 /* pad out section */ --- libc/elf/dl-load.c.jj Fri Mar 2 13:44:29 2001 +++ libc/elf/dl-load.c Mon Mar 5 16:19:11 2001 @@ -30,6 +30,8 @@ #include #include #include "dynamic-link.h" +#include +#include #include @@ -111,6 +113,8 @@ struct filebuf size_t _dl_pagesize; +unsigned int _dl_osversion; + int _dl_clktck; extern const char *_dl_platform; @@ -1061,12 +1065,12 @@ _dl_map_object_from_fd (const char *name if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) _dl_debug_printf (" dynamic: 0x%0*lx base: 0x%0*lx size: 0x%0*Zx\n" " entry: 0x%0*lx phdr: 0x%0*lx phnum: %*u\n\n", - sizeof (void *) * 2, (unsigned long int) l->l_ld, - sizeof (void *) * 2, (unsigned long int) l->l_addr, - sizeof (void *) * 2, maplength, - sizeof (void *) * 2, (unsigned long int) l->l_entry, - sizeof (void *) * 2, (unsigned long int) l->l_phdr, - sizeof (void *) * 2, l->l_phnum); + (int) sizeof (void *) * 2, (unsigned long int) l->l_ld, + (int) sizeof (void *) * 2, (unsigned long int) l->l_addr, + (int) sizeof (void *) * 2, maplength, + (int) sizeof (void *) * 2, (unsigned long int) l->l_entry, + (int) sizeof (void *) * 2, (unsigned long int) l->l_phdr, + (int) sizeof (void *) * 2, l->l_phnum); elf_get_dynamic_info (l); @@ -1213,6 +1217,10 @@ open_verify (const char *name, struct fi [EI_OSABI] = ELFOSABI_SYSV, [EI_ABIVERSION] = 0 }; + static const struct { + ElfW(Word) vendorlen, datalen, type; + char vendor [4]; + } expected_note = { 4, 16, 1, "GNU" }; int fd; /* Open the file. We always open files read-only. */ @@ -1220,6 +1228,10 @@ open_verify (const char *name, struct fi if (fd != -1) { ElfW(Ehdr) *ehdr; + ElfW(Phdr) *phdr, *ph; + ElfW(Word) *abi_note, abi_note_buf[8]; + unsigned int osversion; + size_t maplength; /* We successfully openened the file. Now verify it is a file we can use. */ @@ -1287,12 +1299,7 @@ open_verify (const char *name, struct fi lose (0, fd, name, NULL, NULL, N_("ELF file version does not match current one")); if (! __builtin_expect (elf_machine_matches_host (ehdr), 1)) - { - close_and_out: - __close (fd); - __set_errno (ENOENT); - fd = -1; - } + goto close_and_out; else if (__builtin_expect (ehdr->e_phentsize, sizeof (ElfW(Phdr))) != sizeof (ElfW(Phdr))) lose (0, fd, name, NULL, NULL, @@ -1301,6 +1308,50 @@ open_verify (const char *name, struct fi && __builtin_expect (ehdr->e_type, ET_EXEC) != ET_EXEC) lose (0, fd, name, NULL, NULL, N_("only ET_DYN and ET_EXEC can be loaded")); + + maplength = ehdr->e_phnum * sizeof (ElfW(Phdr)); + if (ehdr->e_phoff + maplength <= fbp->len) + phdr = (void *) (fbp->buf + ehdr->e_phoff); + else + { + phdr = alloca (maplength); + __lseek (fd, SEEK_SET, ehdr->e_phoff); + if (__libc_read (fd, (void *) phdr, maplength) != maplength) + lose (errno, fd, name, NULL, NULL, N_("cannot read file data")); + } + + /* Check .note.ABI-tag if present. */ + for (ph = phdr; ph < &phdr[ehdr->e_phnum]; ++ph) + if (ph->p_type == PT_NOTE && ph->p_filesz == 32 && ph->p_align >= 4) + { + if (ph->p_offset + 32 <= fbp->len) + abi_note = (void *) (fbp->buf + ph->p_offset); + else + { + __lseek (fd, SEEK_SET, ph->p_offset); + if (__libc_read (fd, (void *) abi_note_buf, 32) != 32) + lose (errno, fd, name, NULL, NULL, + N_("cannot read file data")); + abi_note = abi_note_buf; + } + + if (memcmp (abi_note, &expected_note, sizeof (expected_note))) + continue; + + osversion = (abi_note [5] & 0xff) * 65536 + + (abi_note [6] & 0xff) * 256 + + (abi_note [7] & 0xff); + if (abi_note [4] != __ABI_TAG_OS + || (_dl_osversion && _dl_osversion < osversion)) + { + close_and_out: + __close (fd); + __set_errno (ENOENT); + fd = -1; + } + + break; + } } return fd; --- libc/elf/Makefile.jj Mon Mar 5 11:57:47 2001 +++ libc/elf/Makefile Mon Mar 5 13:48:02 2001 @@ -188,7 +188,7 @@ $(objpfx)trusted-dirs.st: Makefile $(..) | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T}; $(move-if-change) ${@:st=T} ${@:st=h} touch $@ -CPPFLAGS-dl-load.c = -I$(objpfx). +CPPFLAGS-dl-load.c = -I$(objpfx). -I$(csu-objpfx). ifeq (yes,$(build-shared)) $(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force) --- libc/elf/ldconfig.c.jj Tue Feb 6 11:19:58 2001 +++ libc/elf/ldconfig.c Mon Mar 5 17:47:20 2001 @@ -463,6 +463,7 @@ manual_link (char *library) char *soname; struct stat64 stat_buf; int flag; + unsigned int osversion; /* Prepare arguments for create_links call. Split library name in directory and filename first. Since path is allocated, we've got @@ -527,7 +528,8 @@ manual_link (char *library) free (path); return; } - if (process_file (real_library, library, libname, &flag, &soname, 0)) + if (process_file (real_library, library, libname, &flag, &osversion, + &soname, 0)) { error (0, 0, _("No link created since soname could not be found for %s"), library); @@ -588,6 +590,7 @@ search_dir (const struct dir_entry *entr struct stat64 stat_buf; int is_link; uint64_t hwcap = path_hwcap (entry->path); + unsigned int osversion; file_name_len = PATH_MAX; file_name = alloca (file_name_len); @@ -703,7 +706,7 @@ search_dir (const struct dir_entry *entr real_name = real_file_name; if (process_file (real_name, file_name, direntry->d_name, &flag, - &soname, is_link)) + &osversion, &soname, is_link)) { if (real_name != real_file_name) free (real_name); @@ -800,7 +803,8 @@ search_dir (const struct dir_entry *entr create_links (dir_name, entry->path, dlib_ptr->name, dlib_ptr->soname); if (opt_build_cache) - add_to_cache (entry->path, dlib_ptr->soname, dlib_ptr->flag, hwcap); + add_to_cache (entry->path, dlib_ptr->soname, dlib_ptr->flag, osversion, + hwcap); } /* Free all resources. */ --- libc/elf/readlib.c.jj Sat Sep 30 07:46:11 2000 +++ libc/elf/readlib.c Mon Mar 5 15:27:34 2001 @@ -69,7 +69,8 @@ static struct known_names known_libs [] /* Returns 0 if everything is ok, != 0 in case of error. */ int process_file (const char *real_file_name, const char *file_name, - const char *lib, int *flag, char **soname, int is_link) + const char *lib, int *flag, unsigned int *osversion, + char **soname, int is_link) { FILE *file; struct stat64 statbuf; @@ -160,8 +161,8 @@ process_file (const char *real_file_name goto done; } - if (process_elf_file (file_name, lib, flag, soname, file_contents, - statbuf.st_size)) + if (process_elf_file (file_name, lib, flag, osversion, soname, + file_contents, statbuf.st_size)) ret = 1; done: --- libc/elf/ldconfig.h.jj Mon Nov 20 13:47:58 2000 +++ libc/elf/ldconfig.h Mon Mar 5 15:44:36 2001 @@ -39,17 +39,17 @@ extern void init_cache (void); extern void save_cache (const char *cache_name); extern void add_to_cache (const char *path, const char *lib, int flags, - uint64_t hwcap); + unsigned int osversion, uint64_t hwcap); /* Declared in readlib.c. */ extern int process_file (const char *real_file_name, const char *file_name, - const char *lib, int *flag, char **soname, - int is_link); + const char *lib, int *flag, unsigned int *osversion, + char **soname, int is_link); /* Declared in readelflib.c. */ extern int process_elf_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, - size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); /* Declared in chroot_canon.c. */ extern char *chroot_canon (const char *chroot, const char *name); --- libc/elf/cache.c.jj Mon Mar 5 11:56:21 2001 +++ libc/elf/cache.c Mon Mar 5 17:54:56 2001 @@ -39,6 +39,7 @@ struct cache_entry char *lib; /* Library name. */ char *path; /* Path to find library. */ int flags; /* Flags to indicate kind of library. */ + unsigned int osversion; /* Required OS version. */ uint64_t hwcap; /* Important hardware capabilities. */ int bits_hwcap; /* Number of bits set in hwcap. */ struct cache_entry *next; /* Next entry in list. */ @@ -52,7 +53,8 @@ static const char *flag_descr[] = /* Print a single entry. */ static void -print_entry (const char *lib, int flag, uint64_t hwcap, const char *key) +print_entry (const char *lib, int flag, unsigned int osversion, + uint64_t hwcap, const char *key) { printf ("\t%s (", lib); switch (flag & FLAG_TYPE_MASK) @@ -85,6 +87,23 @@ print_entry (const char *lib, int flag, } if (hwcap != 0) printf (", hwcap: 0x%" PRIx64, hwcap); + if (osversion != 0) + { + static const char * const abi_tag_os [] = + { + [0] = "Linux", + [1] = "Hurd", + [2] = "Solaris", + [3] = "Unknown OS" + }; + unsigned int os = osversion >> 24; + + printf (", OS ABI: %s %d.%d.%d", + abi_tag_os [os > 3 ? 3 : os], + (osversion >> 16) & 0xff, + (osversion >> 8) & 0xff, + osversion & 0xff); + } printf (") => %s\n", key); } @@ -167,7 +186,7 @@ print_cache (const char *cache_name) /* Print everything. */ for (i = 0; i < cache->nlibs; i++) print_entry (cache_data + cache->libs[i].key, - cache->libs[i].flags, 0, + cache->libs[i].flags, 0, 0, cache_data + cache->libs[i].value); } else if (format == 1) @@ -178,6 +197,7 @@ print_cache (const char *cache_name) for (i = 0; i < cache_new->nlibs; i++) print_entry (cache_data + cache_new->libs[i].key, cache_new->libs[i].flags, + cache_new->libs[i].osversion, cache_new->libs[i].hwcap, cache_data + cache_new->libs[i].value); } @@ -217,6 +237,10 @@ int compare (const struct cache_entry *e return 1; else if (e2->hwcap < e1->hwcap) return -1; + if (e2->osversion > e1->osversion) + return 1; + if (e2->osversion < e1->osversion) + return -1; } return res; } @@ -319,9 +343,9 @@ save_cache (const char *cache_name) always begins at the beginning of the the new cache struct. */ file_entries_new->libs[idx_new].flags = entry->flags; + file_entries_new->libs[idx_new].osversion = entry->osversion; file_entries_new->libs[idx_new].hwcap = entry->hwcap; file_entries_new->libs[idx_new].key = str_offset; - file_entries_new->libs[idx_new].__unused = 0; } len = strlen (entry->lib); str = stpcpy (str, entry->lib); @@ -414,7 +438,7 @@ save_cache (const char *cache_name) /* Add one library to the cache. */ void add_to_cache (const char *path, const char *lib, int flags, - uint64_t hwcap) + unsigned int osversion, uint64_t hwcap) { struct cache_entry *new_entry, *ptr, *prev; char *full_path; @@ -430,6 +454,7 @@ add_to_cache (const char *path, const ch new_entry->lib = xstrdup (lib); new_entry->path = full_path; new_entry->flags = flags; + new_entry->osversion = osversion; new_entry->hwcap = hwcap; new_entry->bits_hwcap = 0; --- libc/sysdeps/generic/ldsodefs.h.jj Fri Mar 2 13:44:46 2001 +++ libc/sysdeps/generic/ldsodefs.h Mon Mar 5 13:59:26 2001 @@ -173,6 +173,9 @@ extern char **_dl_argv; /* Cached value of `getpagesize ()'. */ extern size_t _dl_pagesize; +/* OS version. */ +extern unsigned int _dl_osversion; + /* File descriptor referring to the zero-fill device. */ extern int _dl_zerofd; --- libc/sysdeps/generic/dl-cache.h.jj Thu Nov 2 08:52:18 2000 +++ libc/sysdeps/generic/dl-cache.h Mon Mar 5 14:42:00 2001 @@ -76,7 +76,7 @@ struct file_entry_new { int32_t flags; /* This is 1 for an ELF library. */ uint32_t key, value; /* String table indices. */ - uint32_t __unused; /* Align next field always on 8 byte boundary. */ + uint32_t osversion; /* Required OS version. */ uint64_t hwcap; /* Hwcap entry. */ }; --- libc/sysdeps/generic/readelflib.c.jj Thu Nov 30 13:17:23 2000 +++ libc/sysdeps/generic/readelflib.c Mon Mar 5 16:23:48 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 1999 and Jakub Jelinek , 1999. @@ -41,7 +41,8 @@ do \ /* Returns 0 if everything is ok, != 0 in case of error. */ int process_elf_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length) + unsigned int *osversion, char **soname, void *file_contents, + size_t file_length) { int i; unsigned int j; @@ -56,6 +57,7 @@ process_elf_file (const char *file_name, char *dynamic_strings; elf_header = (ElfW(Ehdr) *) file_contents; + *osversion = 0; if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS)) { @@ -110,6 +112,7 @@ process_elf_file (const char *file_name, dynamic_addr = segment->p_offset; dynamic_size = segment->p_filesz; break; + case PT_INTERP: program_interpreter = (char *) (file_contents + segment->p_offset); check_ptr (program_interpreter); @@ -123,6 +126,21 @@ process_elf_file (const char *file_name, break; } break; + + case PT_NOTE: + if (!*osversion && segment->p_filesz == 32 && segment->p_align >= 4) + { + ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents + + segment->p_offset); + if (abi_note [0] == 4 && abi_note [1] == 16 && abi_note [2] == 1 + && memcmp (abi_note + 3, "GNU", 4) == 0) + *osversion = (abi_note [4] << 24) | + ((abi_note [5] & 0xff) << 16) | + ((abi_note [6] & 0xff) << 8) | + (abi_note [7] & 0xff); + } + break; + default: break; } --- libc/sysdeps/generic/dl-cache.c.jj Fri Mar 2 17:39:33 2001 +++ libc/sysdeps/generic/dl-cache.c Mon Mar 5 20:30:15 2001 @@ -228,6 +228,8 @@ _dl_load_cache_lookup (const char *name) /* Only accept hwcap if it's for the right platform. */ #define HWCAP_CHECK \ + if (_dl_osversion && cache_new->libs[middle].osversion > _dl_osversion) \ + continue; \ if (_DL_PLATFORMS_COUNT && platform != -1 \ && (cache_new->libs[middle].hwcap & _DL_HWCAP_PLATFORM) != 0 \ && (cache_new->libs[middle].hwcap & _DL_HWCAP_PLATFORM) != platform) \ --- libc/sysdeps/unix/sysv/linux/ia64/readelflib.c.jj Sat Sep 30 00:42:21 2000 +++ libc/sysdeps/unix/sysv/linux/ia64/readelflib.c Mon Mar 5 15:26:04 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001 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 @@ -18,25 +18,28 @@ int process_elf32_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); int process_elf64_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); /* Returns 0 if everything is ok, != 0 in case of error. */ int process_elf_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length) + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length) { ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; int ret; if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) - return process_elf32_file (file_name, lib, flag, soname, file_contents, - file_length); + return process_elf32_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); else { - ret = process_elf64_file (file_name, lib, flag, soname, file_contents, - file_length); + ret = process_elf64_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); /* Intel 64bit libraries are always libc.so.6+. */ if (!ret) *flag = FLAG_IA64_LIB64|FLAG_ELF_LIBC6; --- libc/sysdeps/unix/sysv/linux/i386/readelflib.c.jj Sat Sep 30 23:46:37 2000 +++ libc/sysdeps/unix/sysv/linux/i386/readelflib.c Mon Mar 5 15:23:58 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 1999 and Jakub Jelinek , 2000. @@ -20,23 +20,24 @@ int process_elf32_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, - size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); int process_elf64_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, - size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); /* Returns 0 if everything is ok, != 0 in case of error. */ int process_elf_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length) + unsigned int *osversion, char **soname, void *file_contents, + size_t file_length) { ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; int ret; if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) - return process_elf32_file (file_name, lib, flag, soname, file_contents, - file_length); + return process_elf32_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); else { switch (elf_header->e_machine) @@ -50,8 +51,8 @@ process_elf_file (const char *file_name, return 1; } - ret = process_elf64_file (file_name, lib, flag, soname, file_contents, - file_length); + ret = process_elf64_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); /* IA64/X86-64 64bit libraries are always libc.so.6+. */ if (!ret) switch (elf_header->e_machine) --- libc/sysdeps/unix/sysv/linux/sparc/readelflib.c.jj Wed May 31 23:03:01 2000 +++ libc/sysdeps/unix/sysv/linux/sparc/readelflib.c Mon Mar 5 15:26:42 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 1999 and Jakub Jelinek , 1999. @@ -20,27 +20,28 @@ int process_elf32_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, - size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); int process_elf64_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, - size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); /* Returns 0 if everything is ok, != 0 in case of error. */ int process_elf_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length) + unsigned int *osversion, char **soname, void *file_contents, + size_t file_length) { ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; int ret; if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) - return process_elf32_file (file_name, lib, flag, soname, file_contents, - file_length); + return process_elf32_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); else { - ret = process_elf64_file (file_name, lib, flag, soname, file_contents, - file_length); + ret = process_elf64_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); /* Sparc 64bit libraries are always libc.so.6+. */ if (!ret) *flag = FLAG_SPARC_LIB64|FLAG_ELF_LIBC6; --- libc/sysdeps/unix/sysv/linux/configure.in.jj Thu Nov 2 08:52:21 2000 +++ libc/sysdeps/unix/sysv/linux/configure.in Mon Mar 5 12:55:27 2001 @@ -74,6 +74,7 @@ if test -n "$minimum_kernel"; then AC_MSG_CHECKING(for kernel header at least $minimum_kernel) changequote(,)dnl decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`; + abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`; changequote([,])dnl AC_EGREP_CPP([eat flaming death], [#include #if LINUX_VERSION_CODE < $decnum @@ -82,6 +83,7 @@ eat flaming death AC_MSG_RESULT($libc_minimum_kernel) if test "$libc_minimum_kernel" = ok; then AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum) + AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum) else AC_MSG_ERROR([*** The available kernel headers are older than the requested *** compatible kernel version]) --- libc/sysdeps/unix/sysv/linux/configure.jj Thu Nov 2 08:52:21 2000 +++ libc/sysdeps/unix/sysv/linux/configure Mon Mar 5 12:55:39 2001 @@ -87,6 +87,7 @@ if test -n "$minimum_kernel"; then echo $ac_n "checking for kernel header at least $minimum_kernel""... $ac_c" 1>&6 echo "configure:89: checking for kernel header at least $minimum_kernel" >&5 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`; + abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`; cat > conftest.$ac_ext <> confdefs.h <> confdefs.h < #ifndef SHARED +# include # include "dl-osinfo.h" #endif --- libc/Makerules.jj Fri Feb 9 13:50:59 2001 +++ libc/Makerules Mon Mar 5 17:54:09 2001 @@ -413,29 +413,75 @@ endif lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(+interp) $(build-shlib) -define build-shlib -$(LINK.o) -shared -Wl,-O1 -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \ +define build-shlib-helper +$(LINK.o) -shared -Wl,-O1 $(sysdep-LDFLAGS) $(config-LDFLAGS) \ $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \ $(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \ -Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \ $(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \ - -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \ - -Wl,--whole-archive \ + -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) +endef + +ifeq (yes,$(elf)) +# binutils only position loadable notes into the first page for binaries, +# not for shared objects +define build-shlib +$(build-shlib-helper) \ + -o $@.new $(csu-objpfx)/abi-note.o -Wl,--verbose \ + $(LDLIBS-$(@F:lib%.so=%).so) 2>&1 | \ + sed -e '/^=========/,/^=========/!d;/^=========/d' \ + -e 's/^.*\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \ + > $@.lds; \ + rm -f $@.new; \ + $(build-shlib-helper) -o $@ -T $@.lds \ + -Wl,--whole-archive $(csu-objpfx)/abi-note.o \ + $(filter-out $(map-file) $(+preinit) $(+postinit),$^) \ + $(no-whole-archive) $(LDLIBS-$(@F:lib%.so=%).so); \ + rm -f $@.lds +endef +else +define build-shlib +$(build-shlib-helper) \ + -o $@ -Wl,--whole-archive \ $(filter-out $(map-file) $(+preinit) $(+postinit),$^) \ $(no-whole-archive) $(LDLIBS-$(@F:lib%.so=%).so) endef +endif + +define build-module-helper \ +$(LINK.o) -shared $(sysdep-LDFLAGS) $(config-LDFLAGS) \ + -B$(csu-objpfx) $(load-map-file) \ + $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \ + -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) +endef # This macro is similar to build-shlib but it does not define a soname # and it does not depend on the destination name to start with `lib'. +ifeq (yes,$(elf)) +# binutils only position loadable notes into the first page for binaries, +# not for shared objects define build-module -$(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \ - -B$(csu-objpfx) $(load-map-file) \ - $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \ - -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \ - -Wl,--whole-archive \ +$(build-module-helper) \ + -o $@.new $(csu-objpfx)/abi-note.o -Wl,--verbose \ + $(LDLIBS-$(@F:lib%.so=%).so) 2>&1 | \ + sed -e '/^=========/,/^=========/!d;/^=========/d' \ + -e 's/^.*\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \ + > $@.lds; \ + rm -f $@.new; \ + $(build-module-helper) -o $@ -T $@.lds \ + -Wl,--whole-archive $(csu-objpfx)/abi-note.o \ + $(filter-out $(map-file) $(+preinit) $(+postinit),$^) \ + $(no-whole-archive) $(LDLIBS-$(@F:lib%.so=%).so); \ + rm -f $@.lds +endef +else +define build-module +$(build-module-helper) \ + -o $@ -Wl,--whole-archive \ $(filter-out $(map-file) $(+preinit) $(+postinit),$^) \ $(no-whole-archive) $(LDLIBS-$(@F:%.so=%).so) endef +endif # Don't try to use -lc when making libc.so itself. # Also omits crti.o and crtn.o, which we do not want --- libc/config.h.in.jj Fri Dec 8 13:52:11 2000 +++ libc/config.h.in Mon Mar 5 12:57:08 2001 @@ -93,6 +93,9 @@ /* Linux specific: minimum supported kernel version. */ #undef __LINUX_KERNEL_VERSION +/* Override abi-tags ABI version if necessary. */ +#undef __ABI_TAG_VERSION + /* An extension in gcc 2.96 and up allows the subtraction of two local labels. */ #undef HAVE_SUBTRACT_LOCAL_LABELS Jakub From jakub@redhat.com Mon Mar 5 10:51:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 05 Mar 2001 10:51:00 -0000 Subject: libanl + atexit + more References: Message-ID: <20010305195308.C573@sunsite.ms.mff.cuni.cz> On Sat, Mar 03, 2001 at 10:38:44AM -0800, Ulrich Drepper wrote: > Second, I haven't gotten any comments on the atexit() implementation > changes I made. They are so non-obvious that I thought the one or Here is one: why is __new_exitfn exported? atexit in libc_nonshared just calls __cxa_atexit and I don't see anything but __cxa_atexit and __on_exit which would use it, plus if it is not exported it won't have to go through PLT. Jakub From aj@suse.de Mon Mar 5 12:47:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Mon, 05 Mar 2001 12:47:00 -0000 Subject: libanl + atexit + more References: Message-ID: Ulrich Drepper writes: > Second, I haven't gotten any comments on the atexit() implementation > changes I made. They are so non-obvious that I thought the one or > other would comment. The good thing is that this implementation > should be very robust. The bad thing is that old programs cannot be > fixed, everything (means DSOs) has to be relinked (if they have this > problem which is fortunately rare). I don't think this is a problem. > Note that today (until sometime next week :-) this atexit() > implementation is not Unix conforming. Unix currently forbids this > behavior (this means the registered functions are called at dlclose() > time). I've filed an defect report which will be handled next week. make check fails now for me: GCONV_PATH=/builds/glibc/main-gcc-2.95/iconvdata LC_ALL=C /builds/glibc/main-gcc-2.95/elf/ld-linux.so.2 --library-path /builds/glibc/main-gcc-2.95:/builds/glibc/main-gcc-2.95/math:/builds/glibc/main-gcc-2.95/elf:/builds/glibc/main-gcc-2.95/dlfcn:/builds/glibc/main-gcc-2.95/nss:/builds/glibc/main-gcc-2.95/nis:/builds/glibc/main-gcc-2.95/rt:/builds/glibc/main-gcc-2.95/resolv:/builds/glibc/main-gcc-2.95/crypt:/builds/glibc/main-gcc-2.95/linuxthreads /builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit > /builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit.out make[2]: *** [/builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit.out] Error 1 gromit:/builds/glibc/main-gcc-2.95:[0]$ cat dlfcn/tstcxaatexit.out cannot open "modcxaatexit.so": /builds/glibc/main-gcc-2.95/dlfcn/modcxaatexit.so: undefined symbol: __dso_handle This is with gcc 2.95.2. With a 3.0 pre release I get a segmentation fault, I'll send details tomorrow. Both happens on i686-linux, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aj@suse.de Mon Mar 5 12:52:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Mon, 05 Mar 2001 12:52:00 -0000 Subject: libanl + atexit + more References: Message-ID: Andreas Jaeger writes: > Ulrich Drepper writes: > > > Second, I haven't gotten any comments on the atexit() implementation > > changes I made. They are so non-obvious that I thought the one or > > other would comment. The good thing is that this implementation > > should be very robust. The bad thing is that old programs cannot be > > fixed, everything (means DSOs) has to be relinked (if they have this > > problem which is fortunately rare). I don't think this is a problem. > > Note that today (until sometime next week :-) this atexit() > > implementation is not Unix conforming. Unix currently forbids this > > behavior (this means the registered functions are called at dlclose() > > time). I've filed an defect report which will be handled next week. > > make check fails now for me: > > GCONV_PATH=/builds/glibc/main-gcc-2.95/iconvdata LC_ALL=C /builds/glibc/main-gcc-2.95/elf/ld-linux.so.2 --library-path /builds/glibc/main-gcc-2.95:/builds/glibc/main-gcc-2.95/math:/builds/glibc/main-gcc-2.95/elf:/builds/glibc/main-gcc-2.95/dlfcn:/builds/glibc/main-gcc-2.95/nss:/builds/glibc/main-gcc-2.95/nis:/builds/glibc/main-gcc-2.95/rt:/builds/glibc/main-gcc-2.95/resolv:/builds/glibc/main-gcc-2.95/crypt:/builds/glibc/main-gcc-2.95/linuxthreads /builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit > /builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit.out > make[2]: *** [/builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit.out] Error 1 > > gromit:/builds/glibc/main-gcc-2.95:[0]$ cat dlfcn/tstcxaatexit.out > cannot open "modcxaatexit.so": /builds/glibc/main-gcc-2.95/dlfcn/modcxaatexit.so: undefined symbol: __dso_handle > > > This is with gcc 2.95.2. With a 3.0 pre release I get a segmentation > fault, I'll send details tomorrow. It's not tomorrow ;-) but here's the failure: gromit:/usr/src/cvs/libc/dlfcn:[0]$ GCONV_PATH=/builds/glibc/20010106-gcc-2.97.test/iconvdata LC_ALL=C /builds/glibc/20010106-gcc-2.97.test/elf/ld-linux.so.2 --library-path /builds/glibc/20010106-gcc-2.97.test:/builds/glibc/20010106-gcc-2.97.test/math:/builds/glibc/20010106-gcc-2.97.test/elf:/builds/glibc/20010106-gcc-2.97.test/dlfcn:/builds/glibc/20010106-gcc-2.97.test/nss:/builds/glibc/20010106-gcc-2.97.test/nis:/builds/glibc/20010106-gcc-2.97.test/rt:/builds/glibc/20010106-gcc-2.97.test/resolv:/builds/glibc/20010106-gcc-2.97.test/crypt:/builds/glibc/20010106-gcc-2.97.test/linuxthreads /builds/glibc/20010106-gcc-2.97.test/dlfcn/tstcxaatexit This is bar module unload didn't change `v' Segmentation fault Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From kkojima@rr.iij4u.or.jp Mon Mar 5 23:07:00 2001 From: kkojima@rr.iij4u.or.jp (kaz Kojima) Date: Mon, 05 Mar 2001 23:07:00 -0000 Subject: A missing comma Message-ID: <200103060707.QAA13430@rr.iij4u.or.jp> Hi, There is a missing comma in sysdeps/sh/dl-machine.h. kaz -- Index: dl-machine.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/sh/dl-machine.h,v retrieving revision 1.5 diff -u -r1.5 dl-machine.h --- dl-machine.h 2001/02/28 06:35:24 1.5 +++ dl-machine.h 2001/03/06 06:38:42 @@ -462,7 +462,7 @@ strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]); _dl_error_printf ("\ -%s: Symbol `%s' has different size in shared object, consider re-linking\n" +%s: Symbol `%s' has different size in shared object, consider re-linking\n", _dl_argv[0] ?: "", strtab + refsym->st_name); } From aj@suse.de Mon Mar 5 23:30:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Mon, 05 Mar 2001 23:30:00 -0000 Subject: A missing comma References: <200103060707.QAA13430@rr.iij4u.or.jp> Message-ID: kaz Kojima writes: > Hi, > > There is a missing comma in sysdeps/sh/dl-machine.h. Thanks, I've committed the patch, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Tue Mar 6 04:39:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 06 Mar 2001 04:39:00 -0000 Subject: [PATCH] Fix _dl_map_object Message-ID: <20010306114538.D573@sunsite.ms.mff.cuni.cz> Hi! The l->l_opencount == 0 test in _dl_map_object is not very good in the new reference counting model, since ld.so will open/read/fstat/close the same library multiple times if it is being added more than once during the same dlopen call (or during dl_main), because l_opencount is bumped after all dependencies are loaded (e.g. if a program has DT_NEEDED libc.so.6 and libfoo.so.0 and libfoo.so.0 has DT_NEEDED libc.so.6, then libc.so.6 will be open_verify'ed twice and caught by the later _dl_map_object_from_fd st_ino + st_dev check). Looking at October 18'th code (right before reference counting changes), l_opencount was bumped immediately after _dl_new_object, with the single exception when creating the fake entry if the library is not found. So, IMHO either the test should go away completely (if we'll take fake entries as sufficient) or replaced with l_faked test (if ld.so should try again to find that library). I've attached both alternatives. Jakub From aj@suse.de Tue Mar 6 04:52:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Tue, 06 Mar 2001 04:52:00 -0000 Subject: Cosmetic dl-machine cleanups Message-ID: Looking through the dynamic linker implementations, I noticed some obsolete stuff. Ok to commit? Andreas 2001-03-06 Andreas Jaeger * sysdeps/s390/dl-machine.h (elf_machine_relplt): Removed, it's not needed. (elf_machine_pltrel_p): Likewise. * sysdeps/powerpc/dl-machine.h: Likewise. * sysdeps/generic/dl-machine.h (elf_machine_pltrel_p): Likewise. ============================================================ Index: sysdeps/s390/dl-machine.h --- sysdeps/s390/dl-machine.h 2000/11/02 14:16:07 1.1.1.1 +++ sysdeps/s390/dl-machine.h 2001/03/06 12:51:51 @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. S390 Version. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2001 Free Software Foundation, Inc. Contributed by Carl Pederson & Martin Schwidefsky. This file is part of the GNU C Library. @@ -221,9 +221,6 @@ "); #endif -/* The PLT uses Elf32_Rela relocs. */ -#define elf_machine_relplt elf_machine_rela - /* Mask identifying addresses reserved for the user program, where the dynamic linker should not map anything. */ #define ELF_MACHINE_USER_ADDRESS_MASK 0xf8000000UL @@ -304,10 +301,6 @@ #define RTLD_START_SPECIAL_INIT /* nothing */ #endif -/* Nonzero iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. */ -#define elf_machine_pltrel_p(type) ((type) == R_390_JMP_SLOT) - /* Nonzero iff TYPE should not be allowed to resolve to one of the main executable's symbols, as for a COPY reloc. */ #define elf_machine_lookup_noexec_p(type) ((type) == R_390_COPY) @@ -430,7 +423,7 @@ } case R_390_PC32: - *reloc_addr = value +reloc->r_addend - (Elf32_Addr) reloc_addr; + *reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr; break; case R_390_NONE: break; ============================================================ Index: sysdeps/powerpc/dl-machine.h --- sysdeps/powerpc/dl-machine.h 2000/11/02 14:16:06 1.1.1.1 +++ sysdeps/powerpc/dl-machine.h 2001/03/06 12:51:51 @@ -1,6 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. PowerPC version. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 - Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 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 @@ -226,10 +225,6 @@ /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_PPC_JMP_SLOT - -/* Nonzero iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. */ -#define elf_machine_pltrel_p(type) ((type) == R_PPC_JMP_SLOT) /* Set up the loaded object described by L so its unrelocated PLT entries will jump to the on-demand fixup code in dl-runtime.c. ============================================================ Index: sysdeps/generic/dl-machine.h --- sysdeps/generic/dl-machine.h 2000/11/02 14:15:38 1.1.1.1 +++ sysdeps/generic/dl-machine.h 2001/03/06 12:51:51 @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. Stub version. - Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1999, 2000, 2001 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 @@ -97,11 +97,6 @@ _dl_signal_error (0, "Elf32_Rela relocation requested -- unused on " ELF_MACHINE_NAME); } - - -/* Nonzero iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. */ -#define elf_machine_pltrel_p(type) ((type) == R_???_JMP_SLOT) /* Set up the loaded object described by L so its unrelocated PLT -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aj@suse.de Tue Mar 6 06:55:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Tue, 06 Mar 2001 06:55:00 -0000 Subject: Patch for i386 libm-test-ulps Message-ID: On both my P3 and my Athlon with both gcc 2.95.2 and gcc from CVS, I got some problems libm-test after the constants have been changed to long double. I've committed the appended patch, Andreas 2001-03-06 Andreas Jaeger * sysdeps/i386/fpu/libm-test-ulps: Add some deltas. ============================================================ Index: sysdeps/i386/fpu/libm-test-ulps --- sysdeps/i386/fpu/libm-test-ulps 2001/03/04 19:23:58 1.18 +++ sysdeps/i386/fpu/libm-test-ulps 2001/03/06 14:51:56 @@ -708,12 +708,14 @@ Test "jn (10, -1.0) == 0.26306151236874532070e-9": float: 1 ifloat: 1 +double: 1 +idouble: 1 ldouble: 1 ildouble: 1 Test "jn (10, 0.1) == 0.26905328954342155795e-19": -double: 4 +double: 5 float: 2 -idouble: 4 +idouble: 5 ifloat: 2 ldouble: 1 ildouble: 1 @@ -727,6 +729,8 @@ Test "jn (10, 1.0) == 0.26306151236874532070e-9": float: 1 ifloat: 1 +double: 1 +idouble: 1 ldouble: 1 ildouble: 1 Test "jn (10, 2.0) == 0.25153862827167367096e-6": @@ -922,6 +926,9 @@ float: 1 idouble: 1 ifloat: 1 +Test "tgamma (4) == 6": +ldouble: 2 +ildouble: 2 # y0 Test "y0 (0.1) == -1.5342386513503668441": @@ -1471,9 +1478,9 @@ ildouble: 2 Function: "jn": -double: 4 +double: 5 float: 2 -idouble: 4 +idouble: 5 ifloat: 2 ldouble: 2 ildouble: 2 -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Tue Mar 6 07:24:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 06 Mar 2001 07:24:00 -0000 Subject: libanl + atexit + more References: Message-ID: <20010306162639.E573@sunsite.ms.mff.cuni.cz> On Mon, Mar 05, 2001 at 09:51:37PM +0100, Andreas Jaeger wrote: > Andreas Jaeger writes: > > > Ulrich Drepper writes: > > > > > Second, I haven't gotten any comments on the atexit() implementation > > > changes I made. They are so non-obvious that I thought the one or > > > other would comment. The good thing is that this implementation > > > should be very robust. The bad thing is that old programs cannot be > > > fixed, everything (means DSOs) has to be relinked (if they have this > > > problem which is fortunately rare). I don't think this is a problem. > > > Note that today (until sometime next week :-) this atexit() > > > implementation is not Unix conforming. Unix currently forbids this > > > behavior (this means the registered functions are called at dlclose() > > > time). I've filed an defect report which will be handled next week. > > > > make check fails now for me: > > > > GCONV_PATH=/builds/glibc/main-gcc-2.95/iconvdata LC_ALL=C /builds/glibc/main-gcc-2.95/elf/ld-linux.so.2 --library-path /builds/glibc/main-gcc-2.95:/builds/glibc/main-gcc-2.95/math:/builds/glibc/main-gcc-2.95/elf:/builds/glibc/main-gcc-2.95/dlfcn:/builds/glibc/main-gcc-2.95/nss:/builds/glibc/main-gcc-2.95/nis:/builds/glibc/main-gcc-2.95/rt:/builds/glibc/main-gcc-2.95/resolv:/builds/glibc/main-gcc-2.95/crypt:/builds/glibc/main-gcc-2.95/linuxthreads /builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit > /builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit.out > > make[2]: *** [/builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit.out] Error 1 > > > > gromit:/builds/glibc/main-gcc-2.95:[0]$ cat dlfcn/tstcxaatexit.out > > cannot open "modcxaatexit.so": /builds/glibc/main-gcc-2.95/dlfcn/modcxaatexit.so: undefined symbol: __dso_handle This one can be compiled with something like: --- libc/dlfcn/modcxaatexit.c.jj Mon Feb 26 18:41:22 2001 +++ libc/dlfcn/modcxaatexit.c Tue Mar 6 16:34:53 2001 @@ -33,7 +33,7 @@ fluffy (void *p) void bar (void *p) { - extern void *__dso_handle; + extern void *__dso_handle __attribute__ ((__weak__)); printf ("This is %s\n", __FUNCTION__); - __cxa_atexit (fluffy, p, __dso_handle); + __cxa_atexit (fluffy, p, &__dso_handle ? __dso_handle : NULL); } (but the test will fail anyway). > > > > This is with gcc 2.95.2. With a 3.0 pre release I get a segmentation > > fault, I'll send details tomorrow. > > It's not tomorrow ;-) but here's the failure: > > gromit:/usr/src/cvs/libc/dlfcn:[0]$ GCONV_PATH=/builds/glibc/20010106-gcc-2.97.test/iconvdata LC_ALL=C /builds/glibc/20010106-gcc-2.97.test/elf/ld-linux.so.2 --library-path /builds/glibc/20010106-gcc-2.97.test:/builds/glibc/20010106-gcc-2.97.test/math:/builds/glibc/20010106-gcc-2.97.test/elf:/builds/glibc/20010106-gcc-2.97.test/dlfcn:/builds/glibc/20010106-gcc-2.97.test/nss:/builds/glibc/20010106-gcc-2.97.test/nis:/builds/glibc/20010106-gcc-2.97.test/rt:/builds/glibc/20010106-gcc-2.97.test/resolv:/builds/glibc/20010106-gcc-2.97.test/crypt:/builds/glibc/20010106-gcc-2.97.test/linuxthreads /builds/glibc/20010106-gcc-2.97.test/dlfcn/tstcxaatexit > This is bar > module unload didn't change `v' > Segmentation fault But this one is IMHO more problematic. Initially I thought it is just that libc_nonshared.a is not being dragged into DSOs built during glibc make, so I have hacked up Makerules so that it drags in libc_nonshared.a and libc.so if libc.so was requested (and did this outside of -Wl,--(no-)whole-archive pair), but that did not fix things up, since gcc's crtstuff has this in: /* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr, __environ and atexit (). We have to make sure they are in the .dynsym section. We accomplish it by making a dummy call here. This code is never reached. */ #if defined(__linux__) && defined(__PIC__) && defined(__i386__) { extern void *___brk_addr; extern char **__environ; ___brk_addr = __environ; atexit (0); } #endif and so atexit ends up unversioned and undefined. Perhaps we could change the order in libc.so linker script to libc_nonshared.a libc.so and change atexit in glibc back to normal symbol again, so that it catches up crtendS.o which comes last (well, before crtn.o but there is just one for both shared and non-shared). Jakub From aj@suse.de Tue Mar 6 07:33:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Tue, 06 Mar 2001 07:33:00 -0000 Subject: libanl + atexit + more References: <20010306162639.E573@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > On Mon, Mar 05, 2001 at 09:51:37PM +0100, Andreas Jaeger wrote: > > Andreas Jaeger writes: > > > > > Ulrich Drepper writes: > > > > > > > Second, I haven't gotten any comments on the atexit() implementation > > > > changes I made. They are so non-obvious that I thought the one or > > > > other would comment. The good thing is that this implementation > > > > should be very robust. The bad thing is that old programs cannot be > > > > fixed, everything (means DSOs) has to be relinked (if they have this > > > > problem which is fortunately rare). I don't think this is a problem. > > > > Note that today (until sometime next week :-) this atexit() > > > > implementation is not Unix conforming. Unix currently forbids this > > > > behavior (this means the registered functions are called at dlclose() > > > > time). I've filed an defect report which will be handled next week. > > > > > > make check fails now for me: > > > > > > GCONV_PATH=/builds/glibc/main-gcc-2.95/iconvdata LC_ALL=C /builds/glibc/main-gcc-2.95/elf/ld-linux.so.2 --library-path /builds/glibc/main-gcc-2.95:/builds/glibc/main-gcc-2.95/math:/builds/glibc/main-gcc-2.95/elf:/builds/glibc/main-gcc-2.95/dlfcn:/builds/glibc/main-gcc-2.95/nss:/builds/glibc/main-gcc-2.95/nis:/builds/glibc/main-gcc-2.95/rt:/builds/glibc/main-gcc-2.95/resolv:/builds/glibc/main-gcc-2.95/crypt:/builds/glibc/main-gcc-2.95/linuxthreads /builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit > /builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit.out > > > make[2]: *** [/builds/glibc/main-gcc-2.95/dlfcn/tstcxaatexit.out] Error 1 > > > > > > gromit:/builds/glibc/main-gcc-2.95:[0]$ cat dlfcn/tstcxaatexit.out > > > cannot open "modcxaatexit.so": /builds/glibc/main-gcc-2.95/dlfcn/modcxaatexit.so: undefined symbol: __dso_handle > > This one can be compiled with something like: > > --- libc/dlfcn/modcxaatexit.c.jj Mon Feb 26 18:41:22 2001 > +++ libc/dlfcn/modcxaatexit.c Tue Mar 6 16:34:53 2001 > @@ -33,7 +33,7 @@ fluffy (void *p) > void > bar (void *p) > { > - extern void *__dso_handle; > + extern void *__dso_handle __attribute__ ((__weak__)); > printf ("This is %s\n", __FUNCTION__); > - __cxa_atexit (fluffy, p, __dso_handle); > + __cxa_atexit (fluffy, p, &__dso_handle ? __dso_handle : NULL); > } > > (but the test will fail anyway). > > > > > > This is with gcc 2.95.2. With a 3.0 pre release I get a segmentation > > > fault, I'll send details tomorrow. > > > > It's not tomorrow ;-) but here's the failure: > > > > gromit:/usr/src/cvs/libc/dlfcn:[0]$ GCONV_PATH=/builds/glibc/20010106-gcc-2.97.test/iconvdata LC_ALL=C /builds/glibc/20010106-gcc-2.97.test/elf/ld-linux.so.2 --library-path /builds/glibc/20010106-gcc-2.97.test:/builds/glibc/20010106-gcc-2.97.test/math:/builds/glibc/20010106-gcc-2.97.test/elf:/builds/glibc/20010106-gcc-2.97.test/dlfcn:/builds/glibc/20010106-gcc-2.97.test/nss:/builds/glibc/20010106-gcc-2.97.test/nis:/builds/glibc/20010106-gcc-2.97.test/rt:/builds/glibc/20010106-gcc-2.97.test/resolv:/builds/glibc/20010106-gcc-2.97.test/crypt:/builds/glibc/20010106-gcc-2.97.test/linuxthreads /builds/glibc/20010106-gcc-2.97.test/dlfcn/tstcxaatexit > > This is bar > > module unload didn't change `v' > > Segmentation fault > > But this one is IMHO more problematic. Initially I thought it is just that > libc_nonshared.a is not being dragged into DSOs built during glibc make, so > I have hacked up Makerules so that it drags in libc_nonshared.a and libc.so > if libc.so was requested (and did this outside of -Wl,--(no-)whole-archive > pair), but that did not fix things up, since gcc's crtstuff has this in: > > /* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr, > __environ and atexit (). We have to make sure they are in the .dynsym > section. We accomplish it by making a dummy call here. This > code is never reached. */ > > #if defined(__linux__) && defined(__PIC__) && defined(__i386__) > { > extern void *___brk_addr; > extern char **__environ; > > ___brk_addr = __environ; > atexit (0); > } > #endif > > and so atexit ends up unversioned and undefined. > Perhaps we could change the order in libc.so linker script to > libc_nonshared.a libc.so and change atexit in glibc back to normal symbol > again, so that it catches up crtendS.o which comes last (well, before crtn.o > but there is just one for both shared and non-shared). I've updated my binutils, rebuild glibc and now it works - I'll retry on the other machine where I noticed this problem later today. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Tue Mar 6 12:07:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 06 Mar 2001 12:07:00 -0000 Subject: [PATCH] libanl Makefile fix Message-ID: <20010306210906.F573@sunsite.ms.mff.cuni.cz> Hi! make -j 6 failed because resolv was built before linuxthreads, which should be fixed by added Depend. Also, I think libanl/ga_test should only be built if libpthread is being built. 2001-03-06 Jakub Jelinek * resolv/Depend: New file. * resolv/Makefile (extra-libs, tests): Build libanl and ga_test only when libpthread is built. --- libc/resolv/Depend.jj Tue Mar 6 22:07:42 2001 +++ libc/resolv/Depend Tue Mar 6 22:07:37 2001 @@ -0,0 +1 @@ +linuxthreads --- libc/resolv/Makefile.jj Mon Mar 5 11:58:07 2001 +++ libc/resolv/Makefile Tue Mar 6 22:11:32 2001 @@ -35,7 +35,10 @@ tests = tst-aton include ../Makeconfig -extra-libs := libresolv libanl libnss_dns +extra-libs := libresolv libnss_dns +ifeq ($(have-thread-library),yes) +extra-libs += libanl +endif extra-libs-others = $(extra-libs) libresolv-routines := gethnamaddr res_comp res_debug \ res_data res_mkquery res_query res_send \ @@ -54,7 +57,7 @@ ifneq ($(build-static-nss),yes) libnss_dns-inhibit-o = $(filter-out .os,$(object-suffixes)) endif -ifeq (yes,$(build-shared)) +ifeq (yesyes,$(build-shared)$(have-thread-library)) tests: $(objpfx)ga_test endif Jakub From aj@suse.de Tue Mar 6 22:06:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Tue, 06 Mar 2001 22:06:00 -0000 Subject: libanl + atexit + more References: Message-ID: Just a note: everything works now for me with gcc from CVS, only gcc 2.95.2 still fails as reported. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aj@suse.de Tue Mar 6 23:41:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Tue, 06 Mar 2001 23:41:00 -0000 Subject: [PATCH] libanl Makefile fix References: <20010306210906.F573@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Hi! > > make -j 6 failed because resolv was built before linuxthreads, which should > be fixed by added Depend. Also, I think libanl/ga_test should only be built > if libpthread is being built. I agree and have committed this one, thanks, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aj@suse.de Wed Mar 7 00:26:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Wed, 07 Mar 2001 00:26:00 -0000 Subject: Another linuxthreads/libanl fix Message-ID: If I configure glibc without any add-ons, it fails now in: In file included from ../sysdeps/unix/sysv/linux/gai_sigqueue.c:28: gai_misc.h:32: parse error before "pthread_cond_t" gai_misc.h:32: warning: no semicolon at end of struct or union gai_misc.h:39: parse error before '}' token gai_misc.h:73: parse error before "__gai_requests_mutex" gai_misc.h:73: warning: type defaults to `int' in declaration of `__gai_requests_mutex' gai_misc.h:73: warning: data definition has no type or storage class I think we shouldn't build gai_sigqueue in this case at all. Is the appended patch ok? Or should we change gai_sigqueue or gai_misc.h instead? Andreas 2001-03-07 Andreas Jaeger * resolv/Makefile (routines): Only build gai_sigqueue when threads are available. ============================================================ Index: resolv/Makefile --- resolv/Makefile 2001/03/07 07:40:34 1.36 +++ resolv/Makefile 2001/03/07 08:25:35 @@ -29,7 +29,7 @@ Banner res_hconf.h res_debug.h README gai_misc.h ga_test.c routines := herror inet_addr inet_ntop inet_pton nsap_addr res_init \ - res_hconf res_libc gai_sigqueue + res_hconf res_libc tests = tst-aton @@ -38,6 +38,7 @@ extra-libs := libresolv libnss_dns ifeq ($(have-thread-library),yes) extra-libs += libanl +routines += gai_sigqueue endif extra-libs-others = $(extra-libs) libresolv-routines := gethnamaddr res_comp res_debug \ -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Wed Mar 7 04:54:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 07 Mar 2001 04:54:00 -0000 Subject: [PATCH] Fix gencat Message-ID: <20010307135550.A2370@sunsite.ms.mff.cuni.cz> Hi! gencat leaves garbage in ->symbol if symbolic names was used, see http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=30894 for details. The patch below seems to fix it: 2001-03-07 Jakub Jelinek * catgets/gencat.c (read_input_file): Preserve properly symbolic names. --- libc/catgets/gencat.c.jj Fri Jan 5 22:58:00 2001 +++ libc/catgets/gencat.c Wed Mar 7 12:04:48 2001 @@ -649,6 +649,7 @@ duplicated message identifier")); size_t outlen; struct message_list *newp; size_t line_len = strlen (line) + 1; + size_t ident_len = 0; /* We need the conversion. */ if (cd_towc == (iconv_t) -1 @@ -699,6 +700,9 @@ invalid character: message ignored")); normalize_line (fname, start_line, cd_towc, wbuf, current->quote_char, escape_char); + if (ident) + ident_len = line - this_line; + /* Now the string is free of escape sequences. Convert it back into a multibyte character string. First free the memory allocated for the original string. */ @@ -714,7 +718,8 @@ invalid character: message ignored")); outlen = obstack_room (¤t->mem_pool); obstack_blank (¤t->mem_pool, outlen); this_line = (char *) obstack_base (¤t->mem_pool); - outbuf = this_line; + outbuf = this_line + ident_len; + outlen -= ident_len; /* Flush the state. */ iconv (cd_tomb, NULL, NULL, NULL, NULL); @@ -734,9 +739,9 @@ invalid character: message ignored")); newp = (struct message_list *) xmalloc (sizeof (*newp)); newp->number = message_number; - newp->message = line; + newp->message = line + ident_len; /* Remember symbolic name; is NULL if no is given. */ - newp->symbol = ident; + newp->symbol = ident ? line : NULL; /* Remember where we found the character. */ newp->fname = fname; newp->line = start_line; Jakub From jakub@redhat.com Wed Mar 7 04:55:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 07 Mar 2001 04:55:00 -0000 Subject: [PATCH] Fix sparc and sparc64 Message-ID: <20010307135651.B2370@sunsite.ms.mff.cuni.cz> Hi! Some _dl_sysdep_{error,message} calls have been left unnoticed: 2001-03-07 Jakub Jelinek * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Use _dl_error_printf instead of _dl_sysdep_error. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h (_dl_procinfo): Use _dl_printf instead of _dl_sysdep_message. * sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h (_dl_procinfo): Likewise. --- libc/sysdeps/sparc/sparc32/dl-machine.h.jj Fri Feb 16 11:46:40 2001 +++ libc/sysdeps/sparc/sparc32/dl-machine.h Wed Mar 7 14:51:37 2001 @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. SPARC version. - Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1996,1997,1998,1999,2000,2001 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 @@ -392,10 +392,10 @@ elf_machine_rela (struct link_map *map, const char *strtab; strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); - _dl_sysdep_error (_dl_argv[0] ?: "", - ": Symbol `", strtab + refsym->st_name, - "' has different size in shared object, " - "consider re-linking\n", NULL); + _dl_error_printf ("\ +%s: Symbol `%s' has different size in shared object, consider re-linking\n", + _dl_argv[0] ?: "", + strtab + refsym->st_name); } memcpy (reloc_addr, (void *) value, MIN (sym->st_size, refsym->st_size)); --- libc/sysdeps/sparc/sparc64/dl-machine.h.jj Fri Feb 16 11:46:40 2001 +++ libc/sysdeps/sparc/sparc64/dl-machine.h Wed Mar 7 14:51:45 2001 @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. Sparc64 version. - Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001 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 @@ -227,10 +227,10 @@ elf_machine_rela (struct link_map *map, const char *strtab; strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); - _dl_sysdep_error (_dl_argv[0] ?: "", - ": Symbol `", strtab + refsym->st_name, - "' has different size in shared object, " - "consider re-linking\n", NULL); + _dl_error_printf ("\ +%s: Symbol `%s' has different size in shared object, consider re-linking\n", + _dl_argv[0] ?: "", + strtab + refsym->st_name); } memcpy (reloc_addr, (void *) value, MIN (sym->st_size, refsym->st_size)); --- libc/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h.jj Fri Mar 2 17:47:14 2001 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/dl-procinfo.h Wed Mar 7 14:44:07 2001 @@ -1,5 +1,5 @@ /* Linux/sparc32 version of processor capability information handling macros. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek , 1999. @@ -35,13 +35,13 @@ _dl_procinfo (int word) { int i; - _dl_sysdep_message ("AT_HWCAP: ", NULL); + _dl_printf ("AT_HWCAP: "); for (i = 0; i < _DL_HWCAP_COUNT; ++i) if (word & (1 << i)) - _dl_sysdep_message (" ", sparc32_cap_flags[i], NULL); + _dl_printf (" %s", sparc32_cap_flags[i]); - _dl_sysdep_message ("\n", NULL); + _dl_printf ("\n"); return 0; } --- libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h.jj Fri Mar 2 17:47:25 2001 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/dl-procinfo.h Wed Mar 7 14:51:54 2001 @@ -1,5 +1,5 @@ /* Linux/sparc64 version of processor capability information handling macros. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek , 1999. @@ -35,13 +35,13 @@ _dl_procinfo (int word) { int i; - _dl_sysdep_message ("AT_HWCAP: ", NULL); + _dl_printf ("AT_HWCAP: "); for (i = 0; i < _DL_HWCAP_COUNT; ++i) if (word & (1 << i)) - _dl_sysdep_message (" ", sparc64_cap_flags[i], NULL); + _dl_printf (" %s", sparc64_cap_flags[i]); - _dl_sysdep_message ("\n", NULL); + _dl_printf ("\n"); return 0; } Jakub From kettenis@wins.uva.nl Wed Mar 7 05:49:00 2001 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Wed, 07 Mar 2001 05:49:00 -0000 Subject: Another linuxthreads/libanl fix Message-ID: <200103071348.f27DmTh03992@delius.kettenis.local> Andreas Jaeger writes: > If I configure glibc without any add-ons, it fails now in: > > In file included from ../sysdeps/unix/sysv/linux/gai_sigqueue.c:28: > gai_misc.h:32: parse error before "pthread_cond_t" > gai_misc.h:32: warning: no semicolon at end of struct or union > gai_misc.h:39: parse error before '}' token > gai_misc.h:73: parse error before "__gai_requests_mutex" > gai_misc.h:73: warning: type defaults to `int' in declaration of `__gai_requests_mutex' > gai_misc.h:73: warning: data definition has no type or storage class I'm having similar problems when compiling for the Hurd. > I think we shouldn't build gai_sigqueue in this case at all. Is the > appended patch ok? Or should we change gai_sigqueue or gai_misc.h > instead? Your patch looks fine to me. Changing gai_sigqueue and/or gai_misc.h would involve quite a bit more work I think. Mark From aj@suse.de Wed Mar 7 05:51:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Wed, 07 Mar 2001 05:51:00 -0000 Subject: Another linuxthreads/libanl fix References: Message-ID: Mark Kettenis writes: > Andreas Jaeger writes: > > > If I configure glibc without any add-ons, it fails now in: > > > > In file included from ../sysdeps/unix/sysv/linux/gai_sigqueue.c:28: > > gai_misc.h:32: parse error before "pthread_cond_t" > > gai_misc.h:32: warning: no semicolon at end of struct or union > > gai_misc.h:39: parse error before '}' token > > gai_misc.h:73: parse error before "__gai_requests_mutex" > > gai_misc.h:73: warning: type defaults to `int' in declaration of `__gai_requests_mutex' > > gai_misc.h:73: warning: data definition has no type or storage class > > I'm having similar problems when compiling for the Hurd. > > > I think we shouldn't build gai_sigqueue in this case at all. Is the > > appended patch ok? Or should we change gai_sigqueue or gai_misc.h > > instead? > > Your patch looks fine to me. Changing gai_sigqueue and/or gai_misc.h > would involve quite a bit more work I think. Ok, I'm committing the patch now so that it works also on the Hurd again, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From schwab@suse.de Wed Mar 7 10:41:00 2001 From: schwab@suse.de (Andreas Schwab) Date: Wed, 07 Mar 2001 10:41:00 -0000 Subject: ldconfig Message-ID: On ia64 we want to recognize libraries using ld-linux.so.2 as 32 bit libc6 libraries. On the other hand, only i386 and m68k ever had a libc5 implementation (please correct me if I'm wrong). This patch adds hooks to readlib.c to allow platforms to add libraries and interpreters to recognize. OK to install? Andreas. 2001-03-07 Andreas Schwab * elf/ldconfig.h: Moved to ... * sysdeps/generic/ldconfig.h: ... here. * sysdeps/unix/sysv/linux/i386/ldconfig.h: New file. * sysdeps/unix/sysv/linux/m68k/ldconfig.h: New file. * sysdeps/unix/sysv/linux/ia64/ldconfig.h: New file. * elf/readlib.c (interpreters, known_libs): Use SYSDEP_KNOWN_INTERPRETER_NAMES and SYSDEP_KNOWN_LIBRARY_NAMES instead of hard coding old names. Index: elf/ldconfig.h =================================================================== RCS file: ldconfig.h diff -N elf/ldconfig.h --- elf/ldconfig.h Wed Mar 7 10:08:37 2001 +++ /dev/null Tue May 5 13:32:27 1998 @@ -1,68 +0,0 @@ -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger , 1999. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _LDCONFIG_H -#define _LDCONFIG_H - -#define FLAG_ANY -1 -#define FLAG_TYPE_MASK 0x00ff -#define FLAG_LIBC4 0x0000 -#define FLAG_ELF 0x0001 -#define FLAG_ELF_LIBC5 0x0002 -#define FLAG_ELF_LIBC6 0x0003 -#define FLAG_REQUIRED_MASK 0xff00 -#define FLAG_SPARC_LIB64 0x0100 -#define FLAG_IA64_LIB64 0x0200 -#define FLAG_X8664_LIB64 0x0300 - -/* Declared in cache.c. */ -extern void print_cache (const char *cache_name); - -extern void init_cache (void); - -extern void save_cache (const char *cache_name); - -extern void add_to_cache (const char *path, const char *lib, int flags, - uint64_t hwcap); - -/* Declared in readlib.c. */ -extern int process_file (const char *real_file_name, const char *file_name, - const char *lib, int *flag, char **soname, - int is_link); - -/* Declared in readelflib.c. */ -extern int process_elf_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, - size_t file_length); - -/* Declared in chroot_canon.c. */ -extern char *chroot_canon (const char *chroot, const char *name); - -/* Declared in ldconfig.c. */ -extern int opt_verbose; - -extern int opt_format; - -/* Prototypes for a few program-wide used functions. */ -extern void *xmalloc (size_t __n); -extern void *xcalloc (size_t __n, size_t __size); -extern void *xrealloc (void *__p, size_t __n); -extern char *xstrdup (const char *__str); - -#endif /* ! _LDCONFIG_H */ Index: elf/readlib.c =================================================================== RCS file: /cvs/glibc/libc/elf/readlib.c,v retrieving revision 1.8 diff -u -a -r1.8 elf/readlib.c --- elf/readlib.c 2000/09/30 00:53:11 1.8 +++ elf/readlib.c 2001/03/07 18:08:34 @@ -51,17 +51,18 @@ static struct known_names interpreters [] = { {"/lib/" LD_SO, FLAG_ELF_LIBC6}, - {"/lib/ld-linux.so.1", FLAG_ELF_LIBC5} +#ifdef SYSDEP_KNOWN_INTERPRETER_NAMES + SYSDEP_KNOWN_INTERPRETER_NAMES +#endif }; static struct known_names known_libs [] = { - /* Old names: */ - {"libc.so.5", FLAG_ELF_LIBC5}, - {"libm.so.5", FLAG_ELF_LIBC5}, - /* Current names: */ {LIBC_SO, FLAG_ELF_LIBC6}, - {LIBM_SO, FLAG_ELF_LIBC6} + {LIBM_SO, FLAG_ELF_LIBC6}, +#ifdef SYSDEP_KNOWN_LIBRARY_NAMES + SYSDEP_KNOWN_LIBRARY_NAMES +#endif }; Index: sysdeps/generic/ldconfig.h =================================================================== RCS file: ldconfig.h diff -N sysdeps/generic/ldconfig.h --- /dev/null Tue May 5 13:32:27 1998 +++ sysdeps/generic/ldconfig.h Wed Mar 7 10:08:34 2001 @@ -0,0 +1,68 @@ +/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Jaeger , 1999. + + 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _LDCONFIG_H +#define _LDCONFIG_H + +#define FLAG_ANY -1 +#define FLAG_TYPE_MASK 0x00ff +#define FLAG_LIBC4 0x0000 +#define FLAG_ELF 0x0001 +#define FLAG_ELF_LIBC5 0x0002 +#define FLAG_ELF_LIBC6 0x0003 +#define FLAG_REQUIRED_MASK 0xff00 +#define FLAG_SPARC_LIB64 0x0100 +#define FLAG_IA64_LIB64 0x0200 +#define FLAG_X8664_LIB64 0x0300 + +/* Declared in cache.c. */ +extern void print_cache (const char *cache_name); + +extern void init_cache (void); + +extern void save_cache (const char *cache_name); + +extern void add_to_cache (const char *path, const char *lib, int flags, + uint64_t hwcap); + +/* Declared in readlib.c. */ +extern int process_file (const char *real_file_name, const char *file_name, + const char *lib, int *flag, char **soname, + int is_link); + +/* Declared in readelflib.c. */ +extern int process_elf_file (const char *file_name, const char *lib, int *flag, + char **soname, void *file_contents, + size_t file_length); + +/* Declared in chroot_canon.c. */ +extern char *chroot_canon (const char *chroot, const char *name); + +/* Declared in ldconfig.c. */ +extern int opt_verbose; + +extern int opt_format; + +/* Prototypes for a few program-wide used functions. */ +extern void *xmalloc (size_t __n); +extern void *xcalloc (size_t __n, size_t __size); +extern void *xrealloc (void *__p, size_t __n); +extern char *xstrdup (const char *__str); + +#endif /* ! _LDCONFIG_H */ Index: sysdeps/unix/sysv/linux/i386/ldconfig.h =================================================================== RCS file: ldconfig.h diff -N sysdeps/unix/sysv/linux/i386/ldconfig.h --- /dev/null Tue May 5 13:32:27 1998 +++ sysdeps/unix/sysv/linux/i386/ldconfig.h Wed Mar 7 10:08:37 2001 @@ -0,0 +1,25 @@ +/* Copyright (C) 2001 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#define SYSDEP_KNOWN_INTERPRETER_NAMES \ + { "/lib/ld-linux.so.1", FLAG_ELF_LIBC5 }, +#define SYSDEP_KNOWN_LIBRARY_NAMES \ + { "libc.so.5", FLAG_ELF_LIBC5 }, \ + { "libm.so.5", FLAG_ELF_LIBC5 }, Index: sysdeps/unix/sysv/linux/ia64/ldconfig.h =================================================================== RCS file: ldconfig.h diff -N sysdeps/unix/sysv/linux/ia64/ldconfig.h --- /dev/null Tue May 5 13:32:27 1998 +++ sysdeps/unix/sysv/linux/ia64/ldconfig.h Wed Mar 7 10:08:37 2001 @@ -0,0 +1,25 @@ +/* Copyright (C) 2001 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#define SYSDEP_KNOWN_INTERPRETER_NAMES \ + { "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 }, +#define SYSDEP_KNOWN_LIBRARY_NAMES \ + { "libc.so.6", FLAG_ELF_LIBC6 }, \ + { "libm.so.6", FLAG_ELF_LIBC6 }, Index: sysdeps/unix/sysv/linux/m68k/ldconfig.h =================================================================== RCS file: ldconfig.h diff -N sysdeps/unix/sysv/linux/m68k/ldconfig.h --- /dev/null Tue May 5 13:32:27 1998 +++ sysdeps/unix/sysv/linux/m68k/ldconfig.h Wed Mar 7 10:08:37 2001 @@ -0,0 +1 @@ +#include -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 From schwab@suse.de Wed Mar 7 10:46:00 2001 From: schwab@suse.de (Andreas Schwab) Date: Wed, 07 Mar 2001 10:46:00 -0000 Subject: sysdeps/ia64/fpu/feenablxcpt.c Message-ID: There is an extra space in the asm spec that gcc 3.0 does not like at all. Andreas. 2001-03-07 Andreas Schwab * sysdeps/ia64/fpu/feenablxcpt.c (feenableexcept): Remove extra space in asm spec. --- sysdeps/ia64/fpu/feenablxcpt.c.~1.2.~ Fri Sep 29 10:03:22 2000 +++ sysdeps/ia64/fpu/feenablxcpt.c Wed Mar 7 19:44:33 2001 @@ -27,7 +27,7 @@ fenv_t new_fpsr; /* Get the current fpsr. */ - __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r " (old_fpsr)); + __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (old_fpsr)); new_fpsr = old_fpsr & ~((fenv_t) excepts & FE_ALL_EXCEPT); -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 From jes@linuxcare.com Wed Mar 7 10:57:00 2001 From: jes@linuxcare.com (Jes Sorensen) Date: Wed, 07 Mar 2001 10:57:00 -0000 Subject: ldconfig References: Message-ID: >>>>> "Andreas" == Andreas Schwab writes: Andreas> On ia64 we want to recognize libraries using ld-linux.so.2 as Andreas> 32 bit libc6 libraries. On the other hand, only i386 and Andreas> m68k ever had a libc5 implementation (please correct me if Andreas> I'm wrong). This patch adds hooks to readlib.c to allow Andreas> platforms to add libraries and interpreters to recognize. Sparc had libc5 back in the early days (back when Miguel was hacking it, be afraid very afraid ;) Jes From schwab@suse.de Wed Mar 7 11:01:00 2001 From: schwab@suse.de (Andreas Schwab) Date: Wed, 07 Mar 2001 11:01:00 -0000 Subject: ldconfig References: Message-ID: Jes Sorensen writes: |> >>>>> "Andreas" == Andreas Schwab writes: |> |> Andreas> On ia64 we want to recognize libraries using ld-linux.so.2 as |> Andreas> 32 bit libc6 libraries. On the other hand, only i386 and |> Andreas> m68k ever had a libc5 implementation (please correct me if |> Andreas> I'm wrong). This patch adds hooks to readlib.c to allow |> Andreas> platforms to add libraries and interpreters to recognize. |> |> Sparc had libc5 back in the early days (back when Miguel was hacking |> it, be afraid very afraid ;) Ok, should we add sysdeps/unix/sysv/linux/sparc/sparc32/ldconfig.h then? Andreas. -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 From jakub@redhat.com Thu Mar 8 01:11:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 08 Mar 2001 01:11:00 -0000 Subject: [PATCH] Fix ld.so trace mode Message-ID: <20010308101329.A969@sunsite.ms.mff.cuni.cz> Hi! LD_TRACE_LOADED_OBJECTS=1 always used to warn about undefined symbols if LD_WARN=1 was specified at the same time, but current test does it the other way around. This is snippet from older rtld.c: /* LAZY is determined by the environment variable LD_WARN and LD_BIND_NOW if we trace the binary. */ if (__builtin_expect (mode, normal) == trace) *lazyp = _dl_verbose ? !bind_now : -1; else *lazyp = !bind_now; ie. _dl_lazy was set to -1 if tracing and LD_WARN was not set. 2001-03-08 Jakub Jelinek * elf/rtld.c (dl_main): If tracing, warn about undefined symbols if LD_WARN=1, not if LD_WARN is unset. --- libc/elf/rtld.c.jj Mon Mar 5 11:57:47 2001 +++ libc/elf/rtld.c Thu Mar 8 11:05:04 2001 @@ -896,8 +896,8 @@ of this helper program; chances are you } else { - /* Unless LD_WARN is set warn do not about undefined symbols. */ - if (_dl_lazy >= 0 && !_dl_verbose) + /* If LD_WARN is set warn about undefined symbols. */ + if (_dl_lazy >= 0 && _dl_verbose) { /* We have to do symbol dependency testing. */ struct relocate_args args; Jakub From rth@twiddle.net Thu Mar 8 10:35:00 2001 From: rth@twiddle.net (Richard Henderson) Date: Thu, 08 Mar 2001 10:35:00 -0000 Subject: ldconfig References: Message-ID: <20010308103551.A8640@twiddle.net> On Wed, Mar 07, 2001 at 07:56:25PM +0100, Jes Sorensen wrote: > Sparc had libc5 back in the early days (back when Miguel was hacking > it, be afraid very afraid ;) That wasn't still libc4? Alpha skipped straight from libc4 to libc6 and I thought I remembered sparc doing the same thing. r~ From jakub@redhat.com Thu Mar 8 10:43:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 08 Mar 2001 10:43:00 -0000 Subject: ldconfig References: <20010308103551.A8640@twiddle.net> Message-ID: <20010308194529.A22218@sunsite.ms.mff.cuni.cz> On Thu, Mar 08, 2001 at 10:35:51AM -0800, Richard Henderson wrote: > On Wed, Mar 07, 2001 at 07:56:25PM +0100, Jes Sorensen wrote: > > Sparc had libc5 back in the early days (back when Miguel was hacking > > it, be afraid very afraid ;) > > That wasn't still libc4? Alpha skipped straight from libc4 to libc6 > and I thought I remembered sparc doing the same thing. No, Sparc definitely had libc5, e.g. in RHL 4.2. Jakub From kettenis@wins.uva.nl Thu Mar 8 11:57:00 2001 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Thu, 08 Mar 2001 11:57:00 -0000 Subject: Kill some netdb.h related warnings Message-ID: <200103081957.f28Jv4Q00266@delius.kettenis.local> On the Hurd I need the attached patch to keep the compiler from warning about `struct timespec' being declared inside a parameter list. I suspect one would see the same warning on Linux, but there might be some subtle difference between Hurd and Linux headers that hide this problem there. Mark 2001-03-07 Mark Kettenis * resolv/netdb.h [__USE_GNU]: Define __need_timespec and include to get definition of `struct timespec'. Index: resolv/netdb.h =================================================================== RCS file: /cvs/glibc/libc/resolv/netdb.h,v retrieving revision 1.35 diff -u -p -r1.35 netdb.h --- resolv/netdb.h 2001/03/03 18:07:35 1.35 +++ resolv/netdb.h 2001/03/08 19:52:01 @@ -36,6 +36,8 @@ #ifdef __USE_GNU # define __need_sigevent_t # include +# define __need_timespec +# include #endif #include From jes@linuxcare.com Fri Mar 9 12:37:00 2001 From: jes@linuxcare.com (Jes Sorensen) Date: Fri, 09 Mar 2001 12:37:00 -0000 Subject: small ia64 patches Message-ID: <200103092037.VAA12512@lxplus015.cern.ch> Hi I have the following ones in my tree that I would like to have applied. Uli, could you please apply? Thanks Jes 2001-03-07 David Mosberger * sysdeps/ia64/bits/fenv.h (FE_NONIEEE_ENV): New macro. 2001-03-07 Jes Sorensen * sysdeps/unix/sysv/linux/ia64/ioperm.c (_ioperm): Remove unused variables addr & len; 2001-02-22 Jes Sorensen * sysdeps/ia64/fpu/feenablxcpt.c (feenableexcept): Remove punctuation in asm constraint. diff -urN -X /home/jes/exclude-libc ../cygnus/libc-2.2/sysdeps/ia64/bits/fenv.h libc-2.2/sysdeps/ia64/bits/fenv.h --- ../cygnus/libc-2.2/sysdeps/ia64/bits/fenv.h Thu Sep 28 18:56:51 2000 +++ libc-2.2/sysdeps/ia64/bits/fenv.h Thu Mar 8 14:00:14 2001 @@ -79,4 +79,9 @@ /* Floating-point environment where only FE_UNNORMAL is masked since this exception is not generally supported by glibc. */ # define FE_NOMASK_ENV ((__const fenv_t *) 0xc009804c02700302UL) + +/* Floating-point environment with (processor-dependent) non-IEEE + floating point. In this case, turning on flush-to-zero mode for + s0, s2, and s3. */ +# define FE_NONIEEE_ENV ((__const fenv_t *) 0xc009a04d0270037fUL) #endif diff -urN -X /home/jes/exclude-libc ../cygnus/libc-2.2/sysdeps/ia64/fpu/feenablxcpt.c libc-2.2/sysdeps/ia64/fpu/feenablxcpt.c --- ../cygnus/libc-2.2/sysdeps/ia64/fpu/feenablxcpt.c Thu Sep 28 18:56:13 2000 +++ libc-2.2/sysdeps/ia64/fpu/feenablxcpt.c Thu Feb 22 10:30:32 2001 @@ -27,7 +27,7 @@ fenv_t new_fpsr; /* Get the current fpsr. */ - __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r " (old_fpsr)); + __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (old_fpsr)); new_fpsr = old_fpsr & ~((fenv_t) excepts & FE_ALL_EXCEPT); diff -urN -X /home/jes/exclude-libc ../cygnus/libc-2.2/sysdeps/unix/sysv/linux/ia64/ioperm.c libc-2.2/sysdeps/unix/sysv/linux/ia64/ioperm.c --- ../cygnus/libc-2.2/sysdeps/unix/sysv/linux/ia64/ioperm.c Tue Feb 6 14:56:17 2001 +++ libc-2.2/sysdeps/unix/sysv/linux/ia64/ioperm.c Wed Mar 7 13:53:34 2001 @@ -60,7 +60,10 @@ int _ioperm (unsigned long int from, unsigned long int num, int turn_on) { +#if 0 unsigned long int addr, len, base; +#endif + unsigned long int base; int prot; /* this test isn't as silly as it may look like; consider overflows! */ From jes@linuxcare.com Fri Mar 9 12:45:00 2001 From: jes@linuxcare.com (Jes Sorensen) Date: Fri, 09 Mar 2001 12:45:00 -0000 Subject: sysdeps/unix/sysv/linux/sys/prctl.h Message-ID: <200103092044.VAA14853@lxplus015.cern.ch> Hi sysdeps/unix/sysv/linux/sys/prctl.h is just including linux/prctl.h instead of providing it's own definitions like most other header files do. Comments? Jes 2001-03-09 Jes Sorensen * sysdeps/unix/sysv/linux/sys/prctl.h: Provide PR_* values instead of including linux/prctl.h from the Linux kernel headers. diff -urN -X /home/jes/exclude-libc ../cygnus/libc-2.2/sysdeps/unix/sysv/linux/sys/prctl.h libc-2.2/sysdeps/unix/sysv/linux/sys/prctl.h --- ../cygnus/libc-2.2/sysdeps/unix/sysv/linux/sys/prctl.h Mon Oct 18 23:05:21 1999 +++ libc-2.2/sysdeps/unix/sysv/linux/sys/prctl.h Fri Mar 9 15:47:06 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 2001 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 @@ -20,7 +20,25 @@ #define _SYS_PRCTL_H 1 #include -#include /* The magic values come from here */ + +#define PR_SET_PDEATHSIG 1 /* Second arg is a signal */ +#define PR_GET_PDEATHSIG 2 /* Second arg is a ptr to return the signal */ + +/* Get/set current->dumpable */ +#define PR_GET_DUMPABLE 3 +#define PR_SET_DUMPABLE 4 + +/* Get/set unaligned access control bits (if meaningful) */ +#define PR_GET_UNALIGN 5 +#define PR_SET_UNALIGN 6 +/* silently fix up unaligned user accesses */ +# define PR_UNALIGN_NOPRINT 1 +/* generate SIGBUS on unaligned user accesses */ +# define PR_UNALIGN_SIGBUS 2 + +/* Get/set whether or not to drop capabilities on setuid() away from uid 0 */ +#define PR_GET_KEEPCAPS 7 +#define PR_SET_KEEPCAPS 8 __BEGIN_DECLS From drepper@redhat.com Fri Mar 9 17:13:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 09 Mar 2001 17:13:00 -0000 Subject: Problems with message catalogues on Red Hat Linux 7 on Alpha References: <69497A35EFE01E40877E250AB1AD61EA0919EC@reoexc03.emea.cpqcorp.net> Message-ID: No need for anybody to reply to this. Compaq is still learning. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Mar 9 22:34:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 09 Mar 2001 22:34:00 -0000 Subject: libanl + atexit + more References: <20010306162639.E573@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > This one can be compiled with something like: > > --- libc/dlfcn/modcxaatexit.c.jj Mon Feb 26 18:41:22 2001 > +++ libc/dlfcn/modcxaatexit.c Tue Mar 6 16:34:53 2001 > @@ -33,7 +33,7 @@ fluffy (void *p) > void > bar (void *p) > { > - extern void *__dso_handle; > + extern void *__dso_handle __attribute__ ((__weak__)); > printf ("This is %s\n", __FUNCTION__); > - __cxa_atexit (fluffy, p, __dso_handle); > + __cxa_atexit (fluffy, p, &__dso_handle ? __dso_handle : NULL); I've added a different patch for these. If somebody uses a compiler without __dso_handle atexit() will not work as expected in the dlfcn tests. Therefore we'll simply bail out. I would prefer to completely ban using anything before gcc 2.96 but I think too many loosers will complain. Let them get a broken glibc. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Mar 9 22:43:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 09 Mar 2001 22:43:00 -0000 Subject: Cosmetic dl-machine cleanups References: Message-ID: Andreas Jaeger writes: > Looking through the dynamic linker implementations, I noticed some > obsolete stuff. I've checked this in now. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Mar 9 22:45:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 09 Mar 2001 22:45:00 -0000 Subject: Patch for i386 libm-test-ulps References: Message-ID: Andreas Jaeger writes: > On both my P3 and my Athlon with both gcc 2.95.2 and gcc from CVS, I > got some problems libm-test after the constants have been changed to > long double. > > I've committed the appended patch, I prefer to not have this. I have a PIII as well and don't see any problems. So this must be a compiler issue. If gcc 2.95 generates wrong code it cannot be used. If (what is more likely) it generates code which causes the loss of precision the C code must be made more stable so that a different compiler makes no difference. Please undo the patch and look at the code difference between 2.95 and what ever other gcc version. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Fri Mar 9 23:09:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Fri, 09 Mar 2001 23:09:00 -0000 Subject: libanl + atexit + more References: <20010306162639.E573@sunsite.ms.mff.cuni.cz> Message-ID: Ulrich Drepper writes: > Jakub Jelinek writes: > > > This one can be compiled with something like: > > > > --- libc/dlfcn/modcxaatexit.c.jj Mon Feb 26 18:41:22 2001 > > +++ libc/dlfcn/modcxaatexit.c Tue Mar 6 16:34:53 2001 > > @@ -33,7 +33,7 @@ fluffy (void *p) > > void > > bar (void *p) > > { > > - extern void *__dso_handle; > > + extern void *__dso_handle __attribute__ ((__weak__)); > > printf ("This is %s\n", __FUNCTION__); > > - __cxa_atexit (fluffy, p, __dso_handle); > > + __cxa_atexit (fluffy, p, &__dso_handle ? __dso_handle : NULL); > > I've added a different patch for these. If somebody uses a compiler > without __dso_handle atexit() will not work as expected in the dlfcn > tests. Therefore we'll simply bail out. > > I would prefer to completely ban using anything before gcc 2.96 but I > think too many loosers will complain. Let them get a broken glibc. I don't mind if we depend on gcc 3.0 in configure as soon as it's out - but we shouldn't enforce a pre release. For now we have to support 2.95.x. IMO it's ok if this test fails. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aj@suse.de Fri Mar 9 23:10:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Fri, 09 Mar 2001 23:10:00 -0000 Subject: Patch for i386 libm-test-ulps References: Message-ID: Ulrich Drepper writes: > Andreas Jaeger writes: > > > On both my P3 and my Athlon with both gcc 2.95.2 and gcc from CVS, I > > got some problems libm-test after the constants have been changed to > > long double. > > > > I've committed the appended patch, > > I prefer to not have this. I have a PIII as well and don't see any > problems. So this must be a compiler issue. If gcc 2.95 generates > wrong code it cannot be used. If (what is more likely) it generates > code which causes the loss of precision the C code must be made more > stable so that a different compiler makes no difference. > > Please undo the patch and look at the code difference between 2.95 and > what ever other gcc version. I'll undo it for now and will look what the differences are. What compiler flags are you using? It might be that this is one issue why you don't see it and I see it. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Fri Mar 9 23:16:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 09 Mar 2001 23:16:00 -0000 Subject: [PATCH] Fix gencat References: <20010307135550.A2370@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > gencat leaves garbage in ->symbol if symbolic names was used, see > http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=30894 > for details. > The patch below seems to fix it: Thanks, I've applied it. But next time provide a test case. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Mar 9 23:17:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 09 Mar 2001 23:17:00 -0000 Subject: libanl + atexit + more References: <20010306162639.E573@sunsite.ms.mff.cuni.cz> Message-ID: Andreas Jaeger writes: > I don't mind if we depend on gcc 3.0 in configure as soon as it's out > - but we shouldn't enforce a pre release. For now we have to support > 2.95.x. IMO it's ok if this test fails. It's not only the test. It's also this hopefully-soon-standardized behavior of atexit(). You are simply not able to build a correct glibc with 2.95. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Mar 10 07:46:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 10 Mar 2001 07:46:00 -0000 Subject: libanl + atexit + more References: <20010306162639.E573@sunsite.ms.mff.cuni.cz> <20010310081334.T262@visi.net> Message-ID: Ben Collins writes: > How about not following the lame trend to only support bleeding edge. > Even when gcc-3.0 comes out, like any .0 release, it will be broken in > more ways than one. What are you talking about? I don't force anybody to use a recent compiler for its own sake. The old compiler is broken. Either fix it or don't use it. I don't care what you choose. There is nobody preventing you from fixing the compiler. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Mar 10 08:17:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 10 Mar 2001 08:17:00 -0000 Subject: ldconfig References: Message-ID: Andreas Schwab writes: > On ia64 we want to recognize libraries using ld-linux.so.2 as 32 bit libc6 > libraries. On the other hand, only i386 and m68k ever had a libc5 > implementation (please correct me if I'm wrong). This patch adds hooks to > readlib.c to allow platforms to add libraries and interpreters to > recognize. > > OK to install? I've applied it now. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Mar 10 08:18:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 10 Mar 2001 08:18:00 -0000 Subject: ldconfig References: Message-ID: Andreas Schwab writes: > Ok, should we add sysdeps/unix/sysv/linux/sparc/sparc32/ldconfig.h then? If somebody finds it necessary (and I doubt that this will be the case) s/he'll holler. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Mar 10 08:23:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 10 Mar 2001 08:23:00 -0000 Subject: [PATCH] Fix ld.so trace mode References: <20010308101329.A969@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > 2001-03-08 Jakub Jelinek > > * elf/rtld.c (dl_main): If tracing, warn about undefined symbols if > LD_WARN=1, not if LD_WARN is unset. I've applied this patch now. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Mar 10 08:31:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 10 Mar 2001 08:31:00 -0000 Subject: Kill some netdb.h related warnings References: <200103081957.f28Jv4Q00266@delius.kettenis.local> Message-ID: Mark Kettenis writes: > On the Hurd I need the attached patch to keep the compiler from > warning about `struct timespec' being declared inside a parameter > list. Thanks, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Mar 10 08:37:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 10 Mar 2001 08:37:00 -0000 Subject: small ia64 patches References: <200103092037.VAA12512@lxplus015.cern.ch> Message-ID: Jes Sorensen writes: > I have the following ones in my tree that I would like to have > applied. Uli, could you please apply? Done. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Mar 10 08:38:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 10 Mar 2001 08:38:00 -0000 Subject: sysdeps/unix/sysv/linux/sys/prctl.h References: <200103092044.VAA14853@lxplus015.cern.ch> Message-ID: Jes Sorensen writes: > sysdeps/unix/sysv/linux/sys/prctl.h is just including linux/prctl.h > instead of providing it's own definitions like most other header files > do. There is nothing in this kernel header which can cause problem. Not using it simply means adding one more item to the list of things which can be left behind. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jes@linuxcare.com Sat Mar 10 10:01:00 2001 From: jes@linuxcare.com (Jes Sorensen) Date: Sat, 10 Mar 2001 10:01:00 -0000 Subject: sysdeps/unix/sysv/linux/sys/prctl.h References: <200103092044.VAA14853@lxplus015.cern.ch> Message-ID: >>>>> "Ulrich" == Ulrich Drepper writes: Ulrich> Jes Sorensen writes: >> sysdeps/unix/sysv/linux/sys/prctl.h is just including linux/prctl.h >> instead of providing it's own definitions like most other header >> files do. Ulrich> There is nothing in this kernel header which can cause Ulrich> problem. Not using it simply means adding one more item to Ulrich> the list of things which can be left behind. Ok, it was my impression that we wanted to minimize glibc's use of kernel headers. Jes From aj@suse.de Sun Mar 11 07:36:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Sun, 11 Mar 2001 07:36:00 -0000 Subject: elf.h: Synch EM_* Message-ID: Here's a patch to synch the various EM_* constants with the official list maintained by David Prosser. Ok to commit? Andreas 2001-03-11 Andreas Jaeger * elf/elf.h (EM_*): Synch with official list. ============================================================ Index: elf/elf.h --- elf/elf.h 2001/03/09 17:31:34 1.89 +++ elf/elf.h 2001/03/11 15:32:55 @@ -169,6 +169,7 @@ #define EM_88K 5 /* Motorola m88k family */ #define EM_860 7 /* Intel 80860 */ #define EM_MIPS 8 /* MIPS R3000 big-endian */ +#define EM_S370 9 /* IBM System/370 */ #define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */ #define EM_PARISC 15 /* HPPA */ @@ -205,7 +206,8 @@ #define EM_ME16 59 /* Toyota ME16 processor */ #define EM_ST100 60 /* STMicroelectronic ST100 processor */ #define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/ -#define EM_X8664 62 /* AMD x86-64 */ +#define EM_X86_64 62 /* AMD x86-64 architecture */ +#define EM_PDSP 63 /* Sony DSP Processor */ #define EM_FX66 66 /* Siemens FX66 microcontroller */ #define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */ @@ -217,7 +219,23 @@ #define EM_SVX 73 /* Silicon Graphics SVx */ #define EM_AT19 74 /* STMicroelectronics ST19 8 bit mc */ #define EM_VAX 75 /* Digital VAX */ -#define EM_NUM 76 +#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ +#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */ +#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */ +#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */ +#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */ +#define EM_HUANY 81 /* Harvard University machine-independent object files */ +#define EM_PRISM 82 /* SiTera Prism */ +#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ +#define EM_FR30 84 /* Fujitsu FR30 */ +#define EM_D10V 85 /* Mitsubishi D10V */ +#define EM_D30V 86 /* Mitsubishi D30V */ +#define EM_V850 87 /* NEC v850 */ +#define EM_M32R 88 /* Mitsubishi M32R */ +#define EM_MN10300 89 /* Matsushita MN10300 */ +#define EM_MN10200 90 /* Matsushita MN10200 */ +#define EM_PJ 91 /* picoJava */ +#define EM_NUM 92 /* If it is necessary to assign new unofficial EM_* values, please pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Sun Mar 11 07:40:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 11 Mar 2001 07:40:00 -0000 Subject: elf.h: Synch EM_* References: Message-ID: Andreas Jaeger writes: > Ok to commit? Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sun Mar 11 16:10:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 11 Mar 2001 16:10:00 -0000 Subject: more math stuff Message-ID: I've just finished checking in the IBM math library code. But be aware: I haven't tested the code in glibc itself yet! None of the machines I have at home and which compile with reasonable speed use any of these functions. I'll test on Alpha soon but I had to check the code in to do this. I'll be gone soon for a few hours but will try to start looking at this once I'm back. So, best is to avoid updating in the moment. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Mon Mar 12 00:21:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Mon, 12 Mar 2001 00:21:00 -0000 Subject: Protect __STRING_INLINE in s390 Message-ID: I got this warning on S390 and fixed it with the appended patch: In file included from ../string/string.h:356, from ../include/string.h:49, from string-inlines.c:28: ../sysdeps/s390/bits/string.h:37: warning: `__STRING_INLINE' redefined I'm committing the patch now, Andreas 2001-03-12 Andreas Jaeger * sysdeps/s390/bits/string.h: Protect __STRING_INLINE against redefinition. ============================================================ Index: sysdeps/s390/bits/string.h --- sysdeps/s390/bits/string.h 2000/11/23 06:30:40 1.4 +++ sysdeps/s390/bits/string.h 2001/03/12 08:19:42 @@ -1,5 +1,5 @@ /* Optimized, inlined string functions. s390 version. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2001 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -31,10 +31,12 @@ #if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \ && defined __GNUC__ && __GNUC__ >= 2 -#ifdef __cplusplus -# define __STRING_INLINE inline -#else -# define __STRING_INLINE extern __inline +#ifndef __STRING_INLINE +# ifdef __cplusplus +# define __STRING_INLINE inline +# else +# define __STRING_INLINE extern __inline +# endif #endif #define _HAVE_STRING_ARCH_strlen 1 -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Mon Mar 12 05:16:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 12 Mar 2001 05:16:00 -0000 Subject: [PATCH] Use .note.ABI-tag in DSOs (take 2) References: <20010305193313.B573@sunsite.ms.mff.cuni.cz> <20010305113040.A30648@gnu.org> Message-ID: <20010312141924.D22218@sunsite.ms.mff.cuni.cz> On Mon, Mar 05, 2001 at 11:30:40AM -0800, H . J . Lu wrote: > On Mon, Mar 05, 2001 at 07:33:13PM +0100, Jakub Jelinek wrote: > > Hi! > > > > The following patch adds .note.ABI-tag to glibc DSOs, and disallows loading > > DSOs which are built for newer kernels than installed. The --enable-kernel > > I haven't looked at your patch. I built my glibc against the 2.4 kernel > headers. But I am running 2.2 kernel. It won't be a problem unless > glibc uses some features in the new kernel which has no fallback in > the old kernel. Yes, if you don't use --enable-kernel 2.4.0 or later, you can run glibc built against 2.4 headers on 2.2 kernel, the thing which the patch does is allowing multiple libraries built with various --enable-kernel settings to coexist on the same system and keep searching for other libraries if dynamic linker found a library it cannot use. > One of them is the thread register. The %gs based threading is actually the most important reason why people want a --enable-kernel 2.4.0+ libc, but then temporarily booting to 2.2 kernel is impossible. > How do you test those features? I don't think checking kernel version is a good idea. ld.so already checks kernel version even without this patch, the difference is that without this patch there is just one check when ld.so starts up, while this patch checks each library as it is being loaded. Below is an updated version, which supports LD_ASSUME_KERNEL environment override so one can force using libraries supporting kernels older than the one currently running, plus with one Makerules fix and one ldconfig bug which were present in the last patch. 2001-03-12 Jakub Jelinek * csu/Makefile (abi-tag.h): Define OS and version separately, allow version to be overriden from config.h. * csu/abi-note.S: Use OS and version separately, include config.h. * elf/dl-load.c (_dl_osversion): New. (_dl_map_object_from_fd): Kill some warnings. (open_verify): Check .note.ABI-tag of the library if present. * elf/Makefile (CPPFLAGS-dl-load.c): Add -I$(csu-objpfx). * elf/cache.c (struct cache_entry): Add osversion. (print_entry): Print osversion. (print_cache): Pass osversion to it. (compare): Sort according to osversion. (save_cache): Set osversion. (add_to_cache): Add osversion argument. * sysdeps/generic/ldconfig.h (add_to_cache, process_file, process_elf_file): Add osversion argument. * elf/readlib.c (process_file): Likewise. * sysdeps/generic/readelflib.c (process_elf_file): Likewise. * sysdeps/unix/sysv/linux/ia64/readelflib.c (process_elf_file, process_elf32_file, process_elf64_file): Likewise. * sysdeps/unix/sysv/linux/i386/readelflib.c (process_elf_file, process_elf32_file, process_elf64_file): Likewise. * sysdeps/unix/sysv/linux/sparc/readelflib.c (process_elf_file, process_elf32_file, process_elf64_file): Likewise. * elf/ldconfig.c (manual_link): Pass it. (search_dir): Issue diagnostic if two libs with the same soname in the same directory have different .note.ABI-tag. Record osversion in dlib_entry and use it from there. (struct lib_entry): Remove. (struct dlib_entry): Add osversion. * sysdeps/generic/dl-cache.c (_dl_load_cache_lookup): Check osversion. * sysdeps/generic/ldsodefs.h (_dl_osversion): Declare. * sysdeps/unix/sysv/linux/init-first.c: Include ldsodefs.h. * sysdeps/unix/sysv/linux/dl-osinfo.h (DL_SYSDEP_OSCHECK): Save kernel version in _dl_osversion. * sysdeps/unix/sysv/linux/configure.in: Define __ABI_TAG_VERSION. * sysdeps/unix/sysv/linux/configure: Rebuilt. * Makerules (build-shlib-helper, build-module-helper): New. (build-shlib, build-module-helper): Make sure .note.ABI-tag comes early. * config.h.in (__ABI_TAG_VERSION): Add. * elf/dl-minimal.c (__strtoul_internal): Set endptr on return. * sysdeps/unix/sysv/linux/i386/dl-librecon.h (EXTRA_LD_ENVVARS): Handle LD_ASSUME_KERNEL. * sysdeps/unix/sysv/linux/dl-librecon.h: New. --- libc/csu/Makefile.jj Mon Mar 12 11:10:04 2001 +++ libc/csu/Makefile Mon Mar 12 15:07:15 2001 @@ -168,12 +168,17 @@ $(objpfx)abi-tag.h: $(..)abi-tags $(make-target-directory) rm -f $@.new sed -e 's/#.*$$//' -e '/^[ ]*$$/d' $< | \ - while read conf tag; do \ + while read conf tagos tagver; do \ test `expr '$(config-machine)-$(config-vendor)-$(config-os)' \ : "$$conf"` != 0 || continue; \ - echo "$$tag" | \ - sed -e 's/[^0-9xXa-fA-F]/ /g' -e 's/ *$$//' \ - -e 's/ /,/g' -e 's/^ */#define ABI_TAG /' > $@.new; \ + ( echo "$$tagos" | \ + sed -e 's/[^0-9xXa-fA-F ]//' \ + -e 's/^/#define __ABI_TAG_OS /'; \ + echo "#ifndef __ABI_TAG_VERSION"; \ + echo "$$tagver" | \ + sed -e 's/[^0-9xXa-fA-F]/ /g' -e 's/ *$$//' \ + -e 's/ /,/g' -e 's/^/# define __ABI_TAG_VERSION /'; \ + echo "#endif" ) > $@.new; \ done if test -r $@.new; then mv -f $@.new $@; \ else echo >&2 'This configuration not matched in $<'; exit 1; fi --- libc/csu/abi-note.S.jj Mon Mar 12 11:10:11 2001 +++ libc/csu/abi-note.S Mon Mar 12 15:07:15 2001 @@ -1,5 +1,5 @@ /* Special .init and .fini section support. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it @@ -54,6 +54,7 @@ offset length contents identify the earliest release of that OS that supports this ABI. See abi-tags (top level) for details. */ +#include #include /* OS-specific ABI tag value */ /* The linker (GNU ld 2.8 and later) recognizes an allocated section whose @@ -67,5 +68,6 @@ offset length contents .long 1 /* note type */ 0: .asciz "GNU" /* vendor name */ 1: .align 4 -2: .long ABI_TAG /* note data: the ABI tag */ +2: .long __ABI_TAG_OS /* note data: the ABI tag */ + .long __ABI_TAG_VERSION 3: .align 4 /* pad out section */ --- libc/elf/Makefile.jj Mon Mar 12 11:10:11 2001 +++ libc/elf/Makefile Mon Mar 12 15:07:15 2001 @@ -188,7 +188,7 @@ $(objpfx)trusted-dirs.st: Makefile $(..) | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T}; $(move-if-change) ${@:st=T} ${@:st=h} touch $@ -CPPFLAGS-dl-load.c = -I$(objpfx). +CPPFLAGS-dl-load.c = -I$(objpfx). -I$(csu-objpfx). ifeq (yes,$(build-shared)) $(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force) --- libc/elf/cache.c.jj Mon Mar 12 11:10:11 2001 +++ libc/elf/cache.c Mon Mar 12 15:07:15 2001 @@ -39,6 +39,7 @@ struct cache_entry char *lib; /* Library name. */ char *path; /* Path to find library. */ int flags; /* Flags to indicate kind of library. */ + unsigned int osversion; /* Required OS version. */ uint64_t hwcap; /* Important hardware capabilities. */ int bits_hwcap; /* Number of bits set in hwcap. */ struct cache_entry *next; /* Next entry in list. */ @@ -52,7 +53,8 @@ static const char *flag_descr[] = /* Print a single entry. */ static void -print_entry (const char *lib, int flag, uint64_t hwcap, const char *key) +print_entry (const char *lib, int flag, unsigned int osversion, + uint64_t hwcap, const char *key) { printf ("\t%s (", lib); switch (flag & FLAG_TYPE_MASK) @@ -85,6 +87,23 @@ print_entry (const char *lib, int flag, } if (hwcap != 0) printf (", hwcap: 0x%" PRIx64, hwcap); + if (osversion != 0) + { + static const char * const abi_tag_os [] = + { + [0] = "Linux", + [1] = "Hurd", + [2] = "Solaris", + [3] = "Unknown OS" + }; + unsigned int os = osversion >> 24; + + printf (", OS ABI: %s %d.%d.%d", + abi_tag_os [os > 3 ? 3 : os], + (osversion >> 16) & 0xff, + (osversion >> 8) & 0xff, + osversion & 0xff); + } printf (") => %s\n", key); } @@ -167,7 +186,7 @@ print_cache (const char *cache_name) /* Print everything. */ for (i = 0; i < cache->nlibs; i++) print_entry (cache_data + cache->libs[i].key, - cache->libs[i].flags, 0, + cache->libs[i].flags, 0, 0, cache_data + cache->libs[i].value); } else if (format == 1) @@ -178,6 +197,7 @@ print_cache (const char *cache_name) for (i = 0; i < cache_new->nlibs; i++) print_entry (cache_data + cache_new->libs[i].key, cache_new->libs[i].flags, + cache_new->libs[i].osversion, cache_new->libs[i].hwcap, cache_data + cache_new->libs[i].value); } @@ -217,6 +237,10 @@ int compare (const struct cache_entry *e return 1; else if (e2->hwcap < e1->hwcap) return -1; + if (e2->osversion > e1->osversion) + return 1; + if (e2->osversion < e1->osversion) + return -1; } return res; } @@ -319,9 +343,9 @@ save_cache (const char *cache_name) always begins at the beginning of the the new cache struct. */ file_entries_new->libs[idx_new].flags = entry->flags; + file_entries_new->libs[idx_new].osversion = entry->osversion; file_entries_new->libs[idx_new].hwcap = entry->hwcap; file_entries_new->libs[idx_new].key = str_offset; - file_entries_new->libs[idx_new].__unused = 0; } len = strlen (entry->lib); str = stpcpy (str, entry->lib); @@ -414,7 +438,7 @@ save_cache (const char *cache_name) /* Add one library to the cache. */ void add_to_cache (const char *path, const char *lib, int flags, - uint64_t hwcap) + unsigned int osversion, uint64_t hwcap) { struct cache_entry *new_entry, *ptr, *prev; char *full_path; @@ -430,6 +454,7 @@ add_to_cache (const char *path, const ch new_entry->lib = xstrdup (lib); new_entry->path = full_path; new_entry->flags = flags; + new_entry->osversion = osversion; new_entry->hwcap = hwcap; new_entry->bits_hwcap = 0; --- libc/elf/dl-load.c.jj Mon Mar 12 11:10:12 2001 +++ libc/elf/dl-load.c Mon Mar 12 15:07:15 2001 @@ -30,6 +30,8 @@ #include #include #include "dynamic-link.h" +#include +#include #include @@ -111,6 +113,8 @@ struct filebuf size_t _dl_pagesize; +unsigned int _dl_osversion; + int _dl_clktck; extern const char *_dl_platform; @@ -1061,12 +1065,12 @@ _dl_map_object_from_fd (const char *name if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) _dl_debug_printf (" dynamic: 0x%0*lx base: 0x%0*lx size: 0x%0*Zx\n" " entry: 0x%0*lx phdr: 0x%0*lx phnum: %*u\n\n", - sizeof (void *) * 2, (unsigned long int) l->l_ld, - sizeof (void *) * 2, (unsigned long int) l->l_addr, - sizeof (void *) * 2, maplength, - sizeof (void *) * 2, (unsigned long int) l->l_entry, - sizeof (void *) * 2, (unsigned long int) l->l_phdr, - sizeof (void *) * 2, l->l_phnum); + (int) sizeof (void *) * 2, (unsigned long int) l->l_ld, + (int) sizeof (void *) * 2, (unsigned long int) l->l_addr, + (int) sizeof (void *) * 2, maplength, + (int) sizeof (void *) * 2, (unsigned long int) l->l_entry, + (int) sizeof (void *) * 2, (unsigned long int) l->l_phdr, + (int) sizeof (void *) * 2, l->l_phnum); elf_get_dynamic_info (l); @@ -1213,6 +1217,10 @@ open_verify (const char *name, struct fi [EI_OSABI] = ELFOSABI_SYSV, [EI_ABIVERSION] = 0 }; + static const struct { + ElfW(Word) vendorlen, datalen, type; + char vendor [4]; + } expected_note = { 4, 16, 1, "GNU" }; int fd; /* Open the file. We always open files read-only. */ @@ -1220,6 +1228,10 @@ open_verify (const char *name, struct fi if (fd != -1) { ElfW(Ehdr) *ehdr; + ElfW(Phdr) *phdr, *ph; + ElfW(Word) *abi_note, abi_note_buf[8]; + unsigned int osversion; + size_t maplength; /* We successfully openened the file. Now verify it is a file we can use. */ @@ -1287,12 +1299,7 @@ open_verify (const char *name, struct fi lose (0, fd, name, NULL, NULL, N_("ELF file version does not match current one")); if (! __builtin_expect (elf_machine_matches_host (ehdr), 1)) - { - close_and_out: - __close (fd); - __set_errno (ENOENT); - fd = -1; - } + goto close_and_out; else if (__builtin_expect (ehdr->e_phentsize, sizeof (ElfW(Phdr))) != sizeof (ElfW(Phdr))) lose (0, fd, name, NULL, NULL, @@ -1301,6 +1308,50 @@ open_verify (const char *name, struct fi && __builtin_expect (ehdr->e_type, ET_EXEC) != ET_EXEC) lose (0, fd, name, NULL, NULL, N_("only ET_DYN and ET_EXEC can be loaded")); + + maplength = ehdr->e_phnum * sizeof (ElfW(Phdr)); + if (ehdr->e_phoff + maplength <= fbp->len) + phdr = (void *) (fbp->buf + ehdr->e_phoff); + else + { + phdr = alloca (maplength); + __lseek (fd, SEEK_SET, ehdr->e_phoff); + if (__libc_read (fd, (void *) phdr, maplength) != maplength) + lose (errno, fd, name, NULL, NULL, N_("cannot read file data")); + } + + /* Check .note.ABI-tag if present. */ + for (ph = phdr; ph < &phdr[ehdr->e_phnum]; ++ph) + if (ph->p_type == PT_NOTE && ph->p_filesz == 32 && ph->p_align >= 4) + { + if (ph->p_offset + 32 <= fbp->len) + abi_note = (void *) (fbp->buf + ph->p_offset); + else + { + __lseek (fd, SEEK_SET, ph->p_offset); + if (__libc_read (fd, (void *) abi_note_buf, 32) != 32) + lose (errno, fd, name, NULL, NULL, + N_("cannot read file data")); + abi_note = abi_note_buf; + } + + if (memcmp (abi_note, &expected_note, sizeof (expected_note))) + continue; + + osversion = (abi_note [5] & 0xff) * 65536 + + (abi_note [6] & 0xff) * 256 + + (abi_note [7] & 0xff); + if (abi_note [4] != __ABI_TAG_OS + || (_dl_osversion && _dl_osversion < osversion)) + { + close_and_out: + __close (fd); + __set_errno (ENOENT); + fd = -1; + } + + break; + } } return fd; --- libc/elf/dl-minimal.c.jj Mon Mar 12 11:10:12 2001 +++ libc/elf/dl-minimal.c Mon Mar 12 15:07:15 2001 @@ -252,6 +252,8 @@ __strtoul_internal (const char *nptr, ch || (result == ULONG_MAX / 10 && digval > ULONG_MAX % 10)) { errno = ERANGE; + if (endptr != NULL) + *endptr = (char *) nptr; return ULONG_MAX; } result *= base; @@ -259,5 +261,7 @@ __strtoul_internal (const char *nptr, ch ++nptr; } + if (endptr != NULL) + *endptr = (char *) nptr; return result * sign; } --- libc/elf/ldconfig.c.jj Mon Mar 12 11:11:29 2001 +++ libc/elf/ldconfig.c Mon Mar 12 15:07:15 2001 @@ -48,14 +48,6 @@ #define PACKAGE _libc_intl_domainname -struct lib_entry - { - int flags; - uint64_t hwcap; - char *lib; - char *path; - }; - static const struct { const char *name; @@ -460,6 +452,7 @@ manual_link (char *library) char *soname; struct stat64 stat_buf; int flag; + unsigned int osversion; /* Prepare arguments for create_links call. Split library name in directory and filename first. Since path is allocated, we've got @@ -524,7 +517,8 @@ manual_link (char *library) free (path); return; } - if (process_file (real_library, library, libname, &flag, &soname, 0)) + if (process_file (real_library, library, libname, &flag, &osversion, + &soname, 0)) { error (0, 0, _("No link created since soname could not be found for %s"), library); @@ -568,6 +562,7 @@ struct dlib_entry char *soname; int flag; int is_link; + unsigned int osversion; struct dlib_entry *next; }; @@ -585,6 +580,7 @@ search_dir (const struct dir_entry *entr struct stat64 stat_buf; int is_link; uint64_t hwcap = path_hwcap (entry->path); + unsigned int osversion; file_name_len = PATH_MAX; file_name = alloca (file_name_len); @@ -700,7 +696,7 @@ search_dir (const struct dir_entry *entr real_name = real_file_name; if (process_file (real_name, file_name, direntry->d_name, &flag, - &soname, is_link)) + &osversion, &soname, is_link)) { if (real_name != real_file_name) free (real_name); @@ -762,6 +758,11 @@ search_dir (const struct dir_entry *entr error (0, 0, _("libraries %s and %s in directory %s have same soname but different type."), dlib_ptr->name, direntry->d_name, entry->path); } + /* OS version should be the same - sanity check. */ + if (dlib_ptr->osversion != osversion) + error (0, 0, _("libraries %s and %s in directory %s have same\n" + "soname but different minimal supported OS version."), + dlib_ptr->name, direntry->d_name, entry->path); free (dlib_ptr->name); dlib_ptr->name = xstrdup (direntry->d_name); dlib_ptr->is_link = is_link; @@ -778,6 +779,7 @@ search_dir (const struct dir_entry *entr dlib_ptr = (struct dlib_entry *)xmalloc (sizeof (struct dlib_entry)); dlib_ptr->name = xstrdup (direntry->d_name); dlib_ptr->flag = flag; + dlib_ptr->osversion = osversion; dlib_ptr->soname = soname; dlib_ptr->is_link = is_link; /* Add at head of list. */ @@ -797,7 +799,8 @@ search_dir (const struct dir_entry *entr create_links (dir_name, entry->path, dlib_ptr->name, dlib_ptr->soname); if (opt_build_cache) - add_to_cache (entry->path, dlib_ptr->soname, dlib_ptr->flag, hwcap); + add_to_cache (entry->path, dlib_ptr->soname, dlib_ptr->flag, + dlib_ptr->osversion, hwcap); } /* Free all resources. */ --- libc/elf/readlib.c.jj Mon Mar 12 11:11:29 2001 +++ libc/elf/readlib.c Mon Mar 12 15:07:30 2001 @@ -70,7 +70,8 @@ static struct known_names known_libs [] /* Returns 0 if everything is ok, != 0 in case of error. */ int process_file (const char *real_file_name, const char *file_name, - const char *lib, int *flag, char **soname, int is_link) + const char *lib, int *flag, unsigned int *osversion, + char **soname, int is_link) { FILE *file; struct stat64 statbuf; @@ -161,8 +162,8 @@ process_file (const char *real_file_name goto done; } - if (process_elf_file (file_name, lib, flag, soname, file_contents, - statbuf.st_size)) + if (process_elf_file (file_name, lib, flag, osversion, soname, + file_contents, statbuf.st_size)) ret = 1; done: --- libc/sysdeps/generic/dl-cache.c.jj Mon Mar 12 11:10:13 2001 +++ libc/sysdeps/generic/dl-cache.c Mon Mar 12 15:07:30 2001 @@ -228,6 +228,8 @@ _dl_load_cache_lookup (const char *name) /* Only accept hwcap if it's for the right platform. */ #define HWCAP_CHECK \ + if (_dl_osversion && cache_new->libs[middle].osversion > _dl_osversion) \ + continue; \ if (_DL_PLATFORMS_COUNT && platform != -1 \ && (cache_new->libs[middle].hwcap & _DL_HWCAP_PLATFORM) != 0 \ && (cache_new->libs[middle].hwcap & _DL_HWCAP_PLATFORM) != platform) \ --- libc/sysdeps/generic/dl-cache.h.jj Mon Mar 12 11:10:13 2001 +++ libc/sysdeps/generic/dl-cache.h Mon Mar 12 15:07:30 2001 @@ -76,7 +76,7 @@ struct file_entry_new { int32_t flags; /* This is 1 for an ELF library. */ uint32_t key, value; /* String table indices. */ - uint32_t __unused; /* Align next field always on 8 byte boundary. */ + uint32_t osversion; /* Required OS version. */ uint64_t hwcap; /* Hwcap entry. */ }; --- libc/sysdeps/generic/ldsodefs.h.jj Mon Mar 12 11:10:15 2001 +++ libc/sysdeps/generic/ldsodefs.h Mon Mar 12 15:07:30 2001 @@ -173,6 +173,9 @@ extern char **_dl_argv; /* Cached value of `getpagesize ()'. */ extern size_t _dl_pagesize; +/* OS version. */ +extern unsigned int _dl_osversion; + /* File descriptor referring to the zero-fill device. */ extern int _dl_zerofd; --- libc/sysdeps/generic/readelflib.c.jj Mon Mar 12 11:10:15 2001 +++ libc/sysdeps/generic/readelflib.c Mon Mar 12 15:07:30 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 1999 and Jakub Jelinek , 1999. @@ -41,7 +41,8 @@ do \ /* Returns 0 if everything is ok, != 0 in case of error. */ int process_elf_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length) + unsigned int *osversion, char **soname, void *file_contents, + size_t file_length) { int i; unsigned int j; @@ -56,6 +57,7 @@ process_elf_file (const char *file_name, char *dynamic_strings; elf_header = (ElfW(Ehdr) *) file_contents; + *osversion = 0; if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS)) { @@ -110,6 +112,7 @@ process_elf_file (const char *file_name, dynamic_addr = segment->p_offset; dynamic_size = segment->p_filesz; break; + case PT_INTERP: program_interpreter = (char *) (file_contents + segment->p_offset); check_ptr (program_interpreter); @@ -123,6 +126,21 @@ process_elf_file (const char *file_name, break; } break; + + case PT_NOTE: + if (!*osversion && segment->p_filesz == 32 && segment->p_align >= 4) + { + ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents + + segment->p_offset); + if (abi_note [0] == 4 && abi_note [1] == 16 && abi_note [2] == 1 + && memcmp (abi_note + 3, "GNU", 4) == 0) + *osversion = (abi_note [4] << 24) | + ((abi_note [5] & 0xff) << 16) | + ((abi_note [6] & 0xff) << 8) | + (abi_note [7] & 0xff); + } + break; + default: break; } --- libc/sysdeps/generic/ldconfig.h.jj Mon Mar 12 15:09:21 2001 +++ libc/sysdeps/generic/ldconfig.h Mon Mar 12 15:09:25 2001 @@ -39,17 +39,17 @@ extern void init_cache (void); extern void save_cache (const char *cache_name); extern void add_to_cache (const char *path, const char *lib, int flags, - uint64_t hwcap); + unsigned int osversion, uint64_t hwcap); /* Declared in readlib.c. */ extern int process_file (const char *real_file_name, const char *file_name, - const char *lib, int *flag, char **soname, - int is_link); + const char *lib, int *flag, unsigned int *osversion, + char **soname, int is_link); /* Declared in readelflib.c. */ extern int process_elf_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, - size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); /* Declared in chroot_canon.c. */ extern char *chroot_canon (const char *chroot, const char *name); --- libc/sysdeps/unix/sysv/linux/ia64/readelflib.c.jj Mon Mar 12 11:10:17 2001 +++ libc/sysdeps/unix/sysv/linux/ia64/readelflib.c Mon Mar 12 15:07:31 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001 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 @@ -18,25 +18,28 @@ int process_elf32_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); int process_elf64_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); /* Returns 0 if everything is ok, != 0 in case of error. */ int process_elf_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length) + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length) { ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; int ret; if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) - return process_elf32_file (file_name, lib, flag, soname, file_contents, - file_length); + return process_elf32_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); else { - ret = process_elf64_file (file_name, lib, flag, soname, file_contents, - file_length); + ret = process_elf64_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); /* Intel 64bit libraries are always libc.so.6+. */ if (!ret) *flag = FLAG_IA64_LIB64|FLAG_ELF_LIBC6; --- libc/sysdeps/unix/sysv/linux/i386/dl-librecon.h.jj Mon Mar 12 11:10:17 2001 +++ libc/sysdeps/unix/sysv/linux/i386/dl-librecon.h Mon Mar 12 15:07:31 2001 @@ -48,6 +48,29 @@ /* Recognizing extra environment variables. */ #define EXTRA_LD_ENVVARS \ + case 13: \ + if (memcmp (&envline[3], "ASSUME_KERNEL", 13) == 0) \ + { \ + unsigned long int i, j, osversion = 0; \ + char *p = &envline[17], *q; \ + \ + for (i = 0; i < 3; i++, p = q + 1) \ + { \ + j = __strtoul_internal (p, &q, 0, 0); \ + if (j >= 255 || p == q || (i < 2 && *q && *q != '.')) \ + { \ + osversion = 0; \ + break; \ + } \ + osversion |= j << (16 - 8 * i); \ + if (!*q) \ + break; \ + } \ + if (osversion) \ + _dl_osversion = osversion; \ + break; \ + } \ + \ case 15: \ if (memcmp (&envline[3], "LIBRARY_VERSION", 15) == 0) \ { \ --- libc/sysdeps/unix/sysv/linux/i386/readelflib.c.jj Mon Mar 12 11:10:17 2001 +++ libc/sysdeps/unix/sysv/linux/i386/readelflib.c Mon Mar 12 15:07:31 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 1999 and Jakub Jelinek , 2000. @@ -20,23 +20,24 @@ int process_elf32_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, - size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); int process_elf64_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, - size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); /* Returns 0 if everything is ok, != 0 in case of error. */ int process_elf_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length) + unsigned int *osversion, char **soname, void *file_contents, + size_t file_length) { ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; int ret; if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) - return process_elf32_file (file_name, lib, flag, soname, file_contents, - file_length); + return process_elf32_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); else { switch (elf_header->e_machine) @@ -50,8 +51,8 @@ process_elf_file (const char *file_name, return 1; } - ret = process_elf64_file (file_name, lib, flag, soname, file_contents, - file_length); + ret = process_elf64_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); /* IA64/X86-64 64bit libraries are always libc.so.6+. */ if (!ret) switch (elf_header->e_machine) --- libc/sysdeps/unix/sysv/linux/sparc/readelflib.c.jj Mon Mar 12 11:10:18 2001 +++ libc/sysdeps/unix/sysv/linux/sparc/readelflib.c Mon Mar 12 15:07:31 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger , 1999 and Jakub Jelinek , 1999. @@ -20,27 +20,28 @@ int process_elf32_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, - size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); int process_elf64_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, - size_t file_length); + unsigned int *osversion, char **soname, + void *file_contents, size_t file_length); /* Returns 0 if everything is ok, != 0 in case of error. */ int process_elf_file (const char *file_name, const char *lib, int *flag, - char **soname, void *file_contents, size_t file_length) + unsigned int *osversion, char **soname, void *file_contents, + size_t file_length) { ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents; int ret; if (elf_header->e_ident [EI_CLASS] == ELFCLASS32) - return process_elf32_file (file_name, lib, flag, soname, file_contents, - file_length); + return process_elf32_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); else { - ret = process_elf64_file (file_name, lib, flag, soname, file_contents, - file_length); + ret = process_elf64_file (file_name, lib, flag, osversion, soname, + file_contents, file_length); /* Sparc 64bit libraries are always libc.so.6+. */ if (!ret) *flag = FLAG_SPARC_LIB64|FLAG_ELF_LIBC6; --- libc/sysdeps/unix/sysv/linux/configure.jj Mon Mar 12 11:10:17 2001 +++ libc/sysdeps/unix/sysv/linux/configure Mon Mar 12 15:07:31 2001 @@ -87,6 +87,7 @@ if test -n "$minimum_kernel"; then echo $ac_n "checking for kernel header at least $minimum_kernel""... $ac_c" 1>&6 echo "configure:89: checking for kernel header at least $minimum_kernel" >&5 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`; + abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`; cat > conftest.$ac_ext <> confdefs.h <> confdefs.h < #if LINUX_VERSION_CODE < $decnum @@ -82,6 +83,7 @@ eat flaming death AC_MSG_RESULT($libc_minimum_kernel) if test "$libc_minimum_kernel" = ok; then AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum) + AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum) else AC_MSG_ERROR([*** The available kernel headers are older than the requested *** compatible kernel version]) --- libc/sysdeps/unix/sysv/linux/dl-librecon.h.jj Mon Mar 12 15:07:31 2001 +++ libc/sysdeps/unix/sysv/linux/dl-librecon.h Mon Mar 12 15:07:31 2001 @@ -0,0 +1,49 @@ +/* Optional code to distinguish library flavours. + Copyright (C) 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2001. + + 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _DL_LIBRECON_H +#define _DL_LIBRECON_H 1 + +/* Recognizing extra environment variables. */ +#define EXTRA_LD_ENVVARS \ + case 13: \ + if (memcmp (&envline[3], "ASSUME_KERNEL", 13) == 0) \ + { \ + unsigned long int i, j, osversion = 0; \ + char *p = &envline[17], *q; \ + \ + for (i = 0; i < 3; i++, p = q + 1) \ + { \ + j = __strtoul_internal (p, &q, 0, 0); \ + if (j >= 255 || p == q || (i < 2 && *q && *q != '.')) \ + { \ + osversion = 0; \ + break; \ + } \ + osversion |= j << (16 - 8 * i); \ + if (!*q) \ + break; \ + } \ + if (osversion) \ + _dl_osversion = osversion; \ + break; \ + } + +#endif /* dl-librecon.h */ --- libc/sysdeps/unix/sysv/linux/dl-osinfo.h.jj Mon Mar 12 11:10:17 2001 +++ libc/sysdeps/unix/sysv/linux/dl-osinfo.h Mon Mar 12 15:07:31 2001 @@ -102,5 +102,7 @@ dl_fatal (const char *str) if (version < __LINUX_KERNEL_VERSION) \ /* Not sufficent. */ \ FATAL ("FATAL: kernel too old\n"); \ + \ + _dl_osversion = version; \ } \ } while (0) --- libc/sysdeps/unix/sysv/linux/init-first.c.jj Mon Mar 12 11:10:17 2001 +++ libc/sysdeps/unix/sysv/linux/init-first.c Mon Mar 12 15:07:31 2001 @@ -29,6 +29,7 @@ #include #ifndef SHARED +# include # include "dl-osinfo.h" #endif --- libc/Makerules.jj Mon Mar 12 11:09:59 2001 +++ libc/Makerules Mon Mar 12 15:07:15 2001 @@ -413,29 +413,75 @@ endif lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(+interp) $(build-shlib) -define build-shlib -$(LINK.o) -shared -Wl,-O1 -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \ +define build-shlib-helper +$(LINK.o) -shared -Wl,-O1 $(sysdep-LDFLAGS) $(config-LDFLAGS) \ $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \ $(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \ -Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \ $(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \ - -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \ - -Wl,--whole-archive \ + -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) +endef + +ifeq (yes,$(elf)) +# binutils only position loadable notes into the first page for binaries, +# not for shared objects +define build-shlib +$(build-shlib-helper) \ + -o $@.new $(csu-objpfx)/abi-note.o -Wl,--verbose \ + $(LDLIBS-$(@F:lib%.so=%).so) 2>&1 | \ + sed -e '/^=========/,/^=========/!d;/^=========/d' \ + -e 's/^.*\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \ + > $@.lds; \ + rm -f $@.new; \ + $(build-shlib-helper) -o $@ -T $@.lds \ + -Wl,--whole-archive $(csu-objpfx)/abi-note.o \ + $(filter-out $(map-file) $(+preinit) $(+postinit),$^) \ + $(no-whole-archive) $(LDLIBS-$(@F:lib%.so=%).so); \ + rm -f $@.lds +endef +else +define build-shlib +$(build-shlib-helper) \ + -o $@ -Wl,--whole-archive \ $(filter-out $(map-file) $(+preinit) $(+postinit),$^) \ $(no-whole-archive) $(LDLIBS-$(@F:lib%.so=%).so) endef +endif + +define build-module-helper +$(LINK.o) -shared $(sysdep-LDFLAGS) $(config-LDFLAGS) \ + -B$(csu-objpfx) $(load-map-file) \ + $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \ + -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) +endef # This macro is similar to build-shlib but it does not define a soname # and it does not depend on the destination name to start with `lib'. +ifeq (yes,$(elf)) +# binutils only position loadable notes into the first page for binaries, +# not for shared objects define build-module -$(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \ - -B$(csu-objpfx) $(load-map-file) \ - $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \ - -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \ - -Wl,--whole-archive \ +$(build-module-helper) \ + -o $@.new $(csu-objpfx)/abi-note.o -Wl,--verbose \ + $(LDLIBS-$(@F:lib%.so=%).so) 2>&1 | \ + sed -e '/^=========/,/^=========/!d;/^=========/d' \ + -e 's/^.*\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \ + > $@.lds; \ + rm -f $@.new; \ + $(build-module-helper) -o $@ -T $@.lds \ + -Wl,--whole-archive $(csu-objpfx)/abi-note.o \ + $(filter-out $(map-file) $(+preinit) $(+postinit),$^) \ + $(no-whole-archive) $(LDLIBS-$(@F:lib%.so=%).so); \ + rm -f $@.lds +endef +else +define build-module +$(build-module-helper) \ + -o $@ -Wl,--whole-archive \ $(filter-out $(map-file) $(+preinit) $(+postinit),$^) \ $(no-whole-archive) $(LDLIBS-$(@F:%.so=%).so) endef +endif # Don't try to use -lc when making libc.so itself. # Also omits crti.o and crtn.o, which we do not want --- libc/config.h.in.jj Mon Mar 12 11:10:04 2001 +++ libc/config.h.in Mon Mar 12 15:07:15 2001 @@ -93,6 +93,9 @@ /* Linux specific: minimum supported kernel version. */ #undef __LINUX_KERNEL_VERSION +/* Override abi-tags ABI version if necessary. */ +#undef __ABI_TAG_VERSION + /* An extension in gcc 2.96 and up allows the subtraction of two local labels. */ #undef HAVE_SUBTRACT_LOCAL_LABELS Jakub From kukuk@suse.de Mon Mar 12 07:08:00 2001 From: kukuk@suse.de (Thorsten Kukuk) Date: Mon, 12 Mar 2001 07:08:00 -0000 Subject: Protect __STRING_INLINE in s390 References: Message-ID: <20010312160751.A14874@suse.de> Hi, On Mon, Mar 12, Andreas Jaeger wrote: > > I got this warning on S390 and fixed it with the appended patch: > In file included from ../string/string.h:356, > from ../include/string.h:49, > from string-inlines.c:28: > ../sysdeps/s390/bits/string.h:37: warning: `__STRING_INLINE' redefined > > I'm committing the patch now, The patch is wrong. With this patch, glibc will not compile any longer on s390. You get a lot of errors about duplicate string symbols. Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE GmbH Schanzaeckerstr. 10 90443 Nuernberg Linux is like a Vorlon. It is incredibly powerful, gives terse, cryptic answers and has a lot of things going on in the background. From kukuk@suse.de Mon Mar 12 07:15:00 2001 From: kukuk@suse.de (Thorsten Kukuk) Date: Mon, 12 Mar 2001 07:15:00 -0000 Subject: Protect __STRING_INLINE in s390 References: Message-ID: <20010312161533.A27063@suse.de> Here is the error mesage which I forgot in the last email: gcc -nostdlib -nostartfiles -r -o /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.os \ -Wl,-d -Wl,--whole-archive /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.a /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.a(string-inlines.os): In function `strcpy': /usr/src/packages/BUILD/glibc-2.2.2/string/../sysdeps/s390/bits/string.h:63: multiple definition of `strcpy' /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.a(strcpy.os)(.text+0x0): first defined here /usr/bin/ld: Warning: size of symbol `strcpy' changed from 14 to 24 in string-inlines.os /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.a(string-inlines.os): In function `strlen': /usr/src/packages/BUILD/glibc-2.2.2/string/../sysdeps/s390/bits/string.h:45: multiple definition of `strlen' /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.a(strlen.os):/usr/src/packages/BUILD/glibc-2.2.2/str ing/../sysdeps/generic/strlen.c:31: first defined here /usr/bin/ld: Warning: size of symbol `strlen' changed from 188 to 28 in string-inlines.os /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.a(string-inlines.os): In function `strncpy': /usr/src/packages/BUILD/glibc-2.2.2/string/../sysdeps/s390/bits/string.h:77: multiple definition of `strncpy' /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.a(strncpy.os)(.text+0x0): first defined here /usr/bin/ld: Warning: size of symbol `strncpy' changed from 164 to 58 in string-inlines.os /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.a(string-inlines.os): In function `strcat': /usr/src/packages/BUILD/glibc-2.2.2/string/../sysdeps/s390/bits/string.h:102: multiple definition of `strcat' /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.a(strcat.os):/usr/src/packages/BUILD/glibc-2.2.2/str ing/../sysdeps/generic/strcat.c:29: first defined here /usr/bin/ld: Warning: size of symbol `strcat' changed from 68 to 36 in string-inlines.os /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.a(string-inlines.os): In function `strncat': /usr/src/packages/BUILD/glibc-2.2.2/string/../sysdeps/s390/bits/string.h:121: multiple definition of `strncat' /usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.a(strncat.os):/usr/src/packages/BUILD/glibc-2.2.2/st ring/../sysdeps/generic/strncat.c:34: first defined here /usr/bin/ld: Warning: size of symbol `strncat' changed from 252 to 64 in string-inlines.os collect2: ld returned 1 exit status make[1]: *** [/usr/src/packages/BUILD/glibc-2.2.2/cc/libc_pic.os] Error 1 make[1]: Leaving directory `/usr/src/packages/BUILD/glibc-2.2.2' make: *** [all] Error 2 -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE GmbH Schanzaeckerstr. 10 90443 Nuernberg Linux is like a Vorlon. It is incredibly powerful, gives terse, cryptic answers and has a lot of things going on in the background. From schwidefsky@de.ibm.com Mon Mar 12 10:13:00 2001 From: schwidefsky@de.ibm.com (schwidefsky@de.ibm.com) Date: Mon, 12 Mar 2001 10:13:00 -0000 Subject: Protect __STRING_INLINE in s390 Message-ID: >> >> I got this warning on S390 and fixed it with the appended patch: >> In file included from ../string/string.h:356, >> from ../include/string.h:49, >> from string-inlines.c:28: >> ../sysdeps/s390/bits/string.h:37: warning: `__STRING_INLINE' redefined >> >> I'm committing the patch now, > >The patch is wrong. With this patch, glibc will not compile any >longer on s390. You get a lot of errors about duplicate string >symbols. He is right. Although I don't understand it, how can an #ifndef protection of __STRING_INLINE change anything ? blue skies, Martin Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch????naicherstr. 220, D-71032 B????blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com From drepper@redhat.com Mon Mar 12 18:10:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 12 Mar 2001 18:10:00 -0000 Subject: IBM libm integration done Message-ID: I've finished the IBM libm integration. I get again no errors in the test suite (and obviously no link problems either). I've not yet adjusted the error values. Oh, and this is all on Alpha. Your mileage may (but shouldn't) vary. For those interested, the only problems I found were namespace issues and the handling of boundary cases. Fixing the latter took me the whole afternoon. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kukuk@suse.de Tue Mar 13 01:46:00 2001 From: kukuk@suse.de (Thorsten Kukuk) Date: Tue, 13 Mar 2001 01:46:00 -0000 Subject: res_init in glibc 2.2.2 Message-ID: <20010313104638.A26274@suse.de> Hi, I have a problem with the following patch: 2000-12-02 H.J. Lu * resolv/res_libc.c (res_init): Don't make it default. The result is, it is no longer possible for a program to link against res_init. What where the reasons for this ? Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE GmbH Schanzaeckerstr. 10 90443 Nuernberg Linux is like a Vorlon. It is incredibly powerful, gives terse, cryptic answers and has a lot of things going on in the background. From schwab@suse.de Tue Mar 13 03:17:00 2001 From: schwab@suse.de (Andreas Schwab) Date: Tue, 13 Mar 2001 03:17:00 -0000 Subject: Literal CR in C source Message-ID: The new gcc treats literal CRs like newlines in a source file. This breaks posix/ptestcases.h. 2001-03-13 Andreas Schwab * posix/PTESTS2C.sed: Replace literal CRs by `\r'. --- posix/PTESTS2C.sed.~1.1.~ Sun May 17 00:25:39 1998 +++ posix/PTESTS2C.sed Tue Mar 6 10:23:07 2001 @@ -2,3 +2,4 @@ s/# \(.*\)/ { 0, 0, "\1", NULL, },/ s/\([^????]*\)????\([^????]*\)????\([^????]*\)????\([^????]*\)????\(.*\)/ { \1, \2, "\3", "\4", \5 },/ s/\\/\\\\/g +s/ /\\r/g -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 From kukuk@suse.de Tue Mar 13 04:45:00 2001 From: kukuk@suse.de (Thorsten Kukuk) Date: Tue, 13 Mar 2001 04:45:00 -0000 Subject: [PATCH] for s390/string.h Message-ID: <20010313134515.A2445@suse.de> Hi, here is a Patch which fixes the problem with the s390 string.h header file. It know compiles without warning or errors. 2001-03-13 Thorsten Kukuk * sysdeps/s390/bis/string.h: Add _FORCE_INLINES ifdefs --- sysdeps/s390/bits/string.h 2001/03/12 08:21:29 1.5 +++ sysdeps/s390/bits/string.h 2001/03/13 09:51:19 @@ -40,6 +40,7 @@ #endif #define _HAVE_STRING_ARCH_strlen 1 +#ifndef _FORCE_INLINES __STRING_INLINE size_t strlen (__const char *__str) { @@ -55,9 +56,11 @@ : "cc", "0" ); return __len; } +#endif /* Copy SRC to DEST. */ #define _HAVE_STRING_ARCH_strcpy 1 +#ifndef _FORCE_INLINES __STRING_INLINE char * strcpy (char *__dest, __const char *__src) { @@ -70,8 +73,10 @@ : "cc", "memory", "0" ); return tmp; } +#endif #define _HAVE_STRING_ARCH_strncpy 1 +#ifndef _FORCE_INLINES __STRING_INLINE char * strncpy (char *__dest, __const char *__src, size_t __n) { @@ -94,9 +99,11 @@ : "cc", "memory", "0" ); return tmp; } +#endif /* Append SRC onto DEST. */ #define _HAVE_STRING_ARCH_strcat 1 +#ifndef _FORCE_INLINES __STRING_INLINE char * strcat(char *__dest, const char *__src) { @@ -113,9 +120,11 @@ : "cc", "memory", "0" ); return tmp; } +#endif /* Append no more than N characters from SRC onto DEST. */ #define _HAVE_STRING_ARCH_strncat 1 +#ifndef _FORCE_INLINES __STRING_INLINE char * strncat (char *__dest, __const char *__src, size_t __n) { @@ -140,5 +149,6 @@ : "cc", "memory", "0" ); return tmp; } +#endif #endif /* Use string inlines && GNU CC. */ -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE GmbH Schanzaeckerstr. 10 90443 Nuernberg Linux is like a Vorlon. It is incredibly powerful, gives terse, cryptic answers and has a lot of things going on in the background. From drepper@redhat.com Tue Mar 13 08:24:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 13 Mar 2001 08:24:00 -0000 Subject: res_init in glibc 2.2.2 References: <20010313104638.A26274@suse.de> Message-ID: Thorsten Kukuk writes: > The result is, it is no longer possible for a program to link against > res_init. What where the reasons for this ? That programs use res_ninit. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jes@linuxcare.com Tue Mar 13 12:43:00 2001 From: jes@linuxcare.com (Jes Sorensen) Date: Tue, 13 Mar 2001 12:43:00 -0000 Subject: patch: ia64/inline_syscall Message-ID: <200103132043.VAA14788@lxplus015.cern.ch> Hi Here's a patch for an INLINE_SYSCALL() implementation for the ia64. It seems to work fine here. Jes 2001-03-13 Jes Sorensen * sysdeps/unix/sysv/linux/ia64/sysdep.h (INLINE_SYSCALL): ia64 implementation, partly by Richard Henderson. --- /home/jes/cygnus/libc-2.2-110301/sysdeps/unix/sysv/linux/ia64/sysdep.h Fri Sep 29 12:43:57 2000 +++ sysdeps/unix/sysv/linux/ia64/sysdep.h Tue Mar 13 15:45:04 2001 @@ -101,9 +101,64 @@ /* Define a macro which expands into the inline wrapper code for a system call. */ -#if 0 #undef INLINE_SYSCALL -#define INLINE_SYSCALL(name, nr, args...) __##name (args) -#endif +#define INLINE_SYSCALL(name, nr, args...) \ + ({ \ + register long _r8 asm ("r8"); \ + register long _r10 asm ("r10"); \ + register long _r15 asm ("r15") = __NR_##name; \ + LOAD_ARGS_##nr (args); \ + asm volatile ("break %3" \ + : "=r" (_r8), "=r" (_r10), "=r"(_r15) \ + : "i" (__BREAK_SYSCALL), \ + "r" (_r15) ASM_ARGS_##nr \ + : "memory" ASM_CLOBBERS_##nr); \ + if (_r10 == (long) -1) \ + { \ + __set_errno (-_r8); \ + _r8 = (long) -1; \ + } \ + (int) _r8; }) + +#define LOAD_ARGS_0() do { } while (0) +#define LOAD_ARGS_1(out0) \ + register long _out0 asm ("out0") = (long) (out0); \ + LOAD_ARGS_0 () +#define LOAD_ARGS_2(out0, out1) \ + register long _out1 asm ("out1") = (long) (out1); \ + LOAD_ARGS_1 (out0) +#define LOAD_ARGS_3(out0, out1, out2) \ + register long _out2 asm ("out2") = (long) (out2); \ + LOAD_ARGS_2 (out0, out1) +#define LOAD_ARGS_4(out0, out1, out2, out3) \ + register long _out3 asm ("out3") = (long) (out3); \ + LOAD_ARGS_3 (out0, out1, out2) +#define LOAD_ARGS_5(out0, out1, out2, out3, out4) \ + register long _out4 asm ("out4") = (long) (out4); \ + LOAD_ARGS_4 (out0, out1, out2, out3) + +#define ASM_ARGS_0 +#define ASM_ARGS_1 ASM_ARGS_0, "r" (_out0) +#define ASM_ARGS_2 ASM_ARGS_1, "r" (_out1) +#define ASM_ARGS_3 ASM_ARGS_2, "r" (_out2) +#define ASM_ARGS_4 ASM_ARGS_3, "r" (_out3) +#define ASM_ARGS_5 ASM_ARGS_4, "r" (_out4) + +#define ASM_CLOBBERS_0 ASM_CLOBBERS_1, "out0" +#define ASM_CLOBBERS_1 ASM_CLOBBERS_2, "out1" +#define ASM_CLOBBERS_2 ASM_CLOBBERS_3, "out2" +#define ASM_CLOBBERS_3 ASM_CLOBBERS_4, "out3" +#define ASM_CLOBBERS_4 ASM_CLOBBERS_5, "out4" +#define ASM_CLOBBERS_5 , "out5", "out6", "out7", \ + /* Non-stacked integer registers, minus r8, r10, r15. */ \ + "r2", "r3", "r9", "r11", "r12", "r13", "r14", "r16", "r17", "r18", \ + "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", \ + "r28", "r29", "r30", "r31", \ + /* Predicate registers. */ \ + "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15", \ + /* Non-rotating fp registers. */ \ + "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ + /* Branch registers. */ \ + "b6", "b7" #endif /* not __ASSEMBLER__ */ From jes@linuxcare.com Tue Mar 13 13:40:00 2001 From: jes@linuxcare.com (Jes Sorensen) Date: Tue, 13 Mar 2001 13:40:00 -0000 Subject: patch: ia64/inline_syscall References: <200103132043.VAA14788@lxplus015.cern.ch> Message-ID: >>>>> "Jes" == Jes Sorensen writes: Jes> Hi Here's a patch for an INLINE_SYSCALL() implementation for the Jes> ia64. Jes> It seems to work fine here. WARNING This one didn't seem to work fine after all. I ran the test suite and it was ok, but after installing it all calls to stat() started to fail ;( Jes From schwidefsky@de.ibm.com Wed Mar 14 11:16:00 2001 From: schwidefsky@de.ibm.com (schwidefsky@de.ibm.com) Date: Wed, 14 Mar 2001 11:16:00 -0000 Subject: 64 bit S/390 patches. Part 1 of 6. Message-ID: Hi, I finished the patches for the glibc support for Linux on the 64 bit S/390 machines. As suggested by Ulrich Drepper I moved the 31 bit S/390 files that could not be used for the 64 bit machines to the subfolders s390-32. That affects the directories sysdeps/linuxthreads/s390, sysdeps/linuxthreads/unix/sysv/linux/s390, sysdeps/s390 and sysdeps/unix/sysv/linux/s390. This move makes up for almost two thirds of the patch. The patch consists of six mails. This 1st part contains: 1) common-chg31.diff : changes for 31 bit in common glibc files. 2) linuxthreads-chg31.diff : changes in linuxthreads for 31 bit. 3) linuxthreads-mv31.diff: 31 bit file moves in linuxthreads. 4) sysdeps-chg31.diff: changes for 31 bit in sysdeps/s390. to be continued with part 2. best regards, Martin Schwidefsky Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch????naicherstr. 220, D-71032 B????blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com (See attached file: common-chg31.diff)(See attached file: common-chg31.ChangeLog) (See attached file: linuxthreads-chg31.diff)(See attached file: linuxthreads-chg31.ChangeLog) (See attached file: linuxthreads-mv31.diff)(See attached file: linuxthreads-mv31.ChangeLog) (See attached file: sysdeps-chg31.diff)(See attached file: sysdeps-chg31.ChangeLog) -------------- next part -------------- 2001-03-13 Martin Schwidefsky * configure.in: Change machine=s390 to machine=s390/s390-32. * elf/elf.h: Correct comment for R_390_PLT16DBL. -------------- next part -------------- A non-text attachment was scrubbed... Name: common-chg31.diff Type: text/x-diff Size: 1007 bytes Desc: not available URL: -------------- next part -------------- 2001-03-13 Martin Schwidefsky * linuxthreads/sysdeps/s390/pt-machine.h: Move to subfolder s390-32 and add defines for FLOATING_STACK and ARCH_STACK_MAX_SIZE. -------------- next part -------------- A non-text attachment was scrubbed... Name: linuxthreads-chg31.diff Type: text/x-diff Size: 7769 bytes Desc: not available URL: -------------- next part -------------- 2001-03-13 Martin Schwidefsky * linuxthreads/sysdeps/unix/sysv/linux/s390/pt-initfini.c: Move to subfolder s390-32. -------------- next part -------------- A non-text attachment was scrubbed... Name: linuxthreads-mv31.diff Type: text/x-diff Size: 8090 bytes Desc: not available URL: -------------- next part -------------- 2001-03-13 Martin Schwidefsky * sysdeps/s390/__longjmp.c: Move to subfolder s390-32 and add code to load the floating point registers that should be saved according to the ABI. * sysdeps/s390/bits/setjmp.h: Move to subfolder s390-32 and avoid the use of long long in the __jmp_buf type definition. * sysdeps/s390/bits/string.h: Move to subfolder s390-32 and add several missing #ifndef _FORCE_INLINES. * sysdeps/s390/dl-machine.h: Move to subfolder s390-32 and add a check for the executables EI_CLASS in elf_machine_matches_host. * sysdeps/s390/elf/setjmp.S: Move to subfolder s390-32 and replace branches to globally defined symbol __sigsetjmp by branches to a local label (this avoids the generation of a R_390_PC16DBL relocation in -fpic code). * sysdeps/s390/gmp-mparam.h: Use defines from to calculate BITS_PER_MP_LIMB, BYTES_PER_MP_LIMB and BITS_PER_LONGINT. * sysdeps/s390/initfini.c: Move to subfolder s390-32 and replace ALIGN with ".align 4,0x07". * sysdeps/s390/setjmp.S: Move to subfolder s390-32 and add code to store the floating point registers that should be saved according to the ABI. * sysdeps/s390/sys/ucontext.h: Remove since it is unused. * sysdeps/unix/sysv/linux/s390/sysdep.h: Move to subfolder s390-32 and include sysdeps/s390/s390-32/sysdep.h instead of sysdeps/s390/sysdep.h. -------------- next part -------------- A non-text attachment was scrubbed... Name: sysdeps-chg31.diff Type: text/x-diff Size: 74547 bytes Desc: not available URL: From schwidefsky@de.ibm.com Wed Mar 14 11:17:00 2001 From: schwidefsky@de.ibm.com (schwidefsky@de.ibm.com) Date: Wed, 14 Mar 2001 11:17:00 -0000 Subject: 64 bit S/390 patches. Part 4 of 6. Message-ID: Hi, this is the 4th part of the 64 bit S/390 patch. Parts 4-6 contain the 64 bit support. The patches in this mail contain: 1) common-add64.diff: adds s390x as configuration name in configure.in, adds additional 64 bit relocation types and adds rules for the new platform in shlib-versions. I added rules for everything because otherwise I got GLIBC_2.0 symbols in some of the libraries. 2) config-64.diff: adds configuration name s390x to scripts/config.guess and scripts/config.sub. I added this patch for completeness. I know this patch has to go to the config.* file maintainer and I will send it there. 3) linuxthreads-64.diff: contains the 64 bit version of pt-machine.h, pt-initfini.c and a rule for shlib-versions. to be continued with part 5. best regards, Martin Schwidefsky Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch????naicherstr. 220, D-71032 B????blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com (See attached file: common-add64.diff)(See attached file: common-add64.ChangeLog) (See attached file: config-64.diff)(See attached file: config-64.ChangeLog) (See attached file: linuxthreads-64.diff)(See attached file: linuxthreads-64.ChangeLog) -------------- next part -------------- 2001-03-13 Martin Schwidefsky * configure.in: Add support for 64 bit S/390. * elf/elf.h: Add new relocations for 64 bit S/390. * shlib-versions: Add rules for Linux on 64 bit S/390. -------------- next part -------------- A non-text attachment was scrubbed... Name: common-add64.diff Type: text/x-diff Size: 4383 bytes Desc: not available URL: -------------- next part -------------- 2001-03-13 Martin Schwidefsky * scripts/config.guess: Add support for Linux on 64 bit S/390. * scripts/config.sub: Add support for Linux on 64 bit S/390. -------------- next part -------------- A non-text attachment was scrubbed... Name: config-64.diff Type: text/x-diff Size: 1277 bytes Desc: not available URL: -------------- next part -------------- 2001-03-13 Martin Schwidefsky * linuxthreads/shlib-versions: Add rule for Linux on 64 bit S/390. * linuxthreads/sysdeps/s390/s390-64/pt-machine.h: New file. * linxuthreads/sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file. -------------- next part -------------- A non-text attachment was scrubbed... Name: linuxthreads-64.diff Type: text/x-diff Size: 8760 bytes Desc: not available URL: From schwidefsky@de.ibm.com Wed Mar 14 11:17:00 2001 From: schwidefsky@de.ibm.com (schwidefsky@de.ibm.com) Date: Wed, 14 Mar 2001 11:17:00 -0000 Subject: 64 bit S/390 patches. Part 6 of 6. Message-ID: Hi, this is the 6th part of the 64 bit S/390 patch. It contains all the new files in sysdeps/unix/sysv/linux/s390/s390-64. With patches 1-6 the cvs source of today 03/14/2001 compiles on 64 bit but it shows the same undefined references to 'usqrt' as the 31 bit version. Well that's it. I hope I did not forget anything. best regards, Martin Schwidefsky Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch????naicherstr. 220, D-71032 B????blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com (See attached file: sysdeps-linux-64.diff)(See attached file: sysdeps-linux-64.ChangeLog) -------------- next part -------------- 2001-03-13 Martin Schwidefsky * sysdeps/unix/sysv/linux/s390/s390-64/Dist: New file. * sysdeps/unix/sysv/linux/s390/s390-64/Makefile: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/elfclass.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/fcntl.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/ipc.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/mman.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/msq.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/resource.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/sem.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/shm.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/sigaction.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/siginfo.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/sigstack.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/stat.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/bits/types.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/clone.S: New file. * sysdeps/unix/sysv/linux/s390/s390-64/fstatfs64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/ftruncate64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/fxstat.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/fxstat64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/getdents.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/getdents64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/getrlimit64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/glob.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/glob64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/kernel_stat.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/lxstat.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/lxstat64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/mmap.S: New file. * sysdeps/unix/sysv/linux/s390/s390-64/mmap64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/pread64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/pwrite64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/readdir.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/readdir64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/readdir64_r.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/readdir_r.c : New file. * sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/setrlimit64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/sigaction.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/sigprocmask.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/sigsuspend.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/socket.S: New file. * sysdeps/unix/sysv/linux/s390/s390-64/statfs64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/sys/procfs.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/syscall.S: New file. * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: New file. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: New file. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: New file. * sysdeps/unix/sysv/linux/s390/s390-64/truncate64.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/xstat.c: New file. * sysdeps/unix/sysv/linux/s390/s390-64/xstat64.c: New file. -------------- next part -------------- A non-text attachment was scrubbed... Name: sysdeps-linux-64.diff Type: text/x-diff Size: 115459 bytes Desc: not available URL: From schwidefsky@de.ibm.com Wed Mar 14 11:17:00 2001 From: schwidefsky@de.ibm.com (schwidefsky@de.ibm.com) Date: Wed, 14 Mar 2001 11:17:00 -0000 Subject: 64 bit S/390 patches. Part 5 of 6. Message-ID: Hi, this is the 5th part of the 64 bit S/390 patch. It contains all the new files in sysdeps/s390/s390-64. to be continued with part 6. best regards, Martin Schwidefsky Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch????naicherstr. 220, D-71032 B????blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com (See attached file: sysdeps-s390-64.diff)(See attached file: sysdeps-s390-64.ChangeLog) -------------- next part -------------- 2001-03-13 Martin Schwidefsky * sysdeps/s390/s390-64/Dist: New file. * sysdeps/s390/s390-64/Implies: New file. * sysdeps/s390/s390-64/Makefile: New file. * sysdeps/s390/s390-64/__longjmp.c: New file. * sysdeps/s390/s390-64/add_n.S: New file. * sysdeps/s390/s390-64/atomicity.h: New file. * sysdeps/s390/s390-64/backtrace.c: New file. * sysdeps/s390/s390-64/bcopy.S: New file. * sysdeps/s390/s390-64/bits/byteswap.h: New file. * sysdeps/s390/s390-64/bits/huge_val.h: New file. * sysdeps/s390/s390-64/bits/setjmp.h: New file. * sysdeps/s390/s390-64/bits/string.h: New file. * sysdeps/s390/s390-64/bsd-_setjmp.S: New file. * sysdeps/s390/s390-64/bsd-setjmp.S: New file. * sysdeps/s390/s390-64/bzero.S: New file. * sysdeps/s390/s390-64/dl-machine.h: New file. * sysdeps/s390/s390-64/elf/bsd-_setjmp.S: New file. * sysdeps/s390/s390-64/elf/bsd-setjmp.S: New file. * sysdeps/s390/s390-64/elf/setjmp.S: New file. * sysdeps/s390/s390-64/elf/start.S: New file. * sysdeps/s390/s390-64/ffs.c: New file. * sysdeps/s390/s390-64/initfini.c: New file. * sysdeps/s390/s390-64/memchr.S: New file. * sysdeps/s390/s390-64/memcpy.S: New file. * sysdeps/s390/s390-64/memset.S: New file. * sysdeps/s390/s390-64/s390x-mcount.S: New file. * sysdeps/s390/s390-64/setjmp.S: New file. * sysdeps/s390/s390-64/strcpy.S: New file. * sysdeps/s390/s390-64/strncpy.S: New file. * sysdeps/s390/s390-64/sub_n.S: New file. * sysdeps/s390/s390-64/sysdep.h: New file. -------------- next part -------------- A non-text attachment was scrubbed... Name: sysdeps-s390-64.diff Type: text/x-diff Size: 79315 bytes Desc: not available URL: From schwidefsky@de.ibm.com Wed Mar 14 11:17:00 2001 From: schwidefsky@de.ibm.com (schwidefsky@de.ibm.com) Date: Wed, 14 Mar 2001 11:17:00 -0000 Subject: 64 bit S/390 patches. Part 2 of 6. Message-ID: Hi, this is the 2nd part of the 64 bit S/390 patch. It contains the file moves in the directory sysdeps/s390. There is a possibility that you'll get a reject for sysdeps/s390/bits/string.h. If that happens remove the files sysdeps/s390/bits/string.h{,.rej}. to be continued with part 3. best regards, Martin Schwidefsky Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch????naicherstr. 220, D-71032 B????blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com (See attached file: sysdeps-s390-mv31.diff)(See attached file: sysdeps-s390-mv31.ChangeLog) -------------- next part -------------- 2001-03-13 Martin Schwidefsky * sysdeps/s390/Dist: Move to subfolder s390-32. * sysdeps/s390/Implies: Move to subfolder s390-32. * sysdeps/s390/Makefile: Move to subfolder s390-32. * sysdeps/s390/Versions: Move to subfolder s390-32. * sysdeps/s390/add_n.S: Move to subfolder s390-32. * sysdeps/s390/addmul_1.S: Move to subfolder s390-32. * sysdeps/s390/atomicity.h: Move to subfolder s390-32. * sysdeps/s390/backtrace.c: Move to subfolder s390-32. * sysdeps/s390/bcopy.S: Move to subfolder s390-32. * sysdeps/s390/bits/byteswap.h: Move to subfolder s390-32. * sysdeps/s390/bits/huge_val.h: Move to subfolder s390-32. * sysdeps/s390/bsd-_setjmp.S: Move to subfolder s390-32. * sysdeps/s390/bsd-setjmp.S: Move to subfolder s390-32. * sysdeps/s390/bzero.S: Move to subfolder s390-32. * sysdeps/s390/elf/bsd-_setjmp.S: Move to subfolder s390-32. * sysdeps/s390/elf/bsd-setjmp.S: Move to subfolder s390-32. * sysdeps/s390/elf/start.S: Move to subfolder s390-32. * sysdeps/s390/ffs.c: Move to subfolder s390-32. * sysdeps/s390/memchr.S: Move to subfolder s390-32. * sysdeps/s390/memcpy.S: Move to subfolder s390-32. * sysdeps/s390/memset.S: Move to subfolder s390-32. * sysdeps/s390/mul_1.S: Move to subfolder s390-32. * sysdeps/s390/s390-mcount.S: Move to subfolder s390-32. * sysdeps/s390/strcpy.S: Move to subfolder s390-32. * sysdeps/s390/strncpy.S: Move to subfolder s390-32. * sysdeps/s390/sub_n.S: Move to subfolder s390-32. -------------- next part -------------- A non-text attachment was scrubbed... Name: sysdeps-s390-mv31.diff Type: text/x-diff Size: 101656 bytes Desc: not available URL: From schwidefsky@de.ibm.com Wed Mar 14 11:18:00 2001 From: schwidefsky@de.ibm.com (schwidefsky@de.ibm.com) Date: Wed, 14 Mar 2001 11:18:00 -0000 Subject: 64 bit S/390 patches. Part 3 of 6. Message-ID: Hi, this is the 3rd part of the 64 bit S/390 patch. It contains the file moves in the directory sysdeps/unix/sysv/linux/s390. This third part of the patch concludes the update for 31 bit S/390 and the preparation for the 64 bit support. The cvs source of today 03/14/2001 compiles with the patches in part 1-3 but reports some undefined references to 'usqrt' running make tests in math. This is very likely related to the new math library code so I choose to ignore the problem for now. to be continued with part 4. best regards, Martin Schwidefsky Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch????naicherstr. 220, D-71032 B????blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com (See attached file: sysdeps-linux-mv31.diff)(See attached file: sysdeps-linux-mv31.ChangeLog) -------------- next part -------------- 2001-03-13 Martin Schwidefsky * sysdeps/unix/sysv/linux/s390/Dist: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/Makefile: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/Versions: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/alphasort64.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/bits/mman.h: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/bits/resource.h: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/bits/stat.h: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/chown.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/clone.S: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/fchown.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/fcntl.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/fxstat.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/getdents64.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/getegid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/geteuid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/getgid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/getgroups.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/getresgid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/getresuid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/getrlimit.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/getrlimit64.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/getuid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/lchown.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/lockf64.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/lxstat.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/mmap.S: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/mmap64.S: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/msgctl.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/oldgetrlimit64.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/readdir64.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/readdir64_r.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/register-dump.h: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/scandir64.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/semctl.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/setegid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/seteuid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/setfsgid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/setfsuid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/setgid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/setgroups.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/setregid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/setresgid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/setresuid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/setreuid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/setrlimit.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/setuid.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/shmctl.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/socket.S: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/sys/procfs.h: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/syscall.S: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/syscalls.list: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/sysdep.S: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/sysdep.h: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/versionsort64.c: Move to subfolder s390-32. * sysdeps/unix/sysv/linux/s390/xstat.c: Move to subfolder s390-32. -------------- next part -------------- A non-text attachment was scrubbed... Name: sysdeps-linux-mv31.diff Type: text/x-diff Size: 170907 bytes Desc: not available URL: From drepper@redhat.com Thu Mar 15 01:51:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 15 Mar 2001 01:51:00 -0000 Subject: fnmatch changes Message-ID: I've checked in the fnmatch changes I worked on the last days. These changes are necessary to allow bash using the fnmatch in glibc which in turn is necessary to have bash handle all the internationalization issues correctly (and being consistent). The changes are low-risk since unless the new flag is used the code behaves the same. One exception: I fixed a bug. So it is good to have the new code in any case. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From bmark@us.ibm.com Thu Mar 15 08:01:00 2001 From: bmark@us.ibm.com (Mark Brown) Date: Thu, 15 Mar 2001 08:01:00 -0000 Subject: Finalised PASC 1003.1 Interpretation #118 References: <200103150855.JAA13901@dkuug.dk> Message-ID: Ulrich- This answers an old question about the aiocbp struct. -- Mark S. Brown bmark@us.ibm.com Senior Technical Staff Member 512.838.3926 T/L678.3926 AIX and Linux Technologies Mark Brown/Austin/IBM IBM Corporation, Austin, Texas ---------- > From: Andrew Josey > Reply-To: ajosey@rdg.opengroup.org (Andrew Josey) > Date: Thu, 15 Mar 2001 08:52:00 GMT > To: m.brown@opengroup.org > Cc: stds-pasc-ieee-officers@ieee.org,sc22wg15@dkuug.dk > Subject: (wg15tag 2582) (SC22WG15.1583) Finalised PASC 1003.1 Interpretation > #118 > Resent-From: wg15tag@opengroup.org > Resent-To: wg15tag@opengroup.org > Resent-Date: 15 Mar 2001 08:56:53 -0000 > > > To: Mr. Brown > From: Andrew Josey, PASC Interpretations Functional Chair > Reference: PASC 1003.1 #118 > > > Dear Mr. Brown > > Enclosed is the official response for your request for an interpretation > of IEEE Standard 1003.1. > > This response was developed and approved by the members of the 1003.1 > Interpretations Committee. > > To obtain an understanding of the PASC Guidelines for interpretations > and their classifications please read > http://www.pasc.org/interps/ > > Please can you confirm receipt of this electronic mail message > within ten working days, please carbon copy your response to the IEEE > (stds-pasc-ieee-officers@ieee.org) > > Sincerely, > > > Andrew Josey > PASC Functional Chair Interpretations > > Enclosures > > > Cc: IEEE PASC Officers, SC22 WG15 > > > > > > _____________________________________________________________________________ > Notice: This is an unapproved draft PASC interpretation. Use at > your own risk. Please direct any questions to a.josey@pasc.org > > > _____________________________________________________________________________ > PASC Interpretation reference > 1003.1-96 #118 > > _____________________________________________________________________________ > > Interpretation Number: XXXX > Topic: aio_fsync > Relevant Sections: 6.7.9.2 Lines 1252-1265 > > > PASC Interpretation Request: > ---------------------------- > > From: Mark S. Brown > Date: 2000 Oct 23 > > ------------------------------------------------------------------------ > > 7 Defect Report concerning (number and title of International Standard > or DIS final text, if applicable): > > IEEE Std 1003.1-1996 (incorporates 1003.1-1990, 1003.1b-1993, 1003.1c-1995, > 1003.1i-1995) (ISO 9945-1:1996) > > ------------------------------------------------------------------------ > > 8 Qualifier (e.g. error, omission, clarification required): > > 3 > > Error=1 , Omission=2, Clarification=3 > > ------------------------------------------------------------------------ > > 9 References in document (e.g. page, clause, figure, and/or table > numbers): > > Sec 6.7.9.2 Lines 1252-1265 > > ------------------------------------------------------------------------ > > 10 Nature of defect (complete, concise explanation of the perceived > problem): > > > This paragraph describes the aiocbp structure and its uses, in > apparently general terms. It is unclear whether this paragraph > is meant for use in all of the APIs in which aiocbp is used, > or only aio_fsync(). What is unclear in particular, are the > sentences, > "The aio_sigevent member shall determine the asynchronous > notification to occur as specified in 3.3.1.2 when all operations > have achieved synchronous I/O completion. All other members of the > structure referenced by aiocbp are ignored." > > 1. Does this apply to all of the APIs? It would make implementation > pretty difficult if we can't use the rest of the structure. > > 2. Does this sentence apply only to aio_fsync(), since the paragraph > is in 6.7.9 and not in a more general section? > > 3. Does it apply to aio_error() and aio_return()? > > ------------------------------------------------------------------------ > > 11 Solution proposed by the submitter (optional): > > > > > ------------------------------------------------------------------------ > > > > Interpretation response > ------------------------ > No this sentence applies only to aio_fsync(). > > Rationale > ------------- > For this function only, only the aio_fildes and aio_sigevent fields > of the AIO control block are used; the rest are ignored since no > seeking , (specific) writing, or reading takes place in this operation. > > > Forwarded to Interpretations group: 31 Oct 2000 > Proposed resolution: 15 Feb 2001 > Finalised: 15 Mar 2001 > > > ----- > Andrew Josey The Open Group > PASC FC Interpretations Apex Plaza,Forbury Road, > Email: a.josey@opengroup.org Reading,Berks.RG1 1AX,England > Tel: +44 118 9508311 ext 2250 Fax: +44 118 9500110 > > PASC Interpretations Web Site: http://www.pasc.org/interps/ > or http://pasc.opengroup.org/interps/ > > From drepper@redhat.com Thu Mar 15 10:15:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 15 Mar 2001 10:15:00 -0000 Subject: Finalised PASC 1003.1 Interpretation #118 References: Message-ID: Mark Brown writes: > > Interpretation response > > ------------------------ > > No this sentence applies only to aio_fsync(). > > > > Rationale > > ------------- > > For this function only, only the aio_fildes and aio_sigevent fields > > of the AIO control block are used; the rest are ignored since no > > seeking , (specific) writing, or reading takes place in this operation. I still see the need for further clarification. The problem is when the fsync operation is performed. There are several possibilities: - the fsync() happens immediately when it is issued. This is everything but useful since there might be operations for the descriptor being worked on in this very moment - the fsync() request is queued at after all existing requests (regardless of priority) and new requests are never scheduled before the fsync() (again, regardless of priority) This is not only quite expensive to implement (it's not a simple priority queue anymore) it's also leading to lower-priority I/O being performed before high-priority I/O. - the fsync() operation is performed once all operations for the descriptor are finished. This has the problem that the aio_fsync() call can block indefinitely. I really don't know what is the right answer. I for one assign a priority to the sync requests and queue them appropriately. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Mar 15 16:42:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 15 Mar 2001 16:42:00 -0000 Subject: Literal CR in C source References: Message-ID: Andreas Schwab writes: > The new gcc treats literal CRs like newlines in a source file. This > breaks posix/ptestcases.h. Thanks, I've applied the patch now. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Mar 15 23:47:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 15 Mar 2001 23:47:00 -0000 Subject: [PATCH] Use .note.ABI-tag in DSOs (take 2) References: <20010305193313.B573@sunsite.ms.mff.cuni.cz> <20010305113040.A30648@gnu.org> <20010312141924.D22218@sunsite.ms.mff.cuni.cz> Message-ID: I've applied the patch now. It seemed sufficiently clean. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Fri Mar 16 00:07:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 16 Mar 2001 00:07:00 -0000 Subject: [PATCH] ldconfig fix References: <20010305193313.B573@sunsite.ms.mff.cuni.cz> <20010305113040.A30648@gnu.org> <20010312141924.D22218@sunsite.ms.mff.cuni.cz> Message-ID: <20010316090946.C574@sunsite.ms.mff.cuni.cz> On Thu, Mar 15, 2001 at 11:47:50PM -0800, Ulrich Drepper wrote: > I've applied the patch now. It seemed sufficiently clean. Thanks, Thanks a lot. This is what I had to add yesterday: it is perfectly normal to have different osversions for one soname in the same library (say have libc-2.2.1.so and libc-2.2.2.so in the same directory), we just must update osversion from the library ld.so.cache will actually contain. 2001-03-16 Jakub Jelinek * elf/ldconfig.c (search_dir): Remove bogus diagnostic, instead update osversion from more recent library. --- libc/elf/ldconfig.c.jj Fri Mar 16 10:06:14 2001 +++ libc/elf/ldconfig.c Fri Mar 16 10:07:08 2001 @@ -758,12 +758,8 @@ search_dir (const struct dir_entry *entr error (0, 0, _("libraries %s and %s in directory %s have same soname but different type."), dlib_ptr->name, direntry->d_name, entry->path); } - /* OS version should be the same - sanity check. */ - if (dlib_ptr->osversion != osversion) - error (0, 0, _("libraries %s and %s in directory %s have same\n" - "soname but different minimal supported OS version."), - dlib_ptr->name, direntry->d_name, entry->path); free (dlib_ptr->name); + dlib_ptr->osversion = osversion; dlib_ptr->name = xstrdup (direntry->d_name); dlib_ptr->is_link = is_link; } Jakub From drepper@redhat.com Fri Mar 16 02:08:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 16 Mar 2001 02:08:00 -0000 Subject: [PATCH] ldconfig fix References: <20010305193313.B573@sunsite.ms.mff.cuni.cz> <20010305113040.A30648@gnu.org> <20010312141924.D22218@sunsite.ms.mff.cuni.cz> <20010316090946.C574@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > This is what I had to add yesterday: it is perfectly normal to have > different osversions for one soname in the same library (say have > libc-2.2.1.so and libc-2.2.2.so in the same directory), we just must update > osversion from the library ld.so.cache will actually contain. I've applied this patch as well. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Mar 16 02:15:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 16 Mar 2001 02:15:00 -0000 Subject: 64 bit S/390 patches. Part 1 of 6. References: Message-ID: As you might have seen, I've applied the patch now. Thanks. I nevertheless have some issues: - too many files are duplicated. E.g., sysdeps/s390/s390-32/bits/huge_val.h and sysdeps/s390/s390-64/bits/huge_val.h have the same contents (module whitespace changes). Please look again through all the files and move them up in the sysdeps hierarchy (in the case of the file mentioned above, it should be in sysdeps/s390/bits/huge_val.h - from what I understand of the s390 architecture you can execute 31 bit applications on 64 bit machines. If this is right you'll have to add code similar to the one we have for IA-32/IA-64 to ldconfig. The s390-32 and s390-64 binary both should be able to handle the DSOs of the other. - Is it desirable to have support from compiling 31-bit s390 binaries on s390-64 (and vice versa)? In this case the headers need more work (and they need to be unified). Look at the Linux/SPARC case for an example. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Fri Mar 16 02:17:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 16 Mar 2001 02:17:00 -0000 Subject: [PATCH] ldconfig fix References: <20010305193313.B573@sunsite.ms.mff.cuni.cz> <20010305113040.A30648@gnu.org> <20010312141924.D22218@sunsite.ms.mff.cuni.cz> <20010316090946.C574@sunsite.ms.mff.cuni.cz> Message-ID: <20010316111704.E574@sunsite.ms.mff.cuni.cz> On Fri, Mar 16, 2001 at 02:00:06AM -0800, Ulrich Drepper wrote: > Jakub Jelinek writes: > > > This is what I had to add yesterday: it is perfectly normal to have > > different osversions for one soname in the same library (say have > > libc-2.2.1.so and libc-2.2.2.so in the same directory), we just must update > > osversion from the library ld.so.cache will actually contain. > > I've applied this patch as well. Thanks, BTW: Could you please also look at: http://sources.redhat.com/ml/libc-hacker/2001-03/msg00009.html http://sources.redhat.com/ml/libc-hacker/2001-02/msg00132.html http://sources.redhat.com/ml/libc-hacker/2001-02/msg00128.html and either send me your objections against them or apply them? Thanks. Jakub From schwidefsky@de.ibm.com Fri Mar 16 04:28:00 2001 From: schwidefsky@de.ibm.com (schwidefsky@de.ibm.com) Date: Fri, 16 Mar 2001 04:28:00 -0000 Subject: 64 bit S/390 patches. Part 1 of 6. Message-ID: >As you might have seen, I've applied the patch now. Thanks. Great! Thanks a lot. >I nevertheless have some issues: > >- too many files are duplicated. E.g., sysdeps/s390/s390-32/bits/huge_val.h > and sysdeps/s390/s390-64/bits/huge_val.h have the same contents (module > whitespace changes). > > Please look again through all the files and move them up in the sysdeps > hierarchy (in the case of the file mentioned above, it should be in > sysdeps/s390/bits/huge_val.h I just did. I found one more file that can be moved up (sysdeps/s390/ffs.c). The attached patch common-files.diff does the move of huge_val.h and ffs.c. >- from what I understand of the s390 architecture you can execute 31 bit > applications on 64 bit machines. If this is right you'll have to add > code similar to the one we have for IA-32/IA-64 to ldconfig. The > s390-32 and s390-64 binary both should be able to handle the DSOs of > the other. Ah, this is good to know. Is it just the definitions in ldconfig.h or are there other places I need to look? >- Is it desirable to have support from compiling 31-bit s390 binaries on > s390-64 (and vice versa)? In this case the headers need more work (and > they need to be unified). Look at the Linux/SPARC case for an example. Well yes, it is certaintly desirable to be able to compile from the same header files. The unification of the header files sound like an aweful lot of work. The "solution" at the moment is to have a second include directory in a cross build environment. One last thing. Seems like something bad has happened to linuxthreads-chg31.diff. The ChangeLog has been updated but the patch didn't make it. Could you please check? blue skies, Martin Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch????naicherstr. 220, D-71032 B????blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com (See attached file: common-files.diff)(See attached file: common-files.ChangeLog) -------------- next part -------------- 2001-03-16 Martin Schwidefsky * sysdeps/s390/s390-64/bits/huge_val.h: Move to... * sysdeps/s390/bits/huge_val.h: ...here. * sysdeps/s390/s390-32/bit/huge_val.h: Remove. * sysdeps/s390/s390-64/ffs.c: Move to... * sysdeps/s390/ffs.c: ...here. * sysdeps/s390/s390-32/ffs.c: Remove. -------------- next part -------------- A non-text attachment was scrubbed... Name: common-files.diff Type: text/x-diff Size: 15014 bytes Desc: not available URL: From schwab@suse.de Fri Mar 16 07:05:00 2001 From: schwab@suse.de (Andreas Schwab) Date: Fri, 16 Mar 2001 07:05:00 -0000 Subject: 64 bit S/390 patches. Part 1 of 6. References: Message-ID: schwidefsky@de.ibm.com writes: |> >- from what I understand of the s390 architecture you can execute 31 bit |> > applications on 64 bit machines. If this is right you'll have to add |> > code similar to the one we have for IA-32/IA-64 to ldconfig. The |> > s390-32 and s390-64 binary both should be able to handle the DSOs of |> > the other. |> Ah, this is good to know. Is it just the definitions in ldconfig.h or are |> there |> other places I need to look? You problably also need your own version of readelflib.c, see sysdeps/unix/sysv/linux/{ia64,sparc}/readelflib.c. Andreas. -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 From drepper@redhat.com Fri Mar 16 11:23:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 16 Mar 2001 11:23:00 -0000 Subject: 64 bit S/390 patches. Part 1 of 6. References: Message-ID: The missing patch is applied as well as the new one. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Mar 16 14:03:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 16 Mar 2001 14:03:00 -0000 Subject: [PATCH] ldconfig fix References: <20010305193313.B573@sunsite.ms.mff.cuni.cz> <20010305113040.A30648@gnu.org> <20010312141924.D22218@sunsite.ms.mff.cuni.cz> <20010316090946.C574@sunsite.ms.mff.cuni.cz> <20010316111704.E574@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > BTW: Could you please also look at: > http://sources.redhat.com/ml/libc-hacker/2001-03/msg00009.html Test program? > http://sources.redhat.com/ml/libc-hacker/2001-02/msg00132.html I'll have to try it. > http://sources.redhat.com/ml/libc-hacker/2001-02/msg00128.html This as well. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Fri Mar 16 15:43:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 16 Mar 2001 15:43:00 -0000 Subject: [PATCH] ldconfig fix References: <20010305193313.B573@sunsite.ms.mff.cuni.cz> <20010305113040.A30648@gnu.org> <20010312141924.D22218@sunsite.ms.mff.cuni.cz> <20010316090946.C574@sunsite.ms.mff.cuni.cz> <20010316111704.E574@sunsite.ms.mff.cuni.cz> Message-ID: <20010317004505.C551@sunsite.ms.mff.cuni.cz> On Fri, Mar 16, 2001 at 02:03:59PM -0800, Ulrich Drepper wrote: > Jakub Jelinek writes: > > > BTW: Could you please also look at: > > http://sources.redhat.com/ml/libc-hacker/2001-03/msg00009.html > > Test program? echo 'int main() {}' > test.c; gcc -o test test.c -ltermcap; strace ./test 2>&1 | grep open | grep libc.so.6 | grep -v ENOENT Without the patch libc.so.6 is opened twice (the second time for open/read/fstat64/close), with the patch just once. Jakub From drepper@redhat.com Fri Mar 16 16:12:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 16 Mar 2001 16:12:00 -0000 Subject: [PATCH] ldconfig fix References: <20010305193313.B573@sunsite.ms.mff.cuni.cz> <20010305113040.A30648@gnu.org> <20010312141924.D22218@sunsite.ms.mff.cuni.cz> <20010316090946.C574@sunsite.ms.mff.cuni.cz> <20010316111704.E574@sunsite.ms.mff.cuni.cz> <20010317004505.C551@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Without the patch libc.so.6 is opened twice (the second time for > open/read/fstat64/close), with the patch just once. OK, I've applied your second variant. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Sun Mar 18 01:47:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Sun, 18 Mar 2001 01:47:00 -0000 Subject: Docu patch: Mention GCC 2.95.3, s390x Message-ID: Here's a docu update to mention GCC 2.95.3 and s390x. Ok to commit? Andreas 2001-03-18 Andreas Jaeger * manual/install.texi (Tools for Compilation): Advise to use GCC 2.95.3. (Supported Configurations): Mention s390x. ============================================================ Index: manual/install.texi --- manual/install.texi 2001/02/07 12:32:06 1.50 +++ manual/install.texi 2001/03/18 09:41:10 @@ -336,7 +336,7 @@ The GNU C library can only be compiled with the GNU C compiler family. As of the 2.2 release, GCC 2.95.2 or higher is required. As of this -writing, GCC 2.95.2 is the compiler we advise to use. +writing, GCC 2.95.3 is the compiler we advise to use. You can use whatever compiler you like to compile programs that use GNU libc, but be aware that both GCC 2.7 and 2.8 have bugs in their @@ -432,6 +432,7 @@ mips@var{*}-@var{*}-linux powerpc-@var{*}-linux s390-@var{*}-linux +s390x-@var{*}-linux sparc-@var{*}-linux sparc64-@var{*}-linux @end smallexample ============================================================ Index: FAQ.in --- FAQ.in 2001/02/26 07:28:08 1.122 +++ FAQ.in 2001/03/18 09:41:14 @@ -38,6 +38,7 @@ mips*-*-linux-gnu Linux-2.x on MIPS ia64-*-linux-gnu Linux-2.x on ia64 s390-*-linux-gnu Linux-2.x on IBM S/390 + s390x-*-linux-gnu Linux-2.x on IBM S/390 64-bit Ports to other Linux platforms are in development, and may in fact work already, but no one has sent us success reports for them. Currently no @@ -1023,9 +1024,9 @@ ?? When recompiling GCC, I get compilation errors in libio. -{BH} You are trying to recompile gcc 2.95.2? Use gcc 2.95.2.1 instead. +{BH} You are trying to recompile gcc 2.95.2? Use gcc 2.95.3 instead. This version is needed because the fpos_t type and a few libio internals -have changed in glibc 2.2, and gcc 2.95.2.1 contains a corresponding patch. +have changed in glibc 2.2, and gcc 2.95.3 contains a corresponding patch. ? Source and binary incompatibilities, and what to do about them ============================================================ Index: README.template --- README.template 2000/09/19 13:00:19 1.35 +++ README.template 2001/03/18 09:41:14 @@ -18,6 +18,7 @@ mips*-*-linux-gnu Linux-2.x on MIPS ia64-*-linux-gnu Linux-2.x on ia64 s390-*-linux-gnu Linux-2.x on IBM S/390 + s390x-*-linux-gnu Linux-2.x on IBM S/390 64-bit Former releases of this library (version 1.09.1 and perhaps earlier versions) used to run on the following configurations: -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From schwab@suse.de Sun Mar 18 15:03:00 2001 From: schwab@suse.de (Andreas Schwab) Date: Sun, 18 Mar 2001 15:03:00 -0000 Subject: Makerules Message-ID: 2001-03-19 Andreas Schwab * Makerules (build-shlib): Make sure exit codes get checked properly. --- Makerules.~1.346.~ Fri Mar 16 11:05:30 2001 +++ Makerules Sun Mar 18 23:59:46 2001 @@ -431,13 +431,13 @@ $(LDLIBS-$(@F:lib%.so=%).so) 2>&1 | \ sed -e '/^=========/,/^=========/!d;/^=========/d' \ -e 's/^.*\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \ - > $@.lds; \ - rm -f $@.new; \ - $(build-shlib-helper) -o $@ -T $@.lds \ + > $@.lds +rm -f $@.new +$(build-shlib-helper) -o $@ -T $@.lds \ -Wl,--whole-archive $(csu-objpfx)/abi-note.o \ $(filter-out $(map-file) $(+preinit) $(+postinit),$^) \ - $(no-whole-archive) $(LDLIBS-$(@F:lib%.so=%).so); \ - rm -f $@.lds + $(no-whole-archive) $(LDLIBS-$(@F:lib%.so=%).so) +rm -f $@.lds endef else define build-shlib -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 From drepper@redhat.com Sun Mar 18 17:23:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 18 Mar 2001 17:23:00 -0000 Subject: Makerules References: Message-ID: Andreas Schwab writes: > 2001-03-19 Andreas Schwab > > * Makerules (build-shlib): Make sure exit codes get checked > properly. Thanks, I've applied it. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From schwidefsky@de.ibm.com Mon Mar 19 10:48:00 2001 From: schwidefsky@de.ibm.com (schwidefsky@de.ibm.com) Date: Mon, 19 Mar 2001 10:48:00 -0000 Subject: readelflib for S/390. Message-ID: Hi, I defined ldconfig.h and readelflib.c for the S/390 backend analog to sparc/sparc64 and ia64/i386. Now the 64 bit ldconfig sets the links for the 31 bit emulation libraries as well. 2001-03-19 Martin Schwidefsky * elf/cache.c: Add case for FLAG_S390_LIB64. * sysdeps/generic/ldconfig.h: Add define for FLAG_S390_LIB64. * sysdeps/unix/sysv/linux/s390/ldconfig.h: New file. * sysdeps/unix/sysv/linux/s390/readelflib.c: New file. (See attached file: ldconfig.diff) blue skies, Martin Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch????naicherstr. 220, D-71032 B????blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: ldconfig.diff Type: text/x-diff Size: 4870 bytes Desc: not available URL: From drepper@redhat.com Mon Mar 19 14:08:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 19 Mar 2001 14:08:00 -0000 Subject: readelflib for S/390. References: Message-ID: schwidefsky@de.ibm.com writes: > I defined ldconfig.h and readelflib.c for the S/390 backend analog to > sparc/sparc64 and ia64/i386. Now the 64 bit ldconfig sets the links for > the 31 bit emulation libraries as well. Thanks, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From schwab@suse.de Tue Mar 20 04:57:00 2001 From: schwab@suse.de (Andreas Schwab) Date: Tue, 20 Mar 2001 04:57:00 -0000 Subject: __gethostname Message-ID: The __gethostname prototype in include/unistd.h needs fixing. Andreas. 2001-03-20 Andreas Schwab * include/unistd.h: Adjust prototype of __gethostname. --- include/unistd.h.~1.18.~ Wed Feb 14 09:58:37 2001 +++ include/unistd.h Tue Mar 20 13:39:49 2001 @@ -77,7 +77,7 @@ extern int __symlink (__const char *__from, __const char *__to); extern int __readlink (__const char *__path, char *__buf, size_t __len); extern int __unlink (__const char *__name); -extern int __gethostname (char *__name, socklen_t __len); +extern int __gethostname (char *__name, size_t __len); extern int __profil (unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale); extern int __getdtablesize (void); -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 From jakub@redhat.com Tue Mar 20 06:36:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 20 Mar 2001 06:36:00 -0000 Subject: [PATCH] sparc stackinfo.h Message-ID: <20010320153758.A1635@sunsite.ms.mff.cuni.cz> Hi! Stack grows down on SPARC... 2001-03-20 Jakub Jelinek * sysdeps/sparc/stackinfo.h: New file. --- libc/sysdeps/sparc/stackinfo.h.jj Tue Mar 20 16:23:54 2001 +++ libc/sysdeps/sparc/stackinfo.h Tue Mar 20 16:24:11 2001 @@ -0,0 +1,28 @@ +/* Copyright (C) 2001 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This file contains a bit of information about the stack allocation + of the processor. */ + +#ifndef _STACKINFO_H +#define _STACKINFO_H 1 + +/* On sparc the stack grows down. */ +#define _STACK_GROWS_DOWN 1 + +#endif /* stackinfo.h */ Jakub From jakub@redhat.com Tue Mar 20 07:18:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 20 Mar 2001 07:18:00 -0000 Subject: [PATCH] pthread_getattr_np Message-ID: <20010320161951.B1635@sunsite.ms.mff.cuni.cz> Hi! As pointed by Hui Huang, __stackaddr is stack top on machines where stack grows down, so pthread_getattr_np should match that. I'll try to write a testcase as soon. 2001-03-20 Jakub Jelinek * attr.c (pthread_getattr_np): __stackaddr is topmost address. --- libc/linuxthreads/attr.c.jj Tue Mar 20 13:36:32 2001 +++ libc/linuxthreads/attr.c Tue Mar 20 16:26:43 2001 @@ -263,7 +263,6 @@ int pthread_getattr_np (pthread_t thread { pthread_handle handle = thread_handle (thread); pthread_descr descr; - char *guardaddr; if (handle == NULL) return ENOENT; @@ -282,21 +281,24 @@ int pthread_getattr_np (pthread_t thread (struct sched_param *) &attr->__schedparam) != 0) return errno; - guardaddr = descr->p_guardaddr; attr->__inheritsched = descr->p_inheritsched; attr->__scope = PTHREAD_SCOPE_SYSTEM; - attr->__stacksize = (char *)(descr + 1) - guardaddr - descr->p_guardsize; + attr->__stacksize = (char *)(descr + 1) - descr->p_guardaddr + - descr->p_guardsize; attr->__guardsize = descr->p_guardsize; attr->__stackaddr_set = descr->p_userstack; #ifdef NEED_SEPARATE_REGISTER_STACK - guardaddr -= attr->__stacksize; attr->__stacksize *= 2; /* XXX This is awkward. The guard pages are in the middle of the two stacks. We must count the guard size in the stack size since otherwise the range of the stack area cannot be computed. */ attr->__stacksize += attr->__guardsize; #endif - attr->__stackaddr = guardaddr; +#ifndef _STACK_GROWS_UP + attr->__stackaddr = (char *)(descr + 1); +#else +#error __stackaddr not handled +#endif return 0; } Jakub From drepper@redhat.com Tue Mar 20 10:50:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 20 Mar 2001 10:50:00 -0000 Subject: RPC changes Message-ID: I've checked in a patch I got quite some time ago and which I delayed for the 2.2 release. It is introducing thread-safe RPC functions, similar to what Solaris has. This should not introduce incompatibilities since programs currently using RPC functions in different threads are doomed. I had to modify the patch quite a lot and have done only a tiny bit of testing myself. Please test it out. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jes@linuxcare.com Wed Mar 21 07:13:00 2001 From: jes@linuxcare.com (Jes Sorensen) Date: Wed, 21 Mar 2001 07:13:00 -0000 Subject: compile problem Message-ID: <200103211513.QAA28336@lxplus015.cern.ch> Hi There was a recent change from Jakub adding a _dl_osversion check against __ABI_TAG_OS, however __ABI_TAG_OS is not defined anywhere. The below is from Linux/ia64. Jakub, whats the scoop? Jes make[2]: Entering directory `/data/home/jes/libc-2.2/libc-2.2/elf' gcc dl-load.c -c -O2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings -g -I../include -I. -I/data/home/jes/libc-2.2/build/elf -I.. -I../libio -I/data/home/jes/libc-2.2/build -I../sysdeps/ia64/elf -I../linuxthreads/sysdeps/unix/sysv/linux/ia64 -I../linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv -I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/ia64 -I../sysdeps/unix/sysv/linux/ia64 -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/ia64/fpu -I../sysdeps/ia64 -I../sysdeps/wordsize-64 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -nostdinc -isystem /data/toolchain/lib/gcc-lib/ia64-linux/2.96-ia64-000717/include -isystem /home/jes/linux/include -D_LIBC_REENTRANT -! in! clude ../include/libc-symbols.h -I/data/home/jes/libc-2.2/build/elf/. -I/data/home/jes/libc-2.2/build/csu/. -o /data/home/jes/libc-2.2/build/elf/dl-load.o dl-load.c: In function `_dl_map_object_from_fd': dl-load.c:1074: warning: long unsigned int format, size_t arg (arg 7) dl-load.c:1074: warning: long unsigned int format, size_t arg (arg 7) dl-load.c: In function `open_verify': dl-load.c:1346: `__ABI_TAG_OS' undeclared (first use in this function) dl-load.c:1346: (Each undeclared identifier is reported only once dl-load.c:1346: for each function it appears in.) make[2]: *** [/data/home/jes/libc-2.2/build/elf/dl-load.o] Error 1 make[2]: Leaving directory `/data/home/jes/libc-2.2/libc-2.2/elf' make[1]: *** [elf/subdir_lib] Error 2 make[1]: Leaving directory `/data/home/jes/libc-2.2/libc-2.2' make: *** [all] Error 2 From schwab@suse.de Wed Mar 21 07:21:00 2001 From: schwab@suse.de (Andreas Schwab) Date: Wed, 21 Mar 2001 07:21:00 -0000 Subject: compile problem References: <200103211513.QAA28336@lxplus015.cern.ch> Message-ID: Jes Sorensen writes: |> Hi |> |> There was a recent change from Jakub adding a _dl_osversion check |> against __ABI_TAG_OS, however __ABI_TAG_OS is not defined anywhere. |> |> The below is from Linux/ia64. |> |> Jakub, whats the scoop? $ rm csu/abi-tag.h $ make Andreas. -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 From jakub@redhat.com Wed Mar 21 09:26:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 21 Mar 2001 09:26:00 -0000 Subject: [PATCH] pthread_getattr_np (take 2) References: <20010320161951.B1635@sunsite.ms.mff.cuni.cz> Message-ID: <20010321182759.C593@sunsite.ms.mff.cuni.cz> On Tue, Mar 20, 2001 at 04:19:52PM +0100, Jakub Jelinek wrote: > Hi! > > As pointed by Hui Huang, __stackaddr is stack top on machines where stack > grows down, so pthread_getattr_np should match that. > I'll try to write a testcase as soon. Here is a new patch (with cast of descr->p_guardaddr) including a testcase and a bugfix for pthread_attr_setstack, which was checking e.g. on ia32 if stackaddr & 0xffffffdf is non-zero and thus usually failed. 2001-03-21 Jakub Jelinek * attr.c (__pthread_attr_setstack): Fix alignment check. (pthread_getattr_np): __stackaddr is top of stack, not bottom. * Makefile (tests): Add ex17 test. * Examples/ex17.c: New test. --- libc/linuxthreads/attr.c.jj Tue Mar 20 13:36:32 2001 +++ libc/linuxthreads/attr.c Wed Mar 21 19:08:24 2001 @@ -225,7 +225,7 @@ int __pthread_attr_setstack (pthread_att int err; if ((((uintptr_t) stackaddr) - & ~__alignof__ (struct _pthread_descr_struct)) != 0) + & (__alignof__ (struct _pthread_descr_struct) - 1)) != 0) err = EINVAL; else err = __pthread_attr_setstacksize (attr, stacksize); @@ -263,7 +263,6 @@ int pthread_getattr_np (pthread_t thread { pthread_handle handle = thread_handle (thread); pthread_descr descr; - char *guardaddr; if (handle == NULL) return ENOENT; @@ -282,21 +281,24 @@ int pthread_getattr_np (pthread_t thread (struct sched_param *) &attr->__schedparam) != 0) return errno; - guardaddr = descr->p_guardaddr; attr->__inheritsched = descr->p_inheritsched; attr->__scope = PTHREAD_SCOPE_SYSTEM; - attr->__stacksize = (char *)(descr + 1) - guardaddr - descr->p_guardsize; + attr->__stacksize = (char *)(descr + 1) - (char *)descr->p_guardaddr + - descr->p_guardsize; attr->__guardsize = descr->p_guardsize; attr->__stackaddr_set = descr->p_userstack; #ifdef NEED_SEPARATE_REGISTER_STACK - guardaddr -= attr->__stacksize; attr->__stacksize *= 2; /* XXX This is awkward. The guard pages are in the middle of the two stacks. We must count the guard size in the stack size since otherwise the range of the stack area cannot be computed. */ attr->__stacksize += attr->__guardsize; #endif - attr->__stackaddr = guardaddr; +#ifndef _STACK_GROWS_UP + attr->__stackaddr = (char *)(descr + 1); +#else +#error __stackaddr not handled +#endif return 0; } --- libc/linuxthreads/Makefile.jj Wed Mar 21 15:44:51 2001 +++ libc/linuxthreads/Makefile Wed Mar 21 19:20:23 2001 @@ -55,7 +55,7 @@ endif librt-tests = ex10 ex11 tests = ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 $(librt-tests) ex12 ex13 joinrace \ - tststack $(tests-nodelete-$(have-z-nodelete)) ecmutex ex14 ex15 ex16 + tststack $(tests-nodelete-$(have-z-nodelete)) ecmutex ex14 ex15 ex16 ex17 ifeq (yes,$(build-shared)) tests-nodelete-yes = unload --- libc/linuxthreads/Examples/ex17.c.jj Tue Mar 20 13:03:54 2001 +++ libc/linuxthreads/Examples/ex17.c Wed Mar 21 19:24:27 2001 @@ -0,0 +1,95 @@ +#include +#include +#include +#include +#include +#include +#include + +static void * +test_thread (void *v_param) +{ + return NULL; +} + +#define STACKSIZE 0x100000 + +int +main (void) +{ + pthread_t thread; + pthread_attr_t attr; + int status; + void *stack, *stack2; + size_t stacksize; + + pthread_attr_init (&attr); + stack = mmap (NULL, STACKSIZE, + PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + + if (stack == (void *)-1) + { + perror ("mmap failed"); + return 1; + } + + status = pthread_attr_setstack (&attr, stack, STACKSIZE); + if (status != 0) + { + printf ("pthread_attr_setstack failed: %s\n", strerror (status)); + return 1; + } + + status = pthread_attr_getstack (&attr, &stack2, &stacksize); + if (status != 0) + { + printf ("pthread_attr_getstack failed: %s\n", strerror (status)); + return 1; + } + + if (stack2 != stack || stacksize != STACKSIZE) + { + printf ("first pthread_attr_getstack returned different stack (%p,%x)\n" + "than was set by setstack (%p,%x)\n", + stack2, stacksize, stack, STACKSIZE); + return 2; + } + + status = pthread_create (&thread, &attr, test_thread, NULL); + if (status != 0) + { + printf ("pthread_create failed: %s\n", strerror (status)); + return 1; + } + + status = pthread_getattr_np (thread, &attr); + if (status != 0) + { + printf ("pthread_getattr_np failed: %s\n", strerror (status)); + return 1; + } + + status = pthread_attr_getstack (&attr, &stack2, &stacksize); + if (status != 0) + { + printf ("pthread_attr_getstack failed: %s\n", strerror (status)); + return 1; + } + + if (stack2 != stack || stacksize != STACKSIZE) + { + printf ("second pthread_attr_getstack returned different stack (%p,%x)\n" + "than was set by setstack (%p,%x)\n", + stack2, stacksize, stack, STACKSIZE); + return 3; + } + + /* pthread_detach (thread); */ + if (pthread_join (thread, NULL) != 0) + { + printf ("join failed\n"); + return 1; + } + return 0; +} Jakub From jes@linuxcare.com Wed Mar 21 10:10:00 2001 From: jes@linuxcare.com (Jes Sorensen) Date: Wed, 21 Mar 2001 10:10:00 -0000 Subject: compile problem References: <200103211513.QAA28336@lxplus015.cern.ch> Message-ID: >>>>> "Andreas" == Andreas Schwab writes: Andreas> $ rm csu/abi-tag.h $ make This did the trick. Thanks a lot Jes From drepper@redhat.com Wed Mar 21 10:49:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 21 Mar 2001 10:49:00 -0000 Subject: [PATCH] pthread_getattr_np (take 2) References: <20010320161951.B1635@sunsite.ms.mff.cuni.cz> <20010321182759.C593@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Here is a new patch (with cast of descr->p_guardaddr) including a testcase > and a bugfix for pthread_attr_setstack, which was checking e.g. on ia32 if > stackaddr & 0xffffffdf is non-zero and thus usually failed. Thanks, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Mar 21 10:51:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 21 Mar 2001 10:51:00 -0000 Subject: [PATCH] sparc stackinfo.h References: <20010320153758.A1635@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Stack grows down on SPARC... The patch has been applied. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Mar 21 10:53:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 21 Mar 2001 10:53:00 -0000 Subject: __gethostname References: Message-ID: Andreas Schwab writes: > The __gethostname prototype in include/unistd.h needs fixing. Thanks, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Wed Mar 21 13:22:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 21 Mar 2001 13:22:00 -0000 Subject: [PATCH] Fix a typo in pthread.c Message-ID: <20010321222411.D593@sunsite.ms.mff.cuni.cz> Hi! Looks like the patch was applied from web archive... 2001-03-21 Jakub Jelinek * pthread.c (__pthread_initialize_manager): Fix a typo. --- libc/linuxthreads/pthread.c.jj Tue Mar 20 13:45:29 2001 +++ libc/linuxthreads/pthread.c Wed Mar 21 23:24:10 2001 @@ -495,7 +495,7 @@ int __pthread_initialize_manager(void) struct pthread_request request; #ifndef HAVE_Z_NODELETE - if (__builtin_expect (&__dso_handle != NULL, 1)) + if (__builtin_expect (&__dso_handle != NULL, 1)) __cxa_atexit ((void (*) (void *)) pthread_atexit_retcode, NULL, __dso_handle); #endif Jakub From jes@linuxcare.com Wed Mar 21 13:25:00 2001 From: jes@linuxcare.com (Jes Sorensen) Date: Wed, 21 Mar 2001 13:25:00 -0000 Subject: ia64 compile fix Message-ID: <200103212125.WAA09531@lxplus015.cern.ch> 2001-03-21 Jes Sorensen * sysdeps/unix/sysv/linux/ia64/makecontext.c: Include libintl.h for internationalized printfs to work. --- sysdeps/unix/sysv/linux/ia64/makecontext.c~ Tue Mar 20 17:30:31 2001 +++ sysdeps/unix/sysv/linux/ia64/makecontext.c Wed Mar 21 15:36:45 2001 @@ -22,6 +22,7 @@ #include #include #include +#include struct fdesc From jes@linuxcare.com Wed Mar 21 13:26:00 2001 From: jes@linuxcare.com (Jes Sorensen) Date: Wed, 21 Mar 2001 13:26:00 -0000 Subject: linuxthreads compile fix Message-ID: <200103212126.WAA10293@lxplus015.cern.ch> Hi I believe this one must have slipped in by mistake as I can't find any reference to the amp variable anywhere. Jes 2001-03-21 Jes Sorensen * pthread.c (__pthread_initialize_manager): Remove reference to non existant amp variable. --- linuxthreads/pthread.c~ Tue Mar 20 17:30:23 2001 +++ linuxthreads/pthread.c Wed Mar 21 16:19:02 2001 @@ -495,7 +495,7 @@ struct pthread_request request; #ifndef HAVE_Z_NODELETE - if (__builtin_expect (&__dso_handle != NULL, 1)) + if (__builtin_expect (__dso_handle != NULL, 1)) __cxa_atexit ((void (*) (void *)) pthread_atexit_retcode, NULL, __dso_handle); #endif From drepper@redhat.com Wed Mar 21 13:32:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 21 Mar 2001 13:32:00 -0000 Subject: [PATCH] Fix a typo in pthread.c References: <20010321222411.D593@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Looks like the patch was applied from web archive... Thanks, it's applied. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Mar 21 13:34:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 21 Mar 2001 13:34:00 -0000 Subject: ia64 compile fix References: <200103212125.WAA09531@lxplus015.cern.ch> Message-ID: Jes Sorensen writes: > 2001-03-21 Jes Sorensen > > * sysdeps/unix/sysv/linux/ia64/makecontext.c: Include libintl.h > for internationalized printfs to work. Thanks, I've applied it. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Mar 21 13:34:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 21 Mar 2001 13:34:00 -0000 Subject: linuxthreads compile fix References: <200103212126.WAA10293@lxplus015.cern.ch> Message-ID: Jes Sorensen writes: > I believe this one must have slipped in by mistake as I can't find any > reference to the amp variable anywhere. Jakub sent a patch earlier. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Fri Mar 23 05:58:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 23 Mar 2001 05:58:00 -0000 Subject: RPC changes References: Message-ID: <20010323150015.H593@sunsite.ms.mff.cuni.cz> On Tue, Mar 20, 2001 at 10:50:14AM -0800, Ulrich Drepper wrote: > I've checked in a patch I got quite some time ago and which I delayed > for the 2.2 release. It is introducing thread-safe RPC functions, > similar to what Solaris has. This should not introduce > incompatibilities since programs currently using RPC functions in > different threads are doomed. > > I had to modify the patch quite a lot and have done only a tiny bit of > testing myself. Please test it out. Here is a harmless typo patch. Anyway, after second look at the patch, the patch does introduce incompatibilities even in programs not using RPC functions in different threads, particularly that the exported svc_fdset, rpc_createerr, svc_pollfd and svc_max_pollfd variables will be always 0 all the time (which breaks I think am-utils and other programs). Here is a patch I wrote today, it builds fine but have not tested it yet. What it does is (in order to avoid having svc_fdset_s etc. as pointers to the actual variables) exporting svc_fdset etc. as aliases into the __libc_tsd_RPC_VARS_mem variable and making sure __libc_tsd_RPC_VARS_mem is used in non-threaded apps and for the first thread using rpc in threaded apps (several programs like am-utils are linked against -lpthread, yet use rpc just in one thread) and we should maintain binary compatibility there. Also, it exports __rpc_thread_variables to userland, so that threads can access svc_fdset etc. and see there meaningful things. The __dummy field seems unfortunately necessary, since otherwise the alias gets for some reason the size of the whole __libc_tsd_RPC_VARS_mem and not just of the field in it. 2001-03-23 Jakub Jelinek * include/rpc/rpc.h (rpc_thread_variables): Use a special structure for global exported variables. (__rpc_thread_variables): Remove prototype. (svc_fdset, rpc_createerr, svc_pollfd, svc_max_pollfd): Remove. * sunrpc/rpc/clnt.h (struct __rpc_thread_variables_s): New. (__rpc_thread_variables): Add prototype. (__RPC_THREAD_VARIABLE, rpc_createerr): Define. * sunrpc/rpc/svc.h (svc_fdset, svc_pollfd, svc_max_pollfd): Define. * sunrpc/rpc_common.c (svc_fdset, rpc_createerr, svc_pollfd, svc_max_pollfd): Only declare if not thread safe. * sunrpc/rpc_thread.c (svc_fdset, rpc_createerr, svc_pollfd, svc_max_pollfd): Declare as aliases into __libc_tsd_RPC_VARS_mem. (__rpc_thread_do_destroy): New. (__rpc_thread_destroy): Use it. Don't free __libc_tsd_RPC_VARS_mem. (__rpc_thread_variables): In threaded application, use __libc_tsd_RPC_VARS_mem for the first thread which calls __rpc_thread_variables. (free_mem): New. * sunrpc/clnt_perr.c (free_mem): Only declare if not thread safe. * sunrpc/auth_none.c (authnone_private): Fix a typo. * sunrpc/Versions (__rpc_thread_variables): Export @GLIBC_2.2.3. --- libc/include/rpc/rpc.h.jj Wed Mar 21 15:44:51 2001 +++ libc/include/rpc/rpc.h Fri Mar 23 15:24:21 2001 @@ -11,10 +11,7 @@ extern unsigned long _create_xid (void); */ #ifdef _RPC_THREAD_SAFE_ struct rpc_thread_variables { - fd_set svc_fdset_s; /* Global, rpc_common.c */ - struct rpc_createerr rpc_createerr_s; /* Global, rpc_common.c */ - struct pollfd *svc_pollfd_s; /* Global, rpc_common.c */ - int svc_max_pollfd_s; /* Global, rpc_common.c */ + struct __rpc_thread_variables_s var_s; /* Global, rpc_thread.c */ void *authnone_private_s; /* auth_none.c */ @@ -38,23 +35,14 @@ struct rpc_thread_variables { void *svcsimple_transp_s; /* svc_simple.c */ }; -extern struct rpc_thread_variables *__rpc_thread_variables(void) - __attribute__ ((const)); extern void __rpc_thread_svc_cleanup (void); extern void __rpc_thread_clnt_cleanup (void); extern void __rpc_thread_key_cleanup (void); extern void __rpc_thread_destroy (void); -#define RPC_THREAD_VARIABLE(x) (__rpc_thread_variables()->x) - -/* - * Global variables - */ -#define svc_fdset RPC_THREAD_VARIABLE(svc_fdset_s) -#define rpc_createerr RPC_THREAD_VARIABLE(rpc_createerr_s) -#define svc_pollfd RPC_THREAD_VARIABLE(svc_pollfd_s) -#define svc_max_pollfd RPC_THREAD_VARIABLE(svc_max_pollfd_s) +#define RPC_THREAD_VARIABLE(x) \ + (((struct rpc_thread_variables *)__rpc_thread_variables())->x) #endif /* _RPC_THREAD_SAFE_ */ --- libc/sunrpc/rpc/clnt.h.jj Wed Aug 2 21:36:33 2000 +++ libc/sunrpc/rpc/clnt.h Fri Mar 23 15:42:11 2001 @@ -394,7 +394,23 @@ struct rpc_createerr { extern struct rpc_createerr rpc_createerr; +#if !defined _LIBC || defined _RPC_THREAD_SAFE_ +struct __rpc_thread_variables_s { + int __dummy; + int __svc_max_pollfd; + struct pollfd *__svc_pollfd; + fd_set __svc_fdset; + struct rpc_createerr __rpc_createerr; +}; + +extern struct __rpc_thread_variables_s *__rpc_thread_variables(void) + __attribute__ ((const)); + +#define __RPC_THREAD_VARIABLE(x) (__rpc_thread_variables()->x) +#define rpc_createerr __RPC_THREAD_VARIABLE(__rpc_createerr) + +#endif /* _RPC_THREAD_SAFE_ */ /* * Copy error message to buffer. --- libc/sunrpc/rpc/svc.h.jj Wed Aug 2 21:36:33 2000 +++ libc/sunrpc/rpc/svc.h Fri Mar 23 15:27:20 2001 @@ -263,6 +263,13 @@ extern void svcerr_systemerr (SVCXPRT *_ extern struct pollfd *svc_pollfd; extern int svc_max_pollfd; extern fd_set svc_fdset; + +#if !defined _LIBC || defined _RPC_THREAD_SAFE_ +#define svc_fdset __RPC_THREAD_VARIABLE(__svc_fdset) +#define svc_pollfd __RPC_THREAD_VARIABLE(__svc_pollfd) +#define svc_max_pollfd __RPC_THREAD_VARIABLE(__svc_max_pollfd) +#endif /* _RPC_THREAD_SAFE_ */ + #define svc_fds svc_fdset.fds_bits[0] /* compatibility */ /* --- libc/sunrpc/auth_none.c.jj Wed Mar 21 15:44:52 2001 +++ libc/sunrpc/auth_none.c Fri Mar 23 11:45:54 2001 @@ -62,7 +62,7 @@ struct authnone_private_s { u_int mcnt; }; #ifdef _RPC_THREAD_SAFE_ -#define authnone_private ((struct authnone_private_ *)RPC_THREAD_VARIABLE(authnone_private_s)) +#define authnone_private ((struct authnone_private_s *)RPC_THREAD_VARIABLE(authnone_private_s)) #else static struct authnone_private_s *authnone_private; #endif --- libc/sunrpc/rpc_common.c.jj Wed Mar 21 15:44:52 2001 +++ libc/sunrpc/rpc_common.c Fri Mar 23 12:21:23 2001 @@ -28,19 +28,14 @@ */ #include -#ifdef _RPC_THREAD_SAFE_ -#undef svc_fdset -#undef rpc_createerr -#undef svc_pollfd -#undef svc_max_pollfd -#endif /* _RPC_THREAD_SAFE_ */ - /* * This file should only contain common data (global data) that is exported * by public interfaces */ struct opaque_auth _null_auth; +#ifndef _RPC_THREAD_SAFE_ fd_set svc_fdset; struct rpc_createerr rpc_createerr; struct pollfd *svc_pollfd; int svc_max_pollfd; +#endif --- libc/sunrpc/rpc_thread.c.jj Tue Mar 20 19:32:02 2001 +++ libc/sunrpc/rpc_thread.c Fri Mar 23 15:38:21 2001 @@ -1,3 +1,4 @@ +#include #include #include #include @@ -15,41 +16,86 @@ static struct rpc_thread_variables *__li &__libc_tsd_RPC_VARS_mem; /* + * Export globally some members of __libc_tsd_RPC_VARS_mem. + */ +#define S_(x) #x +#define S(x) S_(x) +#ifdef HAVE_ASM_SET_DIRECTIVE +#define A(x,y) ".set " S_(x) "," S_(y) +#else +#define A(x,y) S_(x) " = " S_(y) +#endif +#define V(var) \ + asm volatile ( \ + S(ASM_GLOBAL_DIRECTIVE) " " S(C_SYMBOL_NAME(var)) S(ASM_LINE_SEP) \ + ".type " S(C_SYMBOL_NAME(var)) ",@object" S(ASM_LINE_SEP) \ + ".size " S(C_SYMBOL_NAME(var)) ",%c0" S(ASM_LINE_SEP) \ + A(C_SYMBOL_NAME(var), \ + C_SYMBOL_NAME(__libc_tsd_RPC_VARS_mem) + %c1) S(ASM_LINE_SEP) \ + : : "i" (sizeof (__libc_tsd_RPC_VARS_mem.var_s.__##var)), \ + "i" (offsetof (struct rpc_thread_variables, var_s.__##var))); + +#undef svc_fdset +#undef rpc_createerr +#undef svc_pollfd +#undef svc_max_pollfd + +static void +__rpc_thread_do_destroy (struct rpc_thread_variables *tvp) +{ + V (svc_fdset) + V (rpc_createerr) + V (svc_pollfd) + V (svc_max_pollfd) + + free (tvp->authnone_private_s); + free (tvp->clnt_perr_buf_s); + free (tvp->clntraw_private_s); + free (tvp->svcraw_private_s); + free (tvp->authdes_cache_s); + free (tvp->authdes_lru_s); +} + +/* * Task-variable destructor */ void __rpc_thread_destroy (void) { - struct rpc_thread_variables *tvp = __rpc_thread_variables(); + struct rpc_thread_variables *tvp = + (struct rpc_thread_variables *)__rpc_thread_variables(); - if (tvp != NULL) { + if (tvp != NULL && tvp != &__libc_tsd_RPC_VARS_mem) { __rpc_thread_svc_cleanup (); __rpc_thread_clnt_cleanup (); __rpc_thread_key_cleanup (); - free (tvp->authnone_private_s); - free (tvp->clnt_perr_buf_s); - free (tvp->clntraw_private_s); - free (tvp->svcraw_private_s); - free (tvp->authdes_cache_s); - free (tvp->authdes_lru_s); + __rpc_thread_do_destroy (tvp); free (tvp); } } -struct rpc_thread_variables * +struct __rpc_thread_variables_s * __rpc_thread_variables (void) { struct rpc_thread_variables *tvp; tvp = __libc_tsd_get (RPC_VARS); if (tvp == NULL) { - tvp = calloc (1, sizeof *tvp); - if (tvp != NULL) - __libc_tsd_set (RPC_VARS, tvp); - else - tvp = __libc_tsd_RPC_VARS_data; + __libc_lock_define_initialized (static, tvp_lock) + if (!__libc_lock_trylock (tvp_lock) + || (tvp = calloc (1, sizeof *tvp)) == NULL) + tvp = &__libc_tsd_RPC_VARS_mem; + __libc_tsd_set (RPC_VARS, tvp); } - return tvp; + return (struct __rpc_thread_variables_s *) tvp; } + +static void __attribute__ ((unused)) +free_mem (void) +{ + __rpc_thread_do_destroy (&__libc_tsd_RPC_VARS_mem); +} +text_set_element (__libc_subfreeres, free_mem); + #endif /* _RPC_THREAD_SAFE_ */ --- libc/sunrpc/clnt_perr.c.jj Wed Mar 21 15:44:52 2001 +++ libc/sunrpc/clnt_perr.c Fri Mar 23 14:16:26 2001 @@ -391,10 +391,11 @@ auth_errmsg (enum auth_stat stat) return NULL; } - +#ifndef _RPC_THREAD_SAFE_ static void __attribute__ ((unused)) free_mem (void) { free (buf); } text_set_element (__libc_subfreeres, free_mem); +#endif --- libc/sunrpc/Versions.jj Wed Mar 21 15:44:52 2001 +++ libc/sunrpc/Versions Fri Mar 23 15:12:35 2001 @@ -110,6 +110,6 @@ libc { svc_getreq_common; svc_getreq_poll; svc_max_pollfd; svc_pollfd; } GLIBC_2.2.3 { - __rpc_thread_destroy; + __rpc_thread_destroy; __rpc_thread_variables; } } Jakub From jakub@redhat.com Fri Mar 23 07:41:00 2001 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 23 Mar 2001 07:41:00 -0000 Subject: [PATCH] RPC changes References: <20010323150015.H593@sunsite.ms.mff.cuni.cz> Message-ID: <20010323164323.I593@sunsite.ms.mff.cuni.cz> On Fri, Mar 23, 2001 at 03:00:15PM +0100, Jakub Jelinek wrote: > What it does is (in order to avoid having svc_fdset_s etc. as pointers to > the actual variables) exporting svc_fdset etc. as aliases into the > __libc_tsd_RPC_VARS_mem variable and making sure __libc_tsd_RPC_VARS_mem > is used in non-threaded apps and for the first thread using rpc in threaded > apps (several programs like am-utils are linked against -lpthread, yet use > rpc just in one thread) and we should maintain binary compatibility there. > Also, it exports __rpc_thread_variables to userland, so that threads can > access svc_fdset etc. and see there meaningful things. > The __dummy field seems unfortunately necessary, since otherwise the alias > gets for some reason the size of the whole __libc_tsd_RPC_VARS_mem and not > just of the field in it. Actually, it was not that bright idea, since copy relocation screws it up. Here is an updated patch which uses one more level of indirection. I've tested it so far just by looking at addresses of the 4 variables and what __rpc_thread_variables() gives (including calling it from separate thread) and it looked ok. The only problem I see is that defines rpc_createerr as a macro, so if some rpc code uses something like: int foo(void) { struct rpc_createerr x = rpc_createerr; } then it will not compile. I'm not sure what can be done about that, it was a bad idea to call the structure with the same name as the variable. Perhaps we could leave svc_* as it is in the patch below and don't define rpc_createerr as macro outside of glibc, instead define rpc_get_createerr() as macro and threaded programs would be recommended to use that instead of rpc_createerr. 2001-03-23 Jakub Jelinek * include/rpc/rpc.h (rpc_thread_variables): Use a special structure for global exported variables. (__rpc_thread_variables): Remove prototype. (svc_fdset, rpc_createerr, svc_pollfd, svc_max_pollfd): Remove. * sunrpc/rpc/clnt.h (struct __rpc_thread_variables_s): New. (__rpc_thread_variables): Add prototype. (__RPC_THREAD_VARIABLE, rpc_createerr): Define. * sunrpc/rpc/svc.h (svc_fdset, svc_pollfd, svc_max_pollfd): Define. * sunrpc/rpc_thread.c (__rpc_thread_do_destroy): New. (__rpc_thread_destroy): Use it. Don't free __libc_tsd_RPC_VARS_mem. (struct __rpc_thread_vars): New. (__rpc_thread_variables): In threaded application, use __libc_tsd_RPC_VARS_mem for the first thread which calls __rpc_thread_variables. (free_mem): New. * sunrpc/clnt_perr.c (free_mem): Only declare if not thread safe. * sunrpc/auth_none.c (authnone_private): Fix a typo. * sunrpc/Versions (__rpc_thread_variables): Export @GLIBC_2.2.3. --- libc/include/rpc/rpc.h.jj Wed Mar 21 15:44:51 2001 +++ libc/include/rpc/rpc.h Fri Mar 23 15:24:21 2001 @@ -11,10 +11,7 @@ extern unsigned long _create_xid (void); */ #ifdef _RPC_THREAD_SAFE_ struct rpc_thread_variables { - fd_set svc_fdset_s; /* Global, rpc_common.c */ - struct rpc_createerr rpc_createerr_s; /* Global, rpc_common.c */ - struct pollfd *svc_pollfd_s; /* Global, rpc_common.c */ - int svc_max_pollfd_s; /* Global, rpc_common.c */ + struct __rpc_thread_variables_s var_s; /* Global, rpc_thread.c */ void *authnone_private_s; /* auth_none.c */ @@ -38,23 +35,14 @@ struct rpc_thread_variables { void *svcsimple_transp_s; /* svc_simple.c */ }; -extern struct rpc_thread_variables *__rpc_thread_variables(void) - __attribute__ ((const)); extern void __rpc_thread_svc_cleanup (void); extern void __rpc_thread_clnt_cleanup (void); extern void __rpc_thread_key_cleanup (void); extern void __rpc_thread_destroy (void); -#define RPC_THREAD_VARIABLE(x) (__rpc_thread_variables()->x) - -/* - * Global variables - */ -#define svc_fdset RPC_THREAD_VARIABLE(svc_fdset_s) -#define rpc_createerr RPC_THREAD_VARIABLE(rpc_createerr_s) -#define svc_pollfd RPC_THREAD_VARIABLE(svc_pollfd_s) -#define svc_max_pollfd RPC_THREAD_VARIABLE(svc_max_pollfd_s) +#define RPC_THREAD_VARIABLE(x) \ + (((struct rpc_thread_variables *)__rpc_thread_variables())->x) #endif /* _RPC_THREAD_SAFE_ */ --- libc/sunrpc/rpc/clnt.h.jj Wed Aug 2 21:36:33 2000 +++ libc/sunrpc/rpc/clnt.h Fri Mar 23 17:05:22 2001 @@ -394,7 +394,22 @@ struct rpc_createerr { extern struct rpc_createerr rpc_createerr; +#if !defined _LIBC || defined _RPC_THREAD_SAFE_ +struct __rpc_thread_variables_s { + int *__const __svc_max_pollfd; + struct pollfd ** __const __svc_pollfd; + fd_set * __const __svc_fdset; + struct rpc_createerr * __const __rpc_createerr; +}; + +extern struct __rpc_thread_variables_s *__rpc_thread_variables(void) + __attribute__ ((const)); + +#define __RPC_THREAD_VARIABLE(x) (*(__rpc_thread_variables()->x)) +#define rpc_createerr __RPC_THREAD_VARIABLE(__rpc_createerr) + +#endif /* _RPC_THREAD_SAFE_ */ /* * Copy error message to buffer. --- libc/sunrpc/rpc/svc.h.jj Wed Aug 2 21:36:33 2000 +++ libc/sunrpc/rpc/svc.h Fri Mar 23 15:27:20 2001 @@ -263,6 +263,13 @@ extern void svcerr_systemerr (SVCXPRT *_ extern struct pollfd *svc_pollfd; extern int svc_max_pollfd; extern fd_set svc_fdset; + +#if !defined _LIBC || defined _RPC_THREAD_SAFE_ +#define svc_fdset __RPC_THREAD_VARIABLE(__svc_fdset) +#define svc_pollfd __RPC_THREAD_VARIABLE(__svc_pollfd) +#define svc_max_pollfd __RPC_THREAD_VARIABLE(__svc_max_pollfd) +#endif /* _RPC_THREAD_SAFE_ */ + #define svc_fds svc_fdset.fds_bits[0] /* compatibility */ /* --- libc/sunrpc/auth_none.c.jj Wed Mar 21 15:44:52 2001 +++ libc/sunrpc/auth_none.c Fri Mar 23 11:45:54 2001 @@ -62,7 +62,7 @@ struct authnone_private_s { u_int mcnt; }; #ifdef _RPC_THREAD_SAFE_ -#define authnone_private ((struct authnone_private_ *)RPC_THREAD_VARIABLE(authnone_private_s)) +#define authnone_private ((struct authnone_private_s *)RPC_THREAD_VARIABLE(authnone_private_s)) #else static struct authnone_private_s *authnone_private; #endif --- libc/sunrpc/rpc_thread.c.jj Tue Mar 20 19:32:02 2001 +++ libc/sunrpc/rpc_thread.c Fri Mar 23 17:07:10 2001 @@ -1,3 +1,4 @@ +#include #include #include #include @@ -8,11 +9,27 @@ #ifdef _RPC_THREAD_SAFE_ +#undef svc_fdset +#undef rpc_createerr +#undef svc_pollfd +#undef svc_max_pollfd /* Variable used in non-threaded applications. */ -static struct rpc_thread_variables __libc_tsd_RPC_VARS_mem; +static struct rpc_thread_variables __libc_tsd_RPC_VARS_mem = +{ { &svc_max_pollfd, &svc_pollfd, &svc_fdset, &rpc_createerr }, 0 }; static struct rpc_thread_variables *__libc_tsd_RPC_VARS_data = - &__libc_tsd_RPC_VARS_mem; + &__libc_tsd_RPC_VARS_mem; + +static void +__rpc_thread_do_destroy (struct rpc_thread_variables *tvp) +{ + free (tvp->authnone_private_s); + free (tvp->clnt_perr_buf_s); + free (tvp->clntraw_private_s); + free (tvp->svcraw_private_s); + free (tvp->authdes_cache_s); + free (tvp->authdes_lru_s); +} /* * Task-variable destructor @@ -20,36 +37,61 @@ static struct rpc_thread_variables *__li void __rpc_thread_destroy (void) { - struct rpc_thread_variables *tvp = __rpc_thread_variables(); + struct rpc_thread_variables *tvp = + (struct rpc_thread_variables *)__rpc_thread_variables(); - if (tvp != NULL) { - __rpc_thread_svc_cleanup (); - __rpc_thread_clnt_cleanup (); - __rpc_thread_key_cleanup (); - free (tvp->authnone_private_s); - free (tvp->clnt_perr_buf_s); - free (tvp->clntraw_private_s); - free (tvp->svcraw_private_s); - free (tvp->authdes_cache_s); - free (tvp->authdes_lru_s); - free (tvp); - } + if (tvp != NULL && tvp != &__libc_tsd_RPC_VARS_mem) + { + __rpc_thread_svc_cleanup (); + __rpc_thread_clnt_cleanup (); + __rpc_thread_key_cleanup (); + __rpc_thread_do_destroy (tvp); + free (tvp); + } } +struct __rpc_thread_vars { + struct rpc_thread_variables s; + int svc_max_pollfd; + struct pollfd *svc_pollfd; + fd_set svc_fdset; + struct rpc_createerr rpc_createerr; +}; -struct rpc_thread_variables * +struct __rpc_thread_variables_s * __rpc_thread_variables (void) { - struct rpc_thread_variables *tvp; + struct __rpc_thread_vars *tvp; - tvp = __libc_tsd_get (RPC_VARS); - if (tvp == NULL) { - tvp = calloc (1, sizeof *tvp); - if (tvp != NULL) - __libc_tsd_set (RPC_VARS, tvp); - else - tvp = __libc_tsd_RPC_VARS_data; + tvp = __libc_tsd_get (RPC_VARS); + if (tvp == NULL) + { + __libc_lock_define_initialized (static, tvp_lock) + if (__libc_lock_trylock (tvp_lock)) + { + tvp = calloc (1, sizeof *tvp); + if (tvp == NULL) + tvp = (struct __rpc_thread_vars *)&__libc_tsd_RPC_VARS_mem; + else + { + *(void *)&tvp->s.var_s.__svc_max_pollfd = &tvp->svc_max_pollfd; + *(void *)&tvp->s.var_s.__svc_pollfd = &tvp->svc_pollfd; + *(void *)&tvp->s.var_s.__svc_fdset = &tvp->svc_fdset; + *(void *)&tvp->s.var_s.__rpc_createerr = &tvp->rpc_createerr; + } } - return tvp; + else + tvp = (struct __rpc_thread_vars *)&__libc_tsd_RPC_VARS_mem; + __libc_tsd_set (RPC_VARS, tvp); + } + return (struct __rpc_thread_variables_s *) tvp; } + +static void __attribute__ ((unused)) +free_mem (void) +{ + __rpc_thread_do_destroy (&__libc_tsd_RPC_VARS_mem); +} +text_set_element (__libc_subfreeres, free_mem); + #endif /* _RPC_THREAD_SAFE_ */ --- libc/sunrpc/clnt_perr.c.jj Wed Mar 21 15:44:52 2001 +++ libc/sunrpc/clnt_perr.c Fri Mar 23 14:16:26 2001 @@ -391,10 +391,11 @@ auth_errmsg (enum auth_stat stat) return NULL; } - +#ifndef _RPC_THREAD_SAFE_ static void __attribute__ ((unused)) free_mem (void) { free (buf); } text_set_element (__libc_subfreeres, free_mem); +#endif --- libc/sunrpc/Versions.jj Wed Mar 21 15:44:52 2001 +++ libc/sunrpc/Versions Fri Mar 23 15:12:35 2001 @@ -110,6 +110,6 @@ libc { svc_getreq_common; svc_getreq_poll; svc_max_pollfd; svc_pollfd; } GLIBC_2.2.3 { - __rpc_thread_destroy; + __rpc_thread_destroy; __rpc_thread_variables; } } Jakub From drepper@redhat.com Fri Mar 23 14:48:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 23 Mar 2001 14:48:00 -0000 Subject: [PATCH] RPC changes References: <20010323150015.H593@sunsite.ms.mff.cuni.cz> <20010323164323.I593@sunsite.ms.mff.cuni.cz> Message-ID: I have something else in mind. The first thread to use the RPC stuff will simply not allocate any data structures but instead use pointers to the global variables. I.e., all programs were only one thread uses RPC will run as before including use of global variables and copy relocations. I'll look at this later today (hopefully). -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Mar 23 15:00:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 23 Mar 2001 15:00:00 -0000 Subject: [PATCH] RPC changes References: <20010323150015.H593@sunsite.ms.mff.cuni.cz> <20010323164323.I593@sunsite.ms.mff.cuni.cz> <20010323175605.T1169@devserv.devel.redhat.com> Message-ID: Jakub Jelinek writes: > That's exactly what this second patch is doing (the first (or only) thread > to use RPC uses __libc_tsd_RPC_VARS_mem which has pointers to the global > variables). But you are using double indirection which shouldn't be necessary. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jes@linuxcare.com Fri Mar 23 15:27:00 2001 From: jes@linuxcare.com (Jes Sorensen) Date: Fri, 23 Mar 2001 15:27:00 -0000 Subject: ia64 cleanup patch Message-ID: <200103232327.AAA22174@lxplus015.cern.ch> Hi A stack of patches from David Mosberger and myself cleaning up a number of ia64 specific files. Jes 2001-03-23 Jes Sorensen * sysdeps/unix/sysv/linux/ia64/sysdep.h (ENTRY): moved to ... * sysdeps/ia64/sysdep.h: ... here. * sysdeps/ia64/sysdep.h(LOCAL_ENTRY): Define. * sysdeps/ia64/sysdep.h(LOCAL_LEAF): Define. * sysdeps/ia64/_mcount.S(_mcount_ret_helper): Use LOCAL_LEAF() to declare instead of LEAF(). Suggestion from David Mosberger. 2001-03-21 David Mosberger * sysdeps/unix/sysv/linux/ia64/sysdep.h (CALL_MCOUNT): Add unwind directives. (PSEUDO): Drop .psr and .lsb directives. * sysdeps/unix/sysv/linux/ia64/setjmp.S: Ditto. Add unwind directives. * sysdeps/unix/sysv/linux/ia64/sysdep.S: Ditto. * sysdeps/ia64/elf/start.S: Misc cleanup: remove .psr and .lsb directives etc. * sysdeps/unix/sysv/linux/ia64/brk.S: Ditto. * sysdeps/unix/sysv/linux/ia64/__longjmp.S: Ditto. * sysdeps/ia64/_mcount.S: Remove .psr and .lsb directives (no longer needed). Add unwind directives. * sysdeps/ia64/sysdep.h: Define ASM_UNW_PRLG_RP, ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_PSP, ASM_UNW_PRLG_PR, and ASM_UNW_PRLG_GRSAVE. diff -urN -X /home/jes/exclude-libc /home/jes/cygnus/libc-2.2-200301/sysdeps/ia64/_mcount.S libc-2.2/sysdeps/ia64/_mcount.S --- /home/jes/cygnus/libc-2.2-200301/sysdeps/ia64/_mcount.S Thu Dec 7 20:26:31 2000 +++ libc-2.2/sysdeps/ia64/_mcount.S Fri Mar 23 15:07:17 2001 @@ -48,13 +48,11 @@ #undef ret - .psr abi64 - .psr lsb - .lsb - LEAF(_mcount) - alloc loc0 = ar.pfs, 4, 4, 3, 0 - mov loc1 = rp + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4) + alloc loc1 = ar.pfs, 4, 4, 3, 0 + mov loc0 = rp + .body mov loc2 = r8 // gcc uses r8 to pass pointer to return structure ;; mov loc3 = r15 // gcc uses r15 to pass the static link to nested functions @@ -67,21 +65,27 @@ .mii mov gp = in1 mov r2 = ip - mov ar.pfs = loc0 + mov ar.pfs = loc1 } ;; - adds r2 = 1f - .here, r2 - mov b7 = loc1 + adds r2 = _mcount_ret_helper - .here, r2 + mov b7 = loc0 mov rp = in2 ;; mov r8 = loc2 mov r15 = loc3 mov b6 = r2 br.ret.sptk.few b6 +END(_mcount) -1: alloc r2 = ar.pfs, 0, 0, 9, 0 +LOCAL_LEAF(_mcount_ret_helper) + .prologue + .altrp b7 + .save ar.pfs, r40 + .body + alloc r2 = ar.pfs, 0, 0, 9, 0 mov ar.pfs = r40 br b7 -END(_mcount) +END(_mcount_ret_helper) weak_alias (_mcount, mcount) diff -urN -X /home/jes/exclude-libc /home/jes/cygnus/libc-2.2-200301/sysdeps/ia64/elf/start.S libc-2.2/sysdeps/ia64/elf/start.S --- /home/jes/cygnus/libc-2.2-200301/sysdeps/ia64/elf/start.S Mon Dec 11 10:20:57 2000 +++ libc-2.2/sysdeps/ia64/elf/start.S Thu Mar 22 14:43:48 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jes Sorensen, , April 1999. @@ -31,14 +31,8 @@ * out6: stack_end */ - .psr abi64 - .psr lsb - .lsb - - .text - - .global _start# - .proc _start# + .global _start + .proc _start _start: { .mlx @@ -59,11 +53,11 @@ } { .mfi mov ar.fpsr = r3 - addl out0 = @ltoff(@fptr(main#)), gp + addl out0 = @ltoff(@fptr(main)), gp } { .mfi - addl out4 = @ltoff(@fptr(_fini#)), gp - addl out3 = @ltoff(@fptr(_init#)), gp + addl out4 = @ltoff(@fptr(_fini)), gp + addl out3 = @ltoff(@fptr(_init)), gp ;; } { .mmi @@ -74,14 +68,14 @@ { .mib ld8 out4 = [out4] /* pointer to `fini' function descriptor */ mov out5 = ret0 /* dynamic linker destructor */ - br.call.sptk.few rp = __libc_start_main# + br.call.sptk.few rp = __libc_start_main } { .mib mov rp = r0 br.ret.sptk.few rp /* break miserably if we ever return */ ;; } - .endp _start# + .endp _start /* Define a symbol for the first piece of initialized data. */ .data diff -urN -X /home/jes/exclude-libc /home/jes/cygnus/libc-2.2-200301/sysdeps/ia64/sysdep.h libc-2.2/sysdeps/ia64/sysdep.h --- /home/jes/cygnus/libc-2.2-200301/sysdeps/ia64/sysdep.h Mon Jul 31 23:11:48 2000 +++ libc-2.2/sysdeps/ia64/sysdep.h Fri Mar 23 15:06:25 2001 @@ -21,11 +21,39 @@ #ifdef __ASSEMBLER__ +/* Macros to help writing .prologue directives in assembly code. */ +#define ASM_UNW_PRLG_RP 0x8 +#define ASM_UNW_PRLG_PFS 0x4 +#define ASM_UNW_PRLG_PSP 0x2 +#define ASM_UNW_PRLG_PR 0x1 +#define ASM_UNW_PRLG_GRSAVE(ninputs) (32+(ninputs)) + +#define ENTRY(name) \ + .text; \ + .align 32; \ + .proc C_SYMBOL_NAME(name); \ + .global C_SYMBOL_NAME(name); \ + C_LABEL(name) \ + CALL_MCOUNT + +#define LOCAL_ENTRY(name) \ + .text; \ + .align 32; \ + .proc C_SYMBOL_NAME(name); \ + C_LABEL(name) \ + CALL_MCOUNT + #define LEAF(name) \ .text; \ .align 32; \ .proc C_SYMBOL_NAME(name); \ .global name; \ + C_LABEL(name) + +#define LOCAL_LEAF(name) \ + .text; \ + .align 32; \ + .proc C_SYMBOL_NAME(name); \ C_LABEL(name) /* Mark the end of function SYM. */ diff -urN -X /home/jes/exclude-libc /home/jes/cygnus/libc-2.2-200301/sysdeps/unix/sysv/linux/ia64/__longjmp.S libc-2.2/sysdeps/unix/sysv/linux/ia64/__longjmp.S --- /home/jes/cygnus/libc-2.2-200301/sysdeps/unix/sysv/linux/ia64/__longjmp.S Sun Mar 18 22:19:56 2001 +++ libc-2.2/sysdeps/unix/sysv/linux/ia64/__longjmp.S Thu Mar 22 14:43:54 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by David Mosberger-Tang . The GNU C Library is free software; you can redistribute it and/or @@ -39,16 +39,9 @@ # define pNeg p7 /* is rotate count negative? */ - .psr abi64 - .psr lsb - .lsb - /* __longjmp(__jmp_buf buf, int val) */ - .text - .align 32 - .global __longjmp - .proc __longjmp -__longjmp: + +LEAF(__longjmp) alloc r8=ar.pfs,2,1,0,0 mov r27=ar.rsc add r2=0x98,in0 // r2 <- &jmpbuf.orig_jmp_buf_addr @@ -164,5 +157,4 @@ invala // virt. -> phys. regnum mapping may change mov pr=r24,-1 ret - .endp __longjmp - +END(__longjmp) diff -urN -X /home/jes/exclude-libc /home/jes/cygnus/libc-2.2-200301/sysdeps/unix/sysv/linux/ia64/brk.S libc-2.2/sysdeps/unix/sysv/linux/ia64/brk.S --- /home/jes/cygnus/libc-2.2-200301/sysdeps/unix/sysv/linux/ia64/brk.S Fri Jun 9 20:10:09 2000 +++ libc-2.2/sysdeps/unix/sysv/linux/ia64/brk.S Thu Mar 22 14:43:58 2001 @@ -1,5 +1,5 @@ /* brk system call for Linux/ia64 - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Stephane Eranian and Jes Sorensen, , April 1999. @@ -19,31 +19,26 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include + #include #include - .text - .psr abi64 - .psr lsb - .lsb .global __curbrk .data .align 8 __curbrk: data8 0 - .weak ___brk_addr -___brk_addr = __curbrk - .text - .align 16 - .global __brk - .proc __brk -__brk: + +weak_alias (__curbrk, ___brk_addr) + +LEAF(__brk) mov r15=__NR_brk break.i __BREAK_SYSCALL ;; cmp.ltu p6,p0=ret0,r32 /* r32 is the input register, even though we haven't allocated a frame */ - addl r9=@ltoff(__curbrk#),gp + addl r9=@ltoff(__curbrk),gp ;; ld8 r9=[r9] (p6) mov ret0=ENOMEM @@ -51,8 +46,7 @@ ;; st8 [r9]=ret0 mov ret0=0 - br.ret.sptk.few rp - .endp __brk + ret +END(__brk) - .weak brk -brk = __brk +weak_alias (__brk, brk) diff -urN -X /home/jes/exclude-libc /home/jes/cygnus/libc-2.2-200301/sysdeps/unix/sysv/linux/ia64/setjmp.S libc-2.2/sysdeps/unix/sysv/linux/ia64/setjmp.S --- /home/jes/cygnus/libc-2.2-200301/sysdeps/unix/sysv/linux/ia64/setjmp.S Wed Nov 22 14:01:28 2000 +++ libc-2.2/sysdeps/unix/sysv/linux/ia64/setjmp.S Thu Mar 22 14:44:03 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by David Mosberger-Tang . The GNU C Library is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ The layout of the jmp_buf is as follows. This is subject to change and user-code should never depend on the particular layout of jmp_buf! - + offset: description: ------- ------------ @@ -67,34 +67,25 @@ #include #include - .text - .psr abi64 - .psr lsb - .lsb - /* The following two entry points are the traditional entry points: */ - .global setjmp - .proc setjmp -setjmp: alloc r8=ar.pfs,2,0,0,0 +LEAF(setjmp) + alloc r8=ar.pfs,2,0,0,0 mov in1=1 br.cond.sptk.many __sigsetjmp - .endp setjmp +END(setjmp) - .global _setjmp - .proc _setjmp -_setjmp: +LEAF(_setjmp) alloc r8=ar.pfs,2,0,0,0 mov in1=0 br.cond.sptk.many __sigsetjmp - .endp _setjmp +END(_setjmp) /* __sigsetjmp(__jmp_buf buf, int savemask) */ - .align 32 - .global __sigsetjmp - .proc __sigsetjmp -__sigsetjmp: - alloc loc0=ar.pfs,2,2,2,0 + +ENTRY(__sigsetjmp) + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2) + alloc loc1=ar.pfs,2,2,2,0 mov r16=ar.unat ;; mov r17=ar.fpsr @@ -114,7 +105,8 @@ ;; stf.spill.nta [r8]=f2,32 stf.spill.nta [r9]=f3,32 - mov loc1=rp + mov loc0=rp + .body ;; stf.spill.nta [r8]=f4,32 stf.spill.nta [r9]=f5,32 @@ -157,7 +149,7 @@ mov r25=ar.unat mov out0=in0 - st8.nta [r2]=loc1,16 // b0 + st8.nta [r2]=loc0,16 // b0 st8.nta [r3]=r17,16 // b1 mov out1=in1 ;; @@ -167,7 +159,7 @@ st8.nta [r2]=r20,16 // b4 st8.nta [r3]=r21,16 // b5 ;; - st8.nta [r2]=loc0,16 // ar.pfs + st8.nta [r2]=loc1,16 // ar.pfs st8.nta [r3]=r22,16 // ar.lc ;; st8.nta [r2]=r24,16 // pr @@ -178,10 +170,10 @@ br.call.dpnt.few rp=__sigjmp_save .ret0: // force a new bundle ::q mov r8=0 - mov rp=loc1 - mov ar.pfs=loc0 + mov rp=loc0 + mov ar.pfs=loc1 ret - .endp __sigsetjmp +END(__sigsetjmp) weak_extern(_setjmp) weak_extern(setjmp) diff -urN -X /home/jes/exclude-libc /home/jes/cygnus/libc-2.2-200301/sysdeps/unix/sysv/linux/ia64/sysdep.S libc-2.2/sysdeps/unix/sysv/linux/ia64/sysdep.S --- /home/jes/cygnus/libc-2.2-200301/sysdeps/unix/sysv/linux/ia64/sysdep.S Fri Sep 29 12:42:33 2000 +++ libc-2.2/sysdeps/unix/sysv/linux/ia64/sysdep.S Thu Mar 22 23:05:55 2001 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by David Mosberger-Tang . The GNU C Library is free software; you can redistribute it and/or @@ -19,10 +19,6 @@ #include #include - .psr abi64 - .psr lsb - .lsb - .global errno .common errno,4,4 .type errno, @object @@ -34,16 +30,11 @@ .global _errno _errno = errno - .text - - .align 8 - - .global __syscall_error - .proc __syscall_error -__syscall_error: +ENTRY(__syscall_error) #ifdef _LIBC_REENTRANT + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(0) alloc r35=ar.pfs, 0, 4, 0, 0 - mov r32=b0 + mov r32=rp mov r33=r8 mov r34=r1 ;; @@ -51,7 +42,7 @@ .Lret0: /* force new bundle */ st4 [r8]=r33 mov r1=r34 - mov b0=r32 + mov rp=r32 mov r8=-1 mov ar.pfs=r35 #else /* _LIBC_REENTRANT */ @@ -71,8 +62,7 @@ st4 [r2]=r3 #endif /* _LIBC_REENTRANT */ ret // ret is #define'd in syscall.h! - .endp __syscall_error - +END(__syscall_error) ENTRY(__ia64_syscall) mov r15=r37 /* syscall number */ diff -urN -X /home/jes/exclude-libc /home/jes/cygnus/libc-2.2-200301/sysdeps/unix/sysv/linux/ia64/sysdep.h libc-2.2/sysdeps/unix/sysv/linux/ia64/sysdep.h --- /home/jes/cygnus/libc-2.2-200301/sysdeps/unix/sysv/linux/ia64/sysdep.h Fri Sep 29 12:43:57 2000 +++ libc-2.2/sysdeps/unix/sysv/linux/ia64/sysdep.h Fri Mar 23 15:04:19 2001 @@ -36,16 +36,20 @@ #undef CALL_MCOUNT #ifdef PROF -# define CALL_MCOUNT \ - .data; \ -1: data8 0; \ - .previous; \ - alloc out0 = ar.pfs, 8, 0, 4, 0; \ - mov out1 = gp; \ - mov out2 = rp; \ - ;; \ - addl out3 = @ltoff(1b), gp; \ - br.call.sptk.many rp = _mcount \ +# define CALL_MCOUNT \ + .data; \ +1: data8 0; /* XXX fixme: use .xdata8 once labels work */ \ + .previous; \ + .prologue; \ + .save ar.pfs, r40; \ + alloc out0 = ar.pfs, 8, 0, 4, 0; \ + mov out1 = gp; \ + .save rp, out2; \ + mov out2 = rp; \ + .body; \ + ;; \ + addl out3 = @ltoff(1b), gp; \ + br.call.sptk.many rp = _mcount \ ;; #else # define CALL_MCOUNT /* Do nothing. */ @@ -72,17 +76,6 @@ cmp.eq p6,p0=-1,r10;; \ (p6) br.cond.spnt.few __syscall_error; -#define ENTRY(name) \ - .psr abi64; \ - .psr lsb; \ - .lsb; \ - .text; \ - .align 32; \ - .proc C_SYMBOL_NAME(name); \ - .global C_SYMBOL_NAME(name); \ - C_LABEL(name) \ - CALL_MCOUNT - #define DO_CALL(num) \ mov r15=num; \ break __BREAK_SYSCALL; From drepper@redhat.com Sat Mar 24 21:10:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 24 Mar 2001 21:10:00 -0000 Subject: ia64 cleanup patch References: <200103232327.AAA22174@lxplus015.cern.ch> Message-ID: Jes Sorensen writes: > A stack of patches from David Mosberger and myself cleaning up a number > of ia64 specific files. Thanks, I've applied them. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Mar 26 14:48:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 26 Mar 2001 14:48:00 -0000 Subject: towards 2.2.3 Message-ID: If you have anything you know has to be fixed let me know soon. I want to make a 2.2.3pre1 release very soon. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From schwidefsky@de.ibm.com Tue Mar 27 01:38:00 2001 From: schwidefsky@de.ibm.com (schwidefsky@de.ibm.com) Date: Tue, 27 Mar 2001 01:38:00 -0000 Subject: typo in ldconfig.h Message-ID: Hi, somehow a \ got lost in the s/390 version of ldconfig.h. Here is a patch: 2001-03-27 Martin Schwidefsky * sysdeps/unix/sysv/linux/s390/ldconfig.h: Fix typo. diff -urN libc/sysdeps/unix/sysv/linux/s390/ldconfig.h libc-s390/sysdeps/unix/sysv/linux/s390/ldconfig.h --- libc/sysdeps/unix/sysv/linux/s390/ldconfig.h Mon Mar 19 23:07:13 2001 +++ libc-s390/sysdeps/unix/sysv/linux/s390/ldconfig.h Tue Mar 27 11:26:55 2001 @@ -19,7 +19,7 @@ #include #define SYSDEP_KNOWN_INTERPRETER_NAMES \ - { "/lib/ld.so.1", FLAG_ELF_LIBC6 }, + { "/lib/ld.so.1", FLAG_ELF_LIBC6 }, \ { "/lib/ld64.so.1", FLAG_ELF_LIBC6 }, #define SYSDEP_KNOWN_LIBRARY_NAMES \ { "libc.so.6", FLAG_ELF_LIBC6 }, \ --- blue skies, Martin Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch????naicherstr. 220, D-71032 B????blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com From aj@suse.de Tue Mar 27 02:20:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Tue, 27 Mar 2001 02:20:00 -0000 Subject: typo in ldconfig.h References: Message-ID: Thanks, I've commited this. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From kkojima@rr.iij4u.or.jp Tue Mar 27 03:36:00 2001 From: kkojima@rr.iij4u.or.jp (kaz Kojima) Date: Tue, 27 Mar 2001 03:36:00 -0000 Subject: towards 2.2.3 References: Message-ID: <200103271136.UAA21569@rr.iij4u.or.jp> Hi, I'd like to send a tiny patch for SH. These definitions of NFREG conflict with those of NFS. kaz -- * sysdeps/sh/sys/ucontext.h (NFREG): Rename to NFPREG. * sysdeps/unix/sysv/linux/sh/sys/ucontext.h (NFREG): Likewise. Index: ucontext.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/sh/sys/ucontext.h,v retrieving revision 1.1 diff -u -r1.1 ucontext.h --- ucontext.h 2000/06/12 20:14:04 1.1 +++ ucontext.h 2001/03/27 11:00:42 @@ -72,10 +72,10 @@ typedef int freg_t; /* Number of FPU registers. */ -#define NFREG 16 +#define NFPREG 16 /* Structure to describe FPU registers. */ -typedef freg_t fpregset_t[NFREG]; +typedef freg_t fpregset_t[NFPREG]; /* Context to describe whole processor state. */ typedef struct Index: ucontext.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sh/sys/ucontext.h,v retrieving revision 1.1 diff -u -r1.1 ucontext.h --- ucontext.h 2000/06/12 20:48:26 1.1 +++ ucontext.h 2001/03/27 11:23:12 @@ -79,10 +79,10 @@ typedef int freg_t; /* Number of FPU registers. */ -#define NFREG 16 +#define NFPREG 16 /* Structure to describe FPU registers. */ -typedef freg_t fpregset_t[NFREG]; +typedef freg_t fpregset_t[NFPREG]; /* Context to describe whole processor state. */ typedef struct From drepper@redhat.com Tue Mar 27 09:21:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 27 Mar 2001 09:21:00 -0000 Subject: towards 2.2.3 References: <200103271136.UAA21569@rr.iij4u.or.jp> Message-ID: kaz Kojima writes: > I'd like to send a tiny patch for SH. These definitions of NFREG > conflict with those of NFS. I've applied it. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From schwidefsky@de.ibm.com Wed Mar 28 12:01:00 2001 From: schwidefsky@de.ibm.com (schwidefsky@de.ibm.com) Date: Wed, 28 Mar 2001 12:01:00 -0000 Subject: some string.h stuff for s/390 Message-ID: Hi, I had another go at the string inlines. I unified the 31/64 bit version of bits/string.h and added optimized code for strcmp. Here is the patch: 2001-03-27 Martin Schwidefsky * sysdeps/s390/bits/string.h: New unified 31/64 bit string.h. * sysdeps/s390/s390-32/bits/string.h: Remove. * sysdeps/s390/s390-64/bits/string.h: Remove. * sysdeps/s390/s390-32/strcmp.S: New file. * sysdeps/s390/s390-64/strcmp.S: New file. blue skies, Martin Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH Sch????naicherstr. 220, D-71032 B????blingen, Telefon: 49 - (0)7031 - 16-2247 E-Mail: schwidefsky@de.ibm.com (See attached file: string.diff) -------------- next part -------------- A non-text attachment was scrubbed... Name: string.diff Type: text/x-diff Size: 18911 bytes Desc: not available URL: From drepper@redhat.com Wed Mar 28 12:54:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 28 Mar 2001 12:54:00 -0000 Subject: some string.h stuff for s/390 References: Message-ID: schwidefsky@de.ibm.com writes: > I had another go at the string inlines. I unified the 31/64 bit version > of bits/string.h and added optimized code for strcmp. Here is the patch: Thanks, I've applied it. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Mar 29 17:53:00 2001 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 29 Mar 2001 17:53:00 -0000 Subject: gone for two days Message-ID: I'll leave soon, will be back late on Saturday. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Thu Mar 29 22:39:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Thu, 29 Mar 2001 22:39:00 -0000 Subject: Add imaxdiv for alpha Message-ID: Alpha didn't define imaxdiv, I've committed the appended bug fix, Andreas 2001-03-30 Andreas Jaeger * sysdeps/alpha/ldiv.S (ldiv): Add alias for imaxdiv. ============================================================ Index: sysdeps/alpha/ldiv.S --- sysdeps/alpha/ldiv.S 1997/03/20 19:33:28 1.2 +++ sysdeps/alpha/ldiv.S 2001/03/30 06:38:09 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson . @@ -106,3 +106,4 @@ .end ldiv weak_alias(ldiv, lldiv) +weak_alias(ldiv, imaxdiv) -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From aj@suse.de Thu Mar 29 22:50:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Thu, 29 Mar 2001 22:50:00 -0000 Subject: fmal and nexttowardl on alpha Message-ID: Why are the functions fmal and nexttowardl not in libm.so on the alpha platform? The functions are required by ISO C99 and are present on ia32. On ia32: $ nm /lib/libm.so.6 |grep nexttoward 0000a170 t __nexttoward 00010c60 t __nexttowardf 00015ef0 t __nexttowardl 0000a170 W nexttoward 00010c60 W nexttowardf 00015ef0 W nexttowardl On Alpha: $ nm /lib/libm.so.6.1 |grep nexttoward 0000000000019f80 t __nexttoward 00000000000293f0 t __nexttowardf 0000000000019f80 W nexttoward 00000000000293f0 W nexttowardf Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From kukuk@suse.de Fri Mar 30 08:57:00 2001 From: kukuk@suse.de (Thorsten Kukuk) Date: Fri, 30 Mar 2001 08:57:00 -0000 Subject: [Patch] rcmd_af and yp_all Message-ID: <20010330185656.A16284@suse.de> Hi, here are 2 small bug fixes. The first one is for rcmd_af. We should also allow PF_UNSPEC. Else it will not work if you have a hostname and does not knows if this has a IPv4 or IPv6 address. This patch is necessary for rlogin. The second one is for yp_all(). We should only print an error message if all tries fails. And we should check only for an protocoll error if we are sure there was no network error. Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE GmbH Schanzaeckerstr. 10 90443 Nuernberg Linux is like a Vorlon. It is incredibly powerful, gives terse, cryptic answers and has a lot of things going on in the background. From roland@frob.com Fri Mar 30 20:48:00 2001 From: roland@frob.com (Roland McGrath) Date: Fri, 30 Mar 2001 20:48:00 -0000 Subject: atexit FAQ Message-ID: <200103310448.f2V4m4Y23046@neuralgia.linnaean.org> Would someone care to write up a FAQ entry for "undefined reference to `atexit'"? From aj@suse.de Sat Mar 31 11:59:00 2001 From: aj@suse.de (Andreas Jaeger) Date: Sat, 31 Mar 2001 11:59:00 -0000 Subject: Fixes from Linux 2.4.3 Message-ID: I've committed the following change from Linux 2.4.3. Andreas 2001-03-31 Andreas Jaeger * sysdeps/unix/sysv/linux/net/if_arp.h (ARPHRD_RAWHDLC): Added. (ARPHRD_HDLC): Define as alias for ARPHRD_CISCO. (ARPHRD_CISCO): New. Changes from Linux 2.4.3. ============================================================ Index: sysdeps/unix/sysv/linux/net/if_arp.h --- sysdeps/unix/sysv/linux/net/if_arp.h 1999/11/24 07:17:40 1.14 +++ sysdeps/unix/sysv/linux/net/if_arp.h 2001/03/31 19:54:23 @@ -1,5 +1,5 @@ /* Definitions for Address Resolution Protocol. - Copyright (C) 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -95,9 +95,11 @@ #define ARPHRD_X25 271 /* CCITT X.25. */ #define ARPHDR_HWX25 272 /* Boards with X.25 in firmware. */ #define ARPHRD_PPP 512 -#define ARPHRD_HDLC 513 /* (Cisco) HDLC. */ +#define ARPHRD_CISCO 513 /* Cisco HDLC. */ +#define ARPHRD_HDLC ARPHRD_CISCO #define ARPHRD_LAPB 516 /* LAPB. */ #define ARPHRD_DDCMP 517 /* Digital's DDCMP. */ +#define ARPHRD_RAWHDLC 518 /* Raw HDLC. */ #define ARPHRD_TUNNEL 768 /* IPIP tunnel. */ #define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel. */ -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj