lkml.org 
[lkml]   [2000]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] solution for the inet_ntoa problem, buffer allocator
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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.082 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site