xen: Populate xen.lds.h and make use of its macros
authorMichal Orzel <michal.orzel@arm.com>
Mon, 11 Apr 2022 07:03:00 +0000 (09:03 +0200)
committerJulien Grall <jgrall@amazon.com>
Mon, 11 Apr 2022 10:26:23 +0000 (11:26 +0100)
commit5e3a6606be4ac58786ded130e73ae82f572c27fb
tree45e418a71a5febad5e92657c826ee26dc01d3379
parent6af59c45a44a013c42e6e9d45d73c7edadb4e531
xen: Populate xen.lds.h and make use of its macros

Populate header file xen.lds.h with the first portion of macros storing
constructs common to x86 and arm linker scripts. Replace the original
constructs with these helpers.

No functional improvements to x86 linker script.

Making use of common macros improves arm linker script with:
- explicit list of debug sections that otherwise are seen as "orphans"
  by the linker. This will allow to fix issues after enabling linker
  option --orphan-handling one day,
- extended list of discarded section to include: .discard, destructors
  related sections, .fini_array which can reference .text.exit,
- sections not related to debugging that are placed by ld.lld. Even
  though we do not support linking with LLD on Arm, these sections do
  not cause problem to GNU ld,

As we are replacing hardcoded boundary specified as an argument to ALIGN
function with POINTER_ALIGN, this changes the alignment in HYPFS_PARAM
construct for arm32 from 8 to 4. It is fine as there are no 64bit values
used in struct param_hypfs.

Please note that this patch does not aim to perform the full sync up
between the linker scripts. It creates a base for further work.

Signed-off-by: Michal Orzel <michal.orzel@arm.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/xen.lds.S
xen/arch/x86/xen.lds.S
xen/include/xen/xen.lds.h