diff --git a/documentation/ref-manual/tasks.rst b/documentation/ref-manual/tasks.rst index 85b26b9b50..516c9d30a4 100644 --- a/documentation/ref-manual/tasks.rst +++ b/documentation/ref-manual/tasks.rst @@ -784,11 +784,19 @@ any that exceed that value, but fail only if none of them fit. ``do_strip`` ------------ -If ``KERNEL_IMAGE_STRIP_EXTRA_SECTIONS`` is defined, this task strips +If :term:`KERNEL_IMAGE_STRIP_EXTRA_SECTIONS` is defined, this task strips the sections named in that variable from ``vmlinux``. This stripping is typically used to remove nonessential sections such as ``.comment`` sections from a size-sensitive configuration. +Common sections to strip: + +- ``.comment``: Holds compiler version strings and information + +- ``.note.*``: Extra notes often left by the compiler + +- ``.debug``: Debugging information + .. _ref-tasks-validate_branches: ``do_validate_branches`` diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index bb03213e18..b02ee8440a 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -5131,6 +5131,13 @@ system and gives an overview of their function and contents. See :term:`KERNEL_ARTIFACT_NAME` for additional information. + :term:`KERNEL_IMAGE_STRIP_EXTRA_SECTIONS` + If this variable is set, it should contain the sections to be + stripped from the ``vmlinux`` image by the kernel-related + :ref:`ref-tasks-strip` task. As a simple example:: + + KERNEL_IMAGE_STRIP_EXTRA_SECTIONS = ".comment .note.* .debug" + :term:`KERNEL_IMAGETYPE` The type of kernel to build for a device, usually set by the machine configuration files and defaults to "zImage". This variable is used