Re: Smashing the Stack?

From: strangeat_private
Date: Wed Jul 17 2002 - 13:11:21 PDT

  • Next message: yatima: "Re: Smashing the Stack?"

    On Wed, Jul 17, 2002 at 01:34:38PM -0400, Eric Thomas wrote:
    > 
    > I went through this same mystery a few months ago.  Apparently GCC pads
    > the generated assembly for better memory alignment, which makes certain
    > operations faster.  
    
    And in some archs, legal. Non-align memory access is illegal in some archs,
    and non-existant in others (MIPS ignores the last 2/4(?) bits, anyway).
    
    In those cases the OS or the compiler has to access the two words were the
    data is stored. That's not a minor speed penalty...
    
    Anyway, whoever's playing with gcc generated assembly code should compile
    the program explicity without optimizations (-O0) or maybe with
    optimizations for size (-Os) (not sure about data size reduction).
    
    Regards,
    Luciano Rocha
    



    This archive was generated by hypermail 2b30 : Wed Jul 17 2002 - 18:06:52 PDT