Keith Owens wrote:
>
> On Wed, 05 Jul 2000 14:08:49 +0200,
> Olaf Titz <olaf@bigred.inka.de> wrote:
> >Each buffer is tagged
> >with the return address of the caller (here called "scope"). A buffer
> >is considered free when its scope doesn't match the current one.
>
> Double check that __builtin_return_address() gives correct results with
> and without frame pointers. There are reports that it gives incorrect
> data on some versions of gcc when the kernel is compiled with
> -fomit-frame-pointer.
gcc-2.7.2.3/x86:
#include <stdio.h>
main()
{
foo(42);
}
foo(int a)
{
printf("foo: %p\n", __builtin_return_address(0));
}
With gcc -O2 -S -fomit-frame-pointer:
foo:
pushl 4(%esp)
^^^^^^^^^^^^^ Pushes the value of the first argument
pushl $.LC0
call printf
addl $8,%esp
ret
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:16 EST