This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/957] New: endian error in mmap64 for big-endian arm
- From: "shenkel at gmail dot com" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 17 May 2005 08:32:16 -0000
- Subject: [Bug libc/957] New: endian error in mmap64 for big-endian arm
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
When using mmap64 with a non-zero offset on a big-endian arm machine, I always
received EINVAL as return-value. Looking at the assembler-code in
sysdeps/unix/sysv/linux/arm/mmap64.S the problem seems to be an endian-error:
...
#ifdef __NR_mmap2
ldr ip, [sp, $4] @ offset low part
str r5, [sp, #-4]!
ldr r5, [sp, $12] @ offset high part
str r4, [sp, #-4]!
movs r4, ip, lsl $20 @ check that offset is page-aligned
mov ip, ip, lsr $12
moveqs r4, r5, lsr $12 @ check for overflow
bne .Linval
...
For big-endian arm machines, the high-part of the 64-bit offset-value should
be in sp+4, while the low-part is in sp+8. So, the above code always results
in the detection of an overflow and jumping to .Linval. Changing the code to
ldr ip, [sp, $8] @ offset low part
str r5, [sp, #-4]!
ldr r5, [sp, $8] @ offset high part
str r4, [sp, #-4]!
fixed the problem for me.
--
Summary: endian error in mmap64 for big-endian arm
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: gotom at debian dot or dot jp
ReportedBy: shenkel at gmail dot com
CC: glibc-bugs at sources dot redhat dot com
GCC host triplet: armeb-linux
http://sources.redhat.com/bugzilla/show_bug.cgi?id=957
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.