This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug ports/13109] New: On mips64, the statfs64() does not work.
- From: "rongqing.li at windriver dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Fri, 19 Aug 2011 06:27:16 +0000
- Subject: [Bug ports/13109] New: On mips64, the statfs64() does not work.
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13109
Bug #: 13109
Summary: On mips64, the statfs64() does not work.
Product: glibc
Version: unspecified
Status: NEW
Severity: critical
Priority: P2
Component: ports
AssignedTo: roland@gnu.org
ReportedBy: rongqing.li@windriver.com
Classification: Unclassified
We should weak-alias statfs64 to statfs on mips64 as on x86_64
==================================
//This program does not work
main()
{
statfs64("/tmp", sfbuf);
}
==================================
//This program does not work when we define _FILE_OFFSET_BITS=64
#define _FILE_OFFSET_BITS=64
#include <*.h>
main()
{
statfs("/tmp", sfbuf);
}
==================================
//The below is elf information
-bash-3.2$ readelf -h ./mabi_64/libc.so
ELF Header:
Magic: 7f 45 4c 46 02 02 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, big endian
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: MIPS R3000
Flags: 0x60000007, noreorder, pic, cpic, mips64
....
========================================
//The statfs and statfs64 have different offset, which means different function
//but on x86-64, the offset of statfs and statfs64 are same
-bash-3.2$ readelf -s ./mabi_64/libc.so |grep statfs
6746: 00000000000ee39c 28 FUNC GLOBAL DEFAULT 11 __statfs
6806: 00000000000ee400 8 FUNC WEAK DEFAULT 11 statfs64
6821: 00000000000ee39c 28 FUNC WEAK DEFAULT 11 statfs
-bash-3.2$ objdump -dS ./mabi_64/libc.so
00000000000ee39c <__statfs>:
ee39c: 2402140e li v0,5134
ee3a0: 0000000c syscall
ee3a4: 14e0fff6 bnez a3,ee380 <__fxstatat64+0xb0>
ee3a8: 00000000 nop
ee3ac: 03e00008 jr ra
ee3b0: 00000000 nop
...
ee3c0: 0380082d move at,gp
ee3c4: 3c1c000a lui gp,0xa
ee3c8: 279c6b14 addiu gp,gp,27412
ee3cc: 0399e02d daddu gp,gp,t9
ee3d0: df998588 ld t9,-31352(gp)
ee3d4: 03200008 jr t9
ee3d8: 0020e02d move gp,at
00000000000ee400 <statfs64>:
ee400: 03e00008 jr ra
ee404: 00000000 nop
...
=========================================================
The statfs64 in libc does not any work since the linux kernel
does not implement the statfs64 syscall when define _MIPS_SIM_ABI64,
the reason why statfs64 does not implement is that statfs
has equal function to statfs64 on mips64, I think.
=========================================================
On x86-64, statfs64 in libc has its true implementation since
the statfs64 syscall exist in kernel.
But in libc.so, it is weak-alias to statfs at last, not call
the true statfs64 syscall.
The below information comes from common_pc_64.
readelf -s libc-2.11.1.so |grep statfs
1241: 00000000000c2350 37 FUNC GLOBAL DEFAULT 11
__statfs@@GLIBC_2.2.5
1564: 00000000000c2350 37 FUNC WEAK DEFAULT 11 statfs@@GLIBC_2.2.5
1761: 00000000000c2350 37 FUNC WEAK DEFAULT 11
statfs64@@GLIBC_2.2.5
====================================================
I think the mips64 should have the same result.
====================================================
when call make-syscalls.sh to configure the glibc, I found the
syscalls.list on ./sysdeps/unix/sysv/linux/wordsize-64/ never
be used.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.