This is the mail archive of the libc-alpha@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH 6/6] i386: Remove syscall assembly codes with 6 arguments


On Mon, Sep 14, 2015 at 7:30 AM, Andreas Schwab <schwab@suse.de> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>>  ifeq ($(subdir),misc)
>>  sysdep_routines += ioperm iopl vm86
>> +# %ebp may be used to pass the 6th argument to syscall.
>> +CFLAGS-epoll_pwait.c += -fomit-frame-pointer
>> +CFLAGS-mmap.c += -fomit-frame-pointer
>> +CFLAGS-mmap64.c += -fomit-frame-pointer
>
> What happens if the compiler didn't succeed in eliminating the frame
> pointer?
>

For those functions, its won't be a problem with GCC older than
GCC 5 since EBP is saved/restored when making system calls
in asm statement.  For GCC 5, you will get

../sysdeps/unix/sysv/linux/i386/mmap.c:34:1: error: bp cannot be used
in asm here
 }

when -fno-omit-frame-pointer is used.

-- 
H.J.


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