https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115014

--- Comment #6 from Martin Doucha <mdoucha at suse dot cz> ---
(In reply to Xi Ruoyao from comment #5)
> No, "Freestanding Environment" has a very specific meaning in the C
> standard.  If we must add this it'd be a separate -m{something} argument.

I would say that "execution without any benefit of an operating system" does
have some implication for what you can assume about the stack segment,
therefore properly prefixing EBP dereferences should be controlled by the
parameter.

Just to be clear, I'm not asking for support of arbitrary segment base
addresses, not even for the stack segment alone, because that would require
flawless tracking of segment association for every single pointer. What I'm
asking for is that in a freestanding environment, the stack segment should be
treated as a limited subset of the data segment. All stack addresses must be
accessible through the data segment but some data segment addresses may fall
outside the stack segment limit. This will allow embedded code to set up basic
protection against stack overflow without configuring full page translation.

Reply via email to