]> xenbits.xensource.com Git - xen.git/commit
x86: properly calculate xen ELF end of image address
authorDaniel Kiper <daniel.kiper@oracle.com>
Wed, 7 Dec 2016 13:37:34 +0000 (14:37 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 7 Dec 2016 13:37:34 +0000 (14:37 +0100)
commit7a95e0a2c572fbbc827722c6f61a12cc4af3ef8f
tree08a5eba5b8eed7d7518d4e15ed2de7a2ac48e150
parenta31dc93b20bd7e351921c58fd07b3b16e2c8e83e
x86: properly calculate xen ELF end of image address

This patch is prereq for "efi: build xen.gz with EFI code" patch which adds,
among others, xen/arch/x86/efi/relocs-dummy.S to xen.gz output. Below there
is a description why it is needed.

Currently xen ELF end of image address is calculated using first line from
"nm -nr xen/xen-syms" output. However, potentially it may contain symbol
address not related to the end of image in any way. It can happen if a symbol
is introduced with address larger than _end symbol address. Such situation
encountered when I linked xen ELF binary with xen/arch/x86/efi/relocs-dummy.S.
Then first line from "nm -nr xen/xen-syms" contained "ffff82d0c0000000 A ALT_START"
and xen ELF image memory size was silently set to 1023 MiB. This issue happened
because there is no check which symbol address is used to calculate end of
image address. So, let's fix it and take ELF end of image address by reading
__2M_rwdata_end symbol address from nm output. This way xen ELF image build
process is not prone to changes in order of nm output.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/Makefile