[PATCH] Force the argument buffer for mmap syscall to be initialized

Jie Zhang jzhang918 at gmail.com
Mon Jun 5 04:26:30 UTC 2006


Some archs still use old mmap syscall, like this:

static inline _syscall1(__ptr_t, _mmap, unsigned long *, buffer);
__ptr_t mmap(__ptr_t addr, size_t len, int prot,
             int flags, int fd, __off_t offset)
{
    unsigned long buffer[6];

    buffer[0] = (unsigned long) addr;
    buffer[1] = (unsigned long) len;
    buffer[2] = (unsigned long) prot;
    buffer[3] = (unsigned long) flags;
    buffer[4] = (unsigned long) fd;
    buffer[5] = (unsigned long) offset;
    return (__ptr_t) _mmap(buffer);
}

GCC 4.1 will optimize away all the statements which initialize the
arguments buffer. this patch should fix it. It also fixes the same
issue in ldso code.

Is it OK? If yes, please help install it. Thanks.

Jie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uclibc-mmap.diff
Type: text/x-patch
Size: 2507 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20060605/7658fc03/attachment.bin 


More information about the uClibc mailing list