[PATCH] Documentation: asm-annotation: clarify .L local symbol names

From: Nick Desaulniers
Date: Wed Jan 13 2021 - 12:47:06 EST


Use more precise language and move the text to a region in the docs to
show that this constraint is not just for SYM_CODE_START*.

Suggested-by: Mark Brown <broonie@xxxxxxxxxx>
Suggested-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
Signed-off-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
---
Documentation/asm-annotations.rst | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/Documentation/asm-annotations.rst b/Documentation/asm-annotations.rst
index e711ff98102a..76424e0431f4 100644
--- a/Documentation/asm-annotations.rst
+++ b/Documentation/asm-annotations.rst
@@ -100,6 +100,11 @@ Instruction Macros
~~~~~~~~~~~~~~~~~~
This section covers ``SYM_FUNC_*`` and ``SYM_CODE_*`` enumerated above.

+``objtool`` requires that all code must be contained in an ELF symbol. Symbol
+names that have a ``.L`` prefix do not emit symbol table entries. ``.L``
+prefixed symbols can be used within a code region, but should be avoided for
+denoting a range of code via ``SYM_*_START/END`` annotations.
+
* ``SYM_FUNC_START`` and ``SYM_FUNC_START_LOCAL`` are supposed to be **the
most frequent markings**. They are used for functions with standard calling
conventions -- global and local. Like in C, they both align the functions to
@@ -153,15 +158,6 @@ This section covers ``SYM_FUNC_*`` and ``SYM_CODE_*`` enumerated above.
To some extent, this category corresponds to deprecated ``ENTRY`` and
``END``. Except ``END`` had several other meanings too.

- Developers should avoid using local symbol names that are prefixed with
- ``.L``, as this has special meaning for the assembler; a symbol entry will
- not be emitted into the symbol table. This can prevent ``objtool`` from
- generating correct unwind info. Symbols with STB_LOCAL binding may still be
- used, and ``.L`` prefixed local symbol names are still generally useable
- within a function, but ``.L`` prefixed local symbol names should not be used
- to denote the beginning or end of code regions via
- ``SYM_CODE_START_LOCAL``/``SYM_CODE_END``.
-
* ``SYM_INNER_LABEL*`` is used to denote a label inside some
``SYM_{CODE,FUNC}_START`` and ``SYM_{CODE,FUNC}_END``. They are very similar
to C labels, except they can be made global. An example of use::
--
2.30.0.284.gd98b1dd5eaa7-goog