if the hypervisor has been built with EFI support (ie: multiboot2).
This allows to position the .reloc section correctly in the output
binary.
Note that for the ELF output format the .reloc section is moved before
.bss because the data it contains is read-only, so it belongs with the
other sections containing read-only data.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
} :text
#endif
#endif
+
+/*
+ * ELF builds are linked to a fixed virtual address, and in principle
+ * shouldn't have a .reloc section. However, due to the way EFI support is
+ * currently implemented, retaining the .reloc section is necessary.
+ */
+#if defined(XEN_BUILD_EFI) && !defined(EFI)
+ . = ALIGN(4);
+ DECL_SECTION(.reloc) {
+ *(.reloc)
+ } :text
+#endif
+
_erodata = .;
. = ALIGN(SECTION_ALIGN);