x86/EFI: keep debug info in xen.efi
authorJan Beulich <jbeulich@suse.com>
Mon, 26 Apr 2021 08:25:10 +0000 (10:25 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 26 Apr 2021 08:25:10 +0000 (10:25 +0200)
commit1df03bc5958e3d8d1f2669426cd5b1353690505b
tree5c850f083fb8a929d7fd42e472000217e4afc314
parent940f22732ad1f018c87c8decf88b0efeaa3a2b0e
x86/EFI: keep debug info in xen.efi

... provided the linker supports it (which it does as of commit
2dfa8341e079 ["ELF DWARF in PE output"]).

Without mentioning debugging sections, the linker would put them at
VA 0, thus making them unreachable by 32-bit (relative or absolute)
relocations. If relocations were resolvable (or absent) the resulting
binary would have invalid section RVAs (0 - __image_base__, truncated to
32 bits). Mentioning debugging sections without specifying an address
will result in the linker putting them all on the same RVA. A loader is,
afaict, free to reject loading such an image, as sections shouldn't
overlap. (The above describes GNU ld 2.36 behavior, which - if deemed
buggy - could change.)

Make sure our up-to-16Mb padding doesn't unnecessarily further extend
the image.

Take the opportunity and also switch to using $(call ld-option,...).

Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/Makefile
xen/arch/x86/xen.lds.S