This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Beginner] disassembling gcc 3.4 and 4.1


Hi all,

Looking for info about buffer overflow, i've found something quite
strange which is obviously due to my lack of knowledge.
I'm actually using a debian etch with both gcc 4.1.2 and 3.4.6

Why are they some differents version of gcc not working the same way
when pointer calculations ?

let's take this simple example : 
        char array[1]

Disassembling this code is giving me the following information about how
much %esp register is substracted :

gcc 3.4.6 does calculate 4 bytes ( SUB $ 0x4, %esp )
gcc 4.1.2 does calculate 16 bytes to be substracted to %esp register
( SUB $ 0x10, %esp )

Why is there a difference between 3.4.6 and 4.1.2 gcc version ?
Despite my efforts understanding this, i would appreciate any links
regarding any document related to this.
Thanks in advance.
Regards,
Pierre



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]