@@ -3,6 +3,7 @@
/* Modified for ARM Xen by Ian Campbell */
#include <xen/cache.h>
+#include <xen/xen_lds.h>
#include <asm/page.h>
#undef ENTRY
#undef ALIGN
@@ -68,10 +69,7 @@ SECTIONS
__proc_info_end = .;
#ifdef CONFIG_HAS_VPCI
- . = ALIGN(POINTER_ALIGN);
- __start_vpci_array = .;
- *(SORT(.data.vpci.*))
- __end_vpci_array = .;
+ VPCI_SECTION
#endif
} :text
@@ -109,10 +107,7 @@ SECTIONS
__end_schedulers_array = .;
#ifdef CONFIG_HYPFS
- . = ALIGN(8);
- __paramhypfs_start = .;
- *(.data.paramhypfs)
- __paramhypfs_end = .;
+ HYPFS_SECTION
#endif
*(.data .data.*)
@@ -178,10 +173,7 @@ SECTIONS
__alt_instructions_end = .;
#ifdef CONFIG_DEBUG_LOCK_PROFILE
- . = ALIGN(POINTER_ALIGN);
- __lock_profile_start = .;
- *(.lockprofile.data)
- __lock_profile_end = .;
+ LOCK_PROFILE_SECTION
#endif
*(.init.data)
@@ -221,22 +213,17 @@ SECTIONS
/* Section for the device tree blob (if any). */
.dtb : { *(.dtb) } :text
+ /*
+ * Explicitly list debug sections, to avoid these sections being viewed as
+ * "orphan" by the linker.
+ */
+ DWARF_DEBUG_SECTIONS
+
/* Sections to be discarded */
- /DISCARD/ : {
- *(.exit.text)
- *(.exit.data)
- *(.exitcall.exit)
- *(.eh_frame)
- }
+ DISCARD_SECTIONS
/* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
+ STABS_DEBUG_SECTIONS
}
/*
Header file xen_lds.h defines common macros to be used in arch specific linker scripts. Include this header and make use of its helpers. Making use of common helpers defined based on x86 linker script 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 -re-arrangement of ordering/sorting in constructors section to match the default linker script -extended list of discarded section to include: .discard, desctructors related sections, .fini_array which can reference .text.exit -extended list of stabs section to include sections placed by ld.lld. Even though Xen on arm compilation with LLVM support is not ready yet, these sections do not cause problem to GNU ld Signed-off-by: Michal Orzel <michal.orzel@arm.com> --- xen/arch/arm/xen.lds.S | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-)