lkml.org 
[lkml]   [2009]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: BUG: GCC-4.4.x changes the function frame on some functions
    On Thu, 19 Nov 2009, Linus Torvalds wrote:
    > Umm. But it still does, doesn't it? That
    >
    > pushl -0x4(%edi)
    > push %ebp
    >
    > should do it - the "-0x4(%edi)" thing seems to be trying to reload the
    > return address. No?
    >
    > Maybe I misread the code - but regardless, it does look like a gcc code
    > generation bug if only because we really don't want a 16-byte aligned
    > stack anyway, and have asked for it to not be done.
    >
    > So I agree that gcc shouldn't do that crazy prologue (and certainly _not_
    > before calling mcount anyway), but I'm not sure I agree with that detail
    > of your analysis or explanation.

    Yes, it does store the return address before the pushed ebp, but this
    is a copy of the real stack entry which is before the pushed edi.

    The function graph tracer needs to redirect the return into the tracer
    and it therefor saves the real return address and modifies the stack
    so the return ends up in the tracer code which then goes back to the
    real return address.

    But in this prologue/aligment case we modify the copy and not the real
    return address on the stack, so we return without calling into the
    tracer which is causing the headache because the state of the tracer
    becomes confused.

    Thanks,

    tglx


    \
     
     \ /
      Last update: 2009-11-19 18:57    [W:4.740 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site