(fwd) K6 Issues
Joern Rennecke
amylaar@cygnus.co.uk
Mon Sep 1 09:12:00 GMT 1997
> > We did so. AMD's Tech support _and_ one of our Linux customers report
> > that gcc and g++ use self-modifying code to optimize some functions, and
> > this is a definate no-no, according to the erratum.
>
> The only self-modifying code I am aware of is trampolines. Do you know
> any more about this?
I could get to the web site with the patch over the weekend. It turns out
that this is a patch to make the stack in general unexecutable, and add
some ways to make it executable egain, including an option to detect gcc's
trampolines.
I can see how this can 'fix' the bug for the first trampoline a program
executes, since there will be exception handling to make the stack executable,
which will separate the writing of the trampoline from its actual execution;
however, this is a lot mor processing than seems necessary to merely avoid
the hardware bug for this first trampoline, and for all subsequent
trampolines, the stack will already be writable, hence the bug could still
manifest itself.
IMHO a better workaround for the hardware bug for trampolines is to add
some extra (conditional) code to TRAMPOLINE_TEMPLATE in i386.h
More information about the Gcc
mailing list