kernel.bbclass: do_strip: allow recipes to strip the kernel
authorMichel Thebeau <michel.thebeau@windriver.com>
Wed, 10 Apr 2013 12:36:47 +0000 (08:36 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Apr 2013 08:03:21 +0000 (09:03 +0100)
commit22ac2234e3210a8703bb6a63b9843530e1d532b6
tree0257cf61f9c6386890969bcc3399b24f31a359f2
parentd02a59f55b646de171f2ad5b6dc83d447148efb8
kernel.bbclass: do_strip: allow recipes to strip the kernel

Allow recipes to specify sections to be stripped from the kernel output
using KERNEL_IMAGE_STRIP_EXTRA_SECTIONS.  For example:

KERNEL_IMAGE_STRIP_EXTRA_SECTIONS = ".comment .unwanted"

The kernel output is stripped in place.

Since the toolchain does not give indication when the specified sections
are absent, we read the sections first and make this report by issuing a
warning to the developer.

The toolchain by default strips the image with the -s option (even
when -s is not specified):
-s --strip-all       Remove all symbol and relocation information

For example, these sections are always removed:
.debug_aranges
.debug_info
.debug_abbrev
.debug_line
.debug_frame
.debug_str
.debug_loc
.debug_ranges
.symtab
.strtab

In addition to these, the sections listed in
KERNEL_IMAGE_STRIP_EXTRA_SECTIONS will also be removed.

Only stripping of vmlinux (elf) is supported at this time.  A warning
will be given if the image type is not vmlinux.

Stripping the image could also be done in the kernel, but that would
only work for linux-yocto based kernels, so it's not the route we
decided to go.

[YOCTO 3515]

(From OE-Core rev: 5f6d33b05b4e7883f2728ca812cb5386d1e36989)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Michel Thebeau <michel.thebeau@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/kernel.bbclass