public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/957] New: endian error in mmap64 for big-endian arm
@ 2005-05-17  8:32 shenkel at gmail dot com
  2005-06-10 18:11 ` [Bug libc/957] " cvs-commit at gcc dot gnu dot org
  2005-09-17 14:09 ` aj at suse dot de
  0 siblings, 2 replies; 3+ messages in thread
From: shenkel at gmail dot com @ 2005-05-17  8:32 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/957] endian error in mmap64 for big-endian arm
  2005-05-17  8:32 [Bug libc/957] New: endian error in mmap64 for big-endian arm shenkel at gmail dot com
@ 2005-06-10 18:11 ` cvs-commit at gcc dot gnu dot org
  2005-09-17 14:09 ` aj at suse dot de
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-06-10 18:11 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-06-10 18:10 -------
Subject: Bug 957

CVSROOT:	/cvs/glibc
Module name:	ports
Changes by:	pb@sources.redhat.com	2005-06-10 18:10:48

Modified files:
	.              : ChangeLog.arm 
	sysdeps/unix/sysv/linux/arm: mmap64.S 

Log message:
	2005-06-10  Phil Blundell  <pb@reciva.com>
	
	Bug #957:
	* sysdeps/unix/sysv/linux/arm/mmap64.S: Handle offset correctly on
	big endian machines.  Reported by Sven Henkel <shenkel@gmail.com>.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/ports/ChangeLog.arm.diff?cvsroot=glibc&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/ports/sysdeps/unix/sysv/linux/arm/mmap64.S.diff?cvsroot=glibc&r1=1.7&r2=1.8



-- 


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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/957] endian error in mmap64 for big-endian arm
  2005-05-17  8:32 [Bug libc/957] New: endian error in mmap64 for big-endian arm shenkel at gmail dot com
  2005-06-10 18:11 ` [Bug libc/957] " cvs-commit at gcc dot gnu dot org
@ 2005-09-17 14:09 ` aj at suse dot de
  1 sibling, 0 replies; 3+ messages in thread
From: aj at suse dot de @ 2005-09-17 14:09 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From aj at suse dot de  2005-09-17 14:09 -------
Fix in CVS head

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-09-17 14:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-17  8:32 [Bug libc/957] New: endian error in mmap64 for big-endian arm shenkel at gmail dot com
2005-06-10 18:11 ` [Bug libc/957] " cvs-commit at gcc dot gnu dot org
2005-09-17 14:09 ` aj at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).