"Strong" stack protection for GCC
"Strong" stack protection for GCC
Posted Feb 6, 2014 6:25 UTC (Thu) by eru (subscriber, #2753)Parent article: "Strong" stack protection for GCC
In addition, any function that uses local register variables will be protected.
I don't understand this condition. How would using some "register int i" make a stack problem more likely? It seems to me it would have no effect on the issue, and when optimizing, the compiler treats "register" just as a hint that may be ignored anyway. Tried already looking at the linked gcc mailing list entry, but there was no explanation either.
Posted Feb 6, 2014 11:40 UTC (Thu)
by sorokin (guest, #88478)
[Link] (1 responses)
"It was to catch unusual ways to get a reference to the frame address, with things like “register unsigned rsp __asm__(“rsp”);”, etc"
Posted Feb 6, 2014 12:52 UTC (Thu)
by nix (subscriber, #2304)
[Link]
"Strong" stack protection for GCC
Note that 'register variables' in this context are not variables declared with the obsolescent 'register' qualifier: they are registers that use the local register variable language extension.
"Strong" stack protection for GCC