3 ms·
Nope :) But http://dbp-consulting.com/tutorials/debugging/linuxProgramStartup.html http://dbp-consulting.com/tutorials/debugging/linuxProgramSt... does sugges
by pja 7y ago
Nope :)
But http://dbp-consulting.com/tutorials/debugging/linuxProgramStartup.html http://dbp-consulting.com/tutorials/debugging/linuxProgramSt...
does suggest zeroing the top-most frame (%ebp) and making sure the stack is 16-byte aligned might also be worth doing. (Possibly it’s already 16-byte aligned already because you jmp to main instead of calling it though?)
- ngnk 7y agothat's a good read, thanks. afaik zeroing %rbp here plays no role other than to assist debuggers. i'm not sure if alignment makes any measurable difference. if it does, it'll be worth doing. i jmp to main() because i wrote it and i know it never returns. it exit()-s.
- saagarjha 7y ago> afaik zeroing %rbp here plays no role other than to assist debuggers. Yep, it marks function frame boundaries. If you don't particularly care, you may want to consider compiling with -fomit-frame-pointer and the compiler will return this register back to the set of general purpose ones for it to use. > i'm not sure if alignment makes any measurable difference. if it does, it'll be worth doing. It will if you end up emitting any SSE instructions, because they will cause loads and stores that need to be aligned.