Yes, I looked at their patch for gcc 2.7.2.2 and took the general
structure from that patch. However, the backend for egcs is a bit
different (it uses RTL instead of more or less just printing out the
epilogue) so the StackGuard patch doesn't work on that compiler.
StackGuard has a bit more overhead. Basically it has 7 instructions
per function call plus another 21 instructions and a string (the
function name). This makes it possible for StackGuard to print the
name of the offending function. I want something very light, so I was
planning on having just one rescue function that goes something like:
void stack_overrun_abort(void) {
printf("Stack overrun detected, addr=%p\n",
__builtin_return_address(0));
abort();
}
StackGuard's overhead shows in the performance table on the web-site.
It looks like they have about 5-30% overhead, compared to what I
measured which was around 0.5 to 1.5% overhead. I'm not sure why this
is, considering that the technique is similar.
But anyway, neither my patch or StackGuard is the right patch since
they live in the architecture-dependent parts of gcc. A patch like
this should really be architecture independent.
astor
-- Alexander Kjeldaas, Guardian Networks AS, Trondheim, Norway http://www.guardian.no/
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html