From 24e93a666145c39f85b1b6645fc90b220a118bd3 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Mon, 27 Nov 2023 14:25:21 +0000 Subject: [PATCH] "Address John Brawn's review comment on procedure push/pop operation This commit will be squashed before merging. --- sysvabi64/sysvabi64.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sysvabi64/sysvabi64.rst b/sysvabi64/sysvabi64.rst index 7cdf28a..61a1b9b 100644 --- a/sysvabi64/sysvabi64.rst +++ b/sysvabi64/sysvabi64.rst @@ -1653,10 +1653,12 @@ executable sections are compatible with the Guarded control stack (GCS) mechanism. Minimum requirements for setting this feature bit include: -* The number of ``procedure return address push operations`` and the - number of ``procedure return address pop operations`` are balanced - on program exit. This means that ``procedure return`` instructions - are only used for function returns, and not as an indirect branch. +* Each function that is called using a BL instruction (or other + instruction that is a GCS ``procedure return address push + operation``) returns using a RET instruction (or other instruction + that is a GCS ``procedure return address pop operation``). This + means that RET instructions are only used for function returns, and + never as an indirect branch. * Any functions used by the program that manipulate the stack such as ``setjmp`` and ``longjmp``, must be aware of GCS.