efi/libstub: Preserve .debug sections after absolute relocation check
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 31 Jan 2017 13:21:42 +0000 (13:21 +0000)
committerIngo Molnar <mingo@kernel.org>
Wed, 1 Feb 2017 07:45:47 +0000 (08:45 +0100)
commit696204faa6e8a318320ebb49d9fa69bc8275644d
tree3468f0ef98987886ee63fc0a445fabb0d7ea2e9f
parent22c091d02a5422d2825a4fb1af71e5a62f9e4d0f
efi/libstub: Preserve .debug sections after absolute relocation check

The build commands for the ARM and arm64 EFI stubs strip the .debug
sections and other sections that may legally contain absolute relocations,
in order to inspect the remaining sections for the presence of such
relocations.

This leaves us without debugging symbols in the stub for no good reason,
considering that these sections are omitted from the kernel binary anyway,
and that these relocations are thus only consumed by users of the ELF
binary, such as debuggers.

So move to 'strip' for performing the relocation check, and if it succeeds,
invoke objcopy as before, but leaving the .debug sections in place. Note
that these sections may refer to ksymtab/kcrctab contents, so leave those
in place as well.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/1485868902-20401-11-git-send-email-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/firmware/efi/libstub/Makefile