Re: [regression v2.6.38] Re: [PATCH v2] brk: fix min_brk lower bound computation for COMPAT_BRK

From: Andreas Schwab
Date: Tue Mar 29 2011 - 16:37:47 EST


Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> writes:

> Seems like the binary doesn't like brk() rounding up the requested
> value to the next page...

>From libc-5.4.46/libc/sysdeps/linux/m68k/__sbrk.c:

void *
__sbrk(ptrdiff_t increment)
{
if (__init_brk () == 0)
{
register void * tmp asm ("%d1") = ___brk_addr+increment;
__asm__ volatile ("movel %1,%/d0\n\t"
"trap #0\n\t"
"movel %/d0,%0"
:"=g" (___brk_addr)
:"i" (SYS_brk),"g" (tmp) : "%d0");
if (___brk_addr == tmp)
return tmp-increment;
errno = ENOMEM;
}
return ((void *) -1);
}

Andreas.

--
Andreas Schwab, schwab@xxxxxxxxxxxxxx
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/