[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EFI executable corruption when live patching is turned off



On 05.08.2020 20:19, Trammell Hudson wrote:
> When building xen from head with almost any combination of options, the 
> resulting xen.efi seems properly formed. When CONFIG_LIVEPATCH is turned off, 
> however, the resulting xen.efi is corrupted in some way and binutils no 
> longer wants to work with it:
> 
> ~/build/xen-clean/xen$ git rev-parse HEAD
> 81fd0d3ca4b2cd309403c6e8da662c325dd35750
> ~/build/xen-clean/xen$ diff .config.orig .config
> 71,72c71
> < CONFIG_LIVEPATCH=y
> < CONFIG_FAST_SYMBOL_LOOKUP=y
> ---
>> # CONFIG_LIVEPATCH is not set
> 105a105
>> # CONFIG_COVERAGE is not set
> ~/build/xen-clean/xen$ objcopy xen-orig.efi test.efi
> ~/build/xen-clean/xen$ objcopy xen.efi test.efi
> objcopy: test.efi: Data Directory size (1c) exceeds space left in section (18)
> objcopy: test.efi: error copying private BFD data: file in wrong format
> ~/build/xen-clean/xen$ objcopy --version | head -1
> GNU objcopy (GNU Binutils for Ubuntu) 2.34
> 
> 
> I spent most of today unsuccessfully trying to figure out what was different 
> between the builds (on multiple build host OS with different binutils), so 
> I'm hoping that perhaps someone else has seen this problem.

I've tried to find a sensible way to fix this in objcopy, but could
come up with only a somewhat hackish variant:
https://sourceware.org/pipermail/binutils/2020-August/112746.html
Let's see what the maintainers there think, or if they have better
suggestions (or are willing to address this themselves). The issue
is pretty certainly not tied to LIVEPATCH, but rather to how much
padding space there is at the end of the .rodata section.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.