How to turn off gcc compiler optimization to enable buffer overflow
问题 I\'m working on a homework problem that requires disabling compiler optimization protection for it to work. I\'m using gcc 4.4.1 on ubuntu linux, but can\'t figure out which flags are are the right ones. I realize it\'s architecture dependant - my machine runs w/ 32-bit Intel processor. Thanks. 回答1: That's a good problem. In order to solve that problem you will also have to disable ASLR otherwise the address of g() will be unpredictable. Disable ASLR: sudo bash -c 'echo 0 > /proc/sys/kernel