Skip to content
  • Marc Zyngier's avatar
    Makefile: avoid using linker for embedding guest_init binaries · 93dd1288
    Marc Zyngier authored
    At the moment we use the linker to convert the compiled guest_init binary
    into an ELF object file, so it can be embedded into the kvmtool binary
    and accessed later easily at runtime.
    Now this has two problems:
    1) This approach does not work for MIPS, because the linker defaults to
    a different ABI than the compiler, so the GCC generated object files are
    not compatible with this converted binary.
    2) The size symbol as it's used at the moment in the object file is subject
    to relocation, which leads to wrong results when using PIE builds, which is
    now the default for some distributions.
    Fix those two problems at once by using some shell tools to create a C
    source file containing the guest_init binary, which then gets compiled into
    a proper object file with the normal compiler and its flags.
    The size of the guest init binaries is now simply a variable, which does
    not get mangled at all.
    Signed-off-by: default avatarMarc Zyngier <>