On 09/27/2017 02:52 AM, Florian Weimer wrote:
On 09/27/2017 05:40 AM, Sandra Loosemore wrote:

+@emph{x86 implementation:} when @option{-fcf-protection} option is
+specified the compiler inserts an ENDBR instruction at function's
+prologue if the function's type does not have the @code{nocf_check}
+attribute and addresses to which indirect control-flow transfer can
+happen.  The instruction triggers the HW check if a control-flow
+transfer to the address of ENDBR instruction is valid.

Implementation details like this should be comments in the code, not
included in the user-facing documentation.

This is part of the ABI GCC implements, so it has to be documented
somewhere, and not just as part of the GCC source code.

CET is not properly described in the ABI supplement and I don't think
this will change, so detailed documentation in the GCC manual is very
much desirable.


Not if you're a documentation maintainer. :-( Generally speaking, user-facing manuals like the GCC manual should document user-visible GCC features, not internal implementation details. Especially the target-independent parts of the manual are not the right place to discuss target-specific code generation patterns or conventions that should be in the ABI supplement or some other non-GCC documentation.

I don't have so much objection to expanding the discussion of the target-specific -mcet option in the x86 options section, as long as the documentation is there because it helps people *use* the feature and not to explain things that are only interesting to compiler implementors.

-Sandra

Reply via email to