[lkml]   [2016]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v10 04/10] kexec_file: Add support for purgatory built as PIE.
On 11/10/16 at 01:27am, Thiago Jung Bauermann wrote:
> powerpc's has 12 relocation types when built as
> a relocatable object. To implement support for them requires
> arch_kexec_apply_relocations_add to duplicate a lot of code with
> module_64.c:apply_relocate_add.
> When built as a Position Independent Executable there are only 4
> relocation types in, so it becomes practical for the powerpc
> implementation of kexec_file to have its own relocation implementation.
> Also, the purgatory is an executable and not an intermediary output from
> the compiler so it makes sense conceptually that it is easier to build
> it as a PIE than as a partially linked object.
> Apart from the greatly reduced number of relocations, there are two
> differences between a relocatable object and a PIE:
> 1. __kexec_load_purgatory needs to use the program headers rather than the
> section headers to figure out how to load the binary.
> 2. Symbol values are absolute addresses instead of relative to the
> start of the section.
> This patch adds the support needed in generic code for the differences
> above and allows powerpc to load and relocate a position independent
> purgatory.


The kexec-tools machine_apply_elf_rel is pretty simple for ppc64, it is
not that complex. So could you look into simplify your kexec_file

kernel/kexec_file.c kexec_apply_relocations only do limited things
and some of the logic is in arch/x86, so move general code out of arch
code, then I guess the arch code will be simpler and then we probably
do not need this PIE stuff anymore.

BTW, __kexec_really_load_purgatory looks worse than
___kexec_load_purgatory ;)


 \ /
  Last update: 2016-11-20 03:46    [W:0.155 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site