[PATCH] mips/o32: fix internal_syscall5/6/7

Florian Weimer fweimer@redhat.com
Tue Aug 15 12:17:00 GMT 2017


On 08/15/2017 01:50 PM, Aurelien Jarno wrote:
> The internal_syscall5/6/7 functions use the stack pointer to store
> the 5th and following arguments on the stack. In some cases GCC optimize
> out the stack pointer, and thus storing the data to the stack causes a
> segmentation fault.
> 
> Fix that by declaring the sp register as clobbered. Not sure it is the
> best way to do that, but it seems to be enough to force GCC to not
> optimize it out.

Doesn't the inline assembly *require* that r29 is the stack pointer?  Is
there a way to express this explicitly?

Thanks,
Florian



More information about the Libc-alpha mailing list