diff mbox series

profile-manual: Document the PACKAGE_KEEP_SECTIONS variable.

Message ID 20250204102847.27201-1-othacehe@gnu.org
State Under Review
Headers show
Series profile-manual: Document the PACKAGE_KEEP_SECTIONS variable. | expand

Commit Message

Mathieu Othacehe Feb. 4, 2025, 10:28 a.m. UTC
Document the 'PACKAGE_KEEP_SECTIONS' variable that can be used to keep some
specific ELF sections while stripping binaries and libraries.

That one can then be used to keep the .debug_frame section around for
example, this way:

PACKAGE_KEEP_SECTIONS = ".debug_frame"

By using libunwind + minidebuginfo, that provides a way for users to get
debug_frame based backtraces on target.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
---
 documentation/profile-manual/intro.rst | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Antonin Godard Feb. 4, 2025, 2:32 p.m. UTC | #1
Hi Mathieu,

On Tue Feb 4, 2025 at 11:28 AM CET, Mathieu Othacehe via lists.yoctoproject.org wrote:
> Document the 'PACKAGE_KEEP_SECTIONS' variable that can be used to keep some
> specific ELF sections while stripping binaries and libraries.
>
> That one can then be used to keep the .debug_frame section around for
> example, this way:
>
> PACKAGE_KEEP_SECTIONS = ".debug_frame"
>
> By using libunwind + minidebuginfo, that provides a way for users to get
> debug_frame based backtraces on target.
>
> Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
> ---
>  documentation/profile-manual/intro.rst | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/documentation/profile-manual/intro.rst b/documentation/profile-manual/intro.rst
> index 317912552..a7243c1ca 100644
> --- a/documentation/profile-manual/intro.rst
> +++ b/documentation/profile-manual/intro.rst
> @@ -75,3 +75,9 @@ Additionally, in order to generate the right type of debug info, we also need to
>  set :term:`PACKAGE_DEBUG_SPLIT_STYLE` in the ``local.conf`` file::
>  
>     PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'
> +
> +When you are building a stripped image, you can also keep some specific ELF
> +sections in the image by setting :term:`PACKAGE_KEEP_SECTIONS` in the

Thanks for this patch. But this addition produces the following error:

  .../documentation/profile-manual/intro.rst:79:term not in glossary: 'PACKAGE_KEEP_SECTIONS' [ref.term]

because PACKAGE_KEEP_SECTIONS is not documented in ref-manual/variables.rst.
Hence, you cannot make a reference (with :term:) to it.

Could you add documentation for this variable there?

Antonin
Mathieu Othacehe Feb. 5, 2025, 3:55 p.m. UTC | #2
Hello Antonin,

> because PACKAGE_KEEP_SECTIONS is not documented in ref-manual/variables.rst.
> Hence, you cannot make a reference (with :term:) to it.
>
> Could you add documentation for this variable there?

Thanks for having a look! I just sent a v2 that is fixing this issue and
also proposing a more complete picture on the use of the
PACKAGE_KEEP_SECTIONS variable.

That was suggested by Alexander here:
https://lists.openembedded.org/g/openembedded-core/message/210819

Thanks,

Mathieu
diff mbox series

Patch

diff --git a/documentation/profile-manual/intro.rst b/documentation/profile-manual/intro.rst
index 317912552..a7243c1ca 100644
--- a/documentation/profile-manual/intro.rst
+++ b/documentation/profile-manual/intro.rst
@@ -75,3 +75,9 @@  Additionally, in order to generate the right type of debug info, we also need to
 set :term:`PACKAGE_DEBUG_SPLIT_STYLE` in the ``local.conf`` file::
 
    PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'
+
+When you are building a stripped image, you can also keep some specific ELF
+sections in the image by setting :term:`PACKAGE_KEEP_SECTIONS` in the
+``local.conf`` file::
+
+   PACKAGE_KEEP_SECTIONS = ".debug_frame"