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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |ebotcazou at gcc dot gnu.org
   Last reconfirmed|                            |2021-03-09

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> The -fstack-limit option of gcc is of no use in systems using RTOS because the
> stack limit is different for each task.

I don't think that's true, because you can either set a per-thread value in the
limit register or a per-thread value for the appropriate symbol; the latter was
done with VxWorks 6 for example, although it might not work with VxWorks 7.

> I propose an additional option for implementing -fstack-check that does not
> require memory paging hardware. This option would have the compiler call a
> stack-check function near the start of the code generated for each function.
> A single parameter would be passed to that function, which would be the
> lowest (if the stack grows downwards) stack address used in the remainder of
> the function. Similarly, when allocating objects of dynamic size on the
> stack, the stack check function would be called.

Contributions are always welcome!

Reply via email to