libelf: allow having HYPERCALL_PAGE entry before VIRT_BASE in __xen_guest section
authorGregory Herrero <gregory.herrero@oracle.com>
Mon, 4 Dec 2017 10:01:48 +0000 (11:01 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 4 Dec 2017 10:01:48 +0000 (11:01 +0100)
commitf2613bd7f203a79abde270d9fa54b4add8dd911b
tree362650bbb92d8917b4862146e254b0248aa0a6a8
parentcf9ad1f3dc3bbaa19a626106890185d81be2fdfc
libelf: allow having HYPERCALL_PAGE entry before VIRT_BASE in __xen_guest section

When filling __xen_guest section of a guest, user may define
HYPERCALL_PAGE earlier than VIRT_BASE in the section leading to an
incorrect hypercall page address since an undefined virt_base could be
used to compute hypercall page address.
If there is no VIRT_BASE entry in __xen_guest section, default value of
0 is used for virt_base. Thus, setting hypercall page address to
HYPERCALL_PAGE value is correct in this case too.

Signed-off-by: Gregory Herrero <gregory.herrero@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/libelf/libelf-dominfo.c