This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: __stat: should it end up as UND in libc.so or not?


At 15:15 11.12.98 , H.J. Lu wrote:
>> 
>> Hi,
>> 
>> I have a problem with glibc-2.0.106 that depends on the binutils version I 
>use.
>> With binutils-2.9.1.0.18, gas-981124 (which is partly broken), gas-981208
>> and 106 I get:
>> [root@kernel:/usr/src/redhat/glibc/BUILD/glibc-2.0.106/build-ppc-linux]#
>> objdump -T libc.so|grep __stat
>> 00000000      D  *UND*  00000000              __stat
>> [root@kernel:/usr/src/redhat/glibc/BUILD/glibc-2.0.106/build-ppc-linux]# 
>> 
>> With binutils-2.9.1.0.1[56] and 105 I get:
>> [root@kernel:/usr/src/redhat/glibc/BUILD/glibc-2.0.106/build-ppc-linux]#
>> objdump -T /lib/libc-2.0.105.so|grep __stat   
>> [root@kernel:/usr/src/redhat/glibc/BUILD/glibc-2.0.106/build-ppc-linux]# 
>> 
>> So it's listed as UND only in the newly built lib and the difference seems
>> to be the binutils version. Currently I no longer know what's correct and
>> whom to blame. Can somebody enlighten me?
>> AFAI recall, the UND should be there, but I can't find the discussion in my
>> archives anymore.
>> As this seems binutils dependent, I think it would be wise to check the
>> particular feature/bug involved during configure, cause installing a lib
>> with UND __stat on a system where the apps are compiled against a lib
>> without UND __stat, will render this system unuseable. And not everybody
>> installs from an rpm like me...
>> 
>> While checking for this I also noticed the the glibc sources use both
>> __stat and stat to call the stat-function. Shouldn't that be consistent
>> thruout the lib?
>> 
>
>It must be a PPC bug in glibc since __stat is never defined for
>libc.so. I didn't find any reference to __stat in libc, at least
>not on x86.

Ah, found it, I think. This is another instance of glibc/stat compiled
without optimization, I thought this was finally solved sometime ago, but
as a last resort I looked closer and came up with the appended patch.
I think this should solve it, build is running.

Franz.


Index: stat.h
===================================================================
RCS file: /glibc/cvsfiles/libc/include/sys/stat.h,v
retrieving revision 1.4
diff -u -p -r1.4 stat.h
--- stat.h      1998/08/09 17:38:44     1.4
+++ stat.h      1998/12/11 14:50:28
@@ -36,6 +36,7 @@ extern __inline__ int __mknod (__const c
    We have to use macros but we cannot define them in the normal headers
    since on user level we must use real functions.  */
 #define stat(fname, buf) __xstat (_STAT_VER, fname, buf)
+#define __stat(fname, buf) __xstat (_STAT_VER, fname, buf)
 #define fstat(fd, buf) __fxstat (_STAT_VER, fd, buf)
 #define __fstat(fd, buf)  __fxstat (_STAT_VER, fd, buf)
 #define lstat(fname, buf)  __lxstat (_STAT_VER, fname, buf)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]