From nobody Sat May 18 03:46:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1647850930934950.1459199631996; Mon, 21 Mar 2022 01:22:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.292788.497188 (Exim 4.92) (envelope-from ) id 1nWDIH-0002Cr-Ka; Mon, 21 Mar 2022 08:21:37 +0000 Received: by outflank-mailman (output) from mailman id 292788.497188; Mon, 21 Mar 2022 08:21:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nWDIH-0002CQ-Ev; Mon, 21 Mar 2022 08:21:37 +0000 Received: by outflank-mailman (input) for mailman id 292788; Mon, 21 Mar 2022 08:21:36 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nWDIG-0002AF-Ja for xen-devel@lists.xenproject.org; Mon, 21 Mar 2022 08:21:36 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP id eb7c7ba3-a8ef-11ec-8fbc-03012f2f19d4; Mon, 21 Mar 2022 09:21:34 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C467C106F; Mon, 21 Mar 2022 01:21:33 -0700 (PDT) Received: from e129167.arm.com (unknown [10.57.72.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ED7A63F73B; Mon, 21 Mar 2022 01:21:31 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: eb7c7ba3-a8ef-11ec-8fbc-03012f2f19d4 From: Michal Orzel To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH 1/3] xen: Introduce a header to store common linker scripts content Date: Mon, 21 Mar 2022 09:21:12 +0100 Message-Id: <20220321082114.49953-2-michal.orzel@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220321082114.49953-1-michal.orzel@arm.com> References: <20220321082114.49953-1-michal.orzel@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1647850933171100004 Content-Type: text/plain; charset="utf-8" Both x86 and arm linker scripts share quite a lot of common content. It is difficult to keep syncing them up, thus introduce a new header in include/xen called xen_lds.h to store the internals mutual to all the linker scripts. Populate xen_lds.h with the first portion of the common sections. Some of them are not yet added/completed in arm linker script but they definitely should be. 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 --- xen/include/xen/xen_lds.h | 114 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 xen/include/xen/xen_lds.h diff --git a/xen/include/xen/xen_lds.h b/xen/include/xen/xen_lds.h new file mode 100644 index 0000000000..f1ca67ecfd --- /dev/null +++ b/xen/include/xen/xen_lds.h @@ -0,0 +1,114 @@ +#ifndef __XEN_LDS_H__ +#define __XEN_LDS_H__ + +/* + * Common macros to be used in architecture specific linker scripts. + */ + +/* Macros to declare debug sections. */ +#ifdef EFI +/* + * Use the NOLOAD directive, despite currently ignored by (at least) GNU ld + * for PE output, in order to record that we'd prefer these sections to not + * be loaded into memory. + */ +#define DECL_DEBUG(x, a) #x ALIGN(a) (NOLOAD) : { *(x) } +#define DECL_DEBUG2(x, y, a) #x ALIGN(a) (NOLOAD) : { *(x) *(y) } +#else +#define DECL_DEBUG(x, a) #x 0 : { *(x) } +#define DECL_DEBUG2(x, y, a) #x 0 : { *(x) *(y) } +#endif + +/* DWARF debug sections. */ +#define DWARF_DEBUG_SECTIONS \ + DECL_DEBUG(.debug_abbrev, 1) \ + DECL_DEBUG2(.debug_info, .gnu.linkonce.wi.*, 1) \ + DECL_DEBUG(.debug_types, 1) \ + DECL_DEBUG(.debug_str, 1) \ + DECL_DEBUG2(.debug_line, .debug_line.*, 1) \ + DECL_DEBUG(.debug_line_str, 1) \ + DECL_DEBUG(.debug_names, 4) \ + DECL_DEBUG(.debug_frame, 4) \ + DECL_DEBUG(.debug_loc, 1) \ + DECL_DEBUG(.debug_loclists, 4) \ + DECL_DEBUG(.debug_macinfo, 1) \ + DECL_DEBUG(.debug_macro, 1) \ + DECL_DEBUG(.debug_ranges, 8) \ + DECL_DEBUG(.debug_rnglists, 4) \ + DECL_DEBUG(.debug_addr, 8) \ + DECL_DEBUG(.debug_aranges, 1) \ + DECL_DEBUG(.debug_pubnames, 1) \ + DECL_DEBUG(.debug_pubtypes, 1) + +/* + * Stabs debug sections. + * + * LLVM ld also wants .symtab, .strtab, and .shstrtab placed. These look to + * be benign to GNU ld, so we can have them here unconditionally. + */ +#define STABS_DEBUG_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) } \ + .symtab 0 : { *(.symtab) } \ + .strtab 0 : { *(.strtab) } \ + .shstrtab 0 : { *(.shstrtab) } + +#ifdef EFI +#define DISCARD_EFI_SECTIONS \ + *(.comment) \ + *(.comment.*) \ + *(.note.*) +#else +#define DISCARD_EFI_SECTIONS +#endif + +/* Sections to be discarded. */ +#define DISCARD_SECTIONS \ + /DISCARD/ : { \ + *(.text.exit) \ + *(.exit.text) \ + *(.exit.data) \ + *(.exitcall.exit) \ + *(.discard) \ + *(.discard.*) \ + *(.eh_frame) \ + *(.dtors) \ + *(.dtors.*) \ + *(.fini_array) \ + *(.fini_array.*) \ + DISCARD_EFI_SECTIONS \ + } + +#define CTORS_SECTION \ + . =3D ALIGN(8); \ + __ctors_start =3D .; \ + *(SORT_BY_INIT_PRIORITY(.init_array.*)) \ + *(SORT_BY_INIT_PRIORITY(.ctors.*)) \ + *(.init_array) \ + *(.ctors) \ + __ctors_end =3D .; + +#define VPCI_SECTION \ + . =3D ALIGN(POINTER_ALIGN); \ + __start_vpci_array =3D .; \ + *(SORT(.data.vpci.*)) \ + __end_vpci_array =3D .; + +#define HYPFS_SECTION \ + . =3D ALIGN(8); \ + __paramhypfs_start =3D .; \ + *(.data.paramhypfs) \ + __paramhypfs_end =3D .; + +#define LOCK_PROFILE_SECTION \ + . =3D ALIGN(POINTER_ALIGN); \ + __lock_profile_start =3D .; \ + *(.lockprofile.data) \ + __lock_profile_end =3D .; + +#endif /* __XEN_LDS_H__ */ --=20 2.25.1 From nobody Sat May 18 03:46:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1647850928882728.7545252497029; Mon, 21 Mar 2022 01:22:08 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.292789.497205 (Exim 4.92) (envelope-from ) id 1nWDIK-0002gF-QL; Mon, 21 Mar 2022 08:21:40 +0000 Received: by outflank-mailman (output) from mailman id 292789.497205; Mon, 21 Mar 2022 08:21:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nWDIK-0002g8-M7; Mon, 21 Mar 2022 08:21:40 +0000 Received: by outflank-mailman (input) for mailman id 292789; Mon, 21 Mar 2022 08:21:39 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nWDIJ-0002eF-AJ for xen-devel@lists.xenproject.org; Mon, 21 Mar 2022 08:21:39 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id ec946ea9-a8ef-11ec-a405-831a346695d4; Mon, 21 Mar 2022 09:21:36 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9E917113E; Mon, 21 Mar 2022 01:21:35 -0700 (PDT) Received: from e129167.arm.com (unknown [10.57.72.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 36B1C3F73B; Mon, 21 Mar 2022 01:21:34 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ec946ea9-a8ef-11ec-a405-831a346695d4 From: Michal Orzel To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH 2/3] xen/x86: Make use of helpers defined in xen_lds.h Date: Mon, 21 Mar 2022 09:21:13 +0100 Message-Id: <20220321082114.49953-3-michal.orzel@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220321082114.49953-1-michal.orzel@arm.com> References: <20220321082114.49953-1-michal.orzel@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1647850931436100001 Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Michal Orzel --- xen/arch/x86/xen.lds.S | 86 ++++-------------------------------------- 1 file changed, 8 insertions(+), 78 deletions(-) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index d33e295320..e82a148e08 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -2,6 +2,7 @@ /* Modified for i386/x86-64 Xen by Keir Fraser */ =20 #include +#include #include #undef ENTRY #undef ALIGN @@ -12,13 +13,6 @@ #undef __XEN_VIRT_START #define __XEN_VIRT_START __image_base__ #define DECL_SECTION(x) x : -/* - * Use the NOLOAD directive, despite currently ignored by (at least) GNU ld - * for PE output, in order to record that we'd prefer these sections to not - * be loaded into memory. - */ -#define DECL_DEBUG(x, a) #x ALIGN(a) (NOLOAD) : { *(x) } -#define DECL_DEBUG2(x, y, a) #x ALIGN(a) (NOLOAD) : { *(x) *(y) } =20 ENTRY(efi_start) =20 @@ -26,8 +20,6 @@ ENTRY(efi_start) =20 #define FORMAT "elf64-x86-64" #define DECL_SECTION(x) #x : AT(ADDR(#x) - __XEN_VIRT_START) -#define DECL_DEBUG(x, a) #x 0 : { *(x) } -#define DECL_DEBUG2(x, y, a) #x 0 : { *(x) *(y) } =20 ENTRY(start_pa) =20 @@ -159,10 +151,7 @@ SECTIONS __note_gnu_build_id_end =3D .; #endif #ifdef CONFIG_HAS_VPCI - . =3D ALIGN(POINTER_ALIGN); - __start_vpci_array =3D .; - *(SORT(.data.vpci.*)) - __end_vpci_array =3D .; + VPCI_SECTION #endif } PHDR(text) =20 @@ -278,19 +267,10 @@ SECTIONS __alt_instructions_end =3D .; =20 #ifdef CONFIG_DEBUG_LOCK_PROFILE - . =3D ALIGN(POINTER_ALIGN); - __lock_profile_start =3D .; - *(.lockprofile.data) - __lock_profile_end =3D .; + LOCK_PROFILE_SECTION #endif =20 - . =3D ALIGN(8); - __ctors_start =3D .; - *(SORT_BY_INIT_PRIORITY(.init_array.*)) - *(SORT_BY_INIT_PRIORITY(.ctors.*)) - *(.init_array) - *(.ctors) - __ctors_end =3D .; + CTORS_SECTION } PHDR(text) =20 #ifndef EFI @@ -335,10 +315,7 @@ SECTIONS __end_schedulers_array =3D .; =20 #ifdef CONFIG_HYPFS - . =3D ALIGN(8); - __paramhypfs_start =3D .; - *(.data.paramhypfs) - __paramhypfs_end =3D .; + HYPFS_SECTION #endif } PHDR(text) =20 @@ -395,24 +372,7 @@ SECTIONS * _end here, so if these sections get loaded they'll be discarded at ru= ntime * anyway. */ - DECL_DEBUG(.debug_abbrev, 1) - DECL_DEBUG2(.debug_info, .gnu.linkonce.wi.*, 1) - DECL_DEBUG(.debug_types, 1) - DECL_DEBUG(.debug_str, 1) - DECL_DEBUG2(.debug_line, .debug_line.*, 1) - DECL_DEBUG(.debug_line_str, 1) - DECL_DEBUG(.debug_names, 4) - DECL_DEBUG(.debug_frame, 4) - DECL_DEBUG(.debug_loc, 1) - DECL_DEBUG(.debug_loclists, 4) - DECL_DEBUG(.debug_macinfo, 1) - DECL_DEBUG(.debug_macro, 1) - DECL_DEBUG(.debug_ranges, 8) - DECL_DEBUG(.debug_rnglists, 4) - DECL_DEBUG(.debug_addr, 8) - DECL_DEBUG(.debug_aranges, 1) - DECL_DEBUG(.debug_pubnames, 1) - DECL_DEBUG(.debug_pubtypes, 1) + DWARF_DEBUG_SECTIONS =20 #ifdef EFI /* Trick the linker into setting the image size to no less than 16Mb. */ @@ -427,41 +387,11 @@ SECTIONS #endif =20 /* Sections to be discarded */ - /DISCARD/ : { - *(.text.exit) - *(.exit.text) - *(.exit.data) - *(.exitcall.exit) - *(.discard) - *(.discard.*) - *(.eh_frame) - *(.dtors) - *(.dtors.*) - *(.fini_array) - *(.fini_array.*) -#ifdef EFI - *(.comment) - *(.comment.*) - *(.note.*) -#endif - } + DISCARD_SECTIONS =20 #ifndef EFI /* 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) } - /* - * LLVM ld also wants .symtab, .strtab, and .shstrtab placed. These look= to - * be benign to GNU ld, so we can have them here unconditionally. - */ - .symtab 0 : { *(.symtab) } - .strtab 0 : { *(.strtab) } - .shstrtab 0 : { *(.shstrtab) } + STABS_DEBUG_SECTIONS #endif } =20 --=20 2.25.1 From nobody Sat May 18 03:46:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1647850926358566.2955240279935; Mon, 21 Mar 2022 01:22:06 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.292790.497210 (Exim 4.92) (envelope-from ) id 1nWDIL-0002iM-5g; Mon, 21 Mar 2022 08:21:41 +0000 Received: by outflank-mailman (output) from mailman id 292790.497210; Mon, 21 Mar 2022 08:21:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nWDIK-0002i7-Uh; Mon, 21 Mar 2022 08:21:40 +0000 Received: by outflank-mailman (input) for mailman id 292790; Mon, 21 Mar 2022 08:21:39 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nWDIJ-0002eF-Rq for xen-devel@lists.xenproject.org; Mon, 21 Mar 2022 08:21:39 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-sth1.inumbo.com (Halon) with ESMTP id edb003f3-a8ef-11ec-a405-831a346695d4; Mon, 21 Mar 2022 09:21:38 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A92391424; Mon, 21 Mar 2022 01:21:37 -0700 (PDT) Received: from e129167.arm.com (unknown [10.57.72.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 05BDC3F73B; Mon, 21 Mar 2022 01:21:35 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: edb003f3-a8ef-11ec-a405-831a346695d4 From: Michal Orzel To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH 3/3] xen/arm: Make use of helpers defined in xen_lds.h Date: Mon, 21 Mar 2022 09:21:14 +0100 Message-Id: <20220321082114.49953-4-michal.orzel@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220321082114.49953-1-michal.orzel@arm.com> References: <20220321082114.49953-1-michal.orzel@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1647850934486100007 Content-Type: text/plain; charset="utf-8" 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 --- xen/arch/arm/xen.lds.S | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 7921d8fa28..9e1832e94c 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -3,6 +3,7 @@ /* Modified for ARM Xen by Ian Campbell */ =20 #include +#include #include #undef ENTRY #undef ALIGN @@ -68,10 +69,7 @@ SECTIONS __proc_info_end =3D .; =20 #ifdef CONFIG_HAS_VPCI - . =3D ALIGN(POINTER_ALIGN); - __start_vpci_array =3D .; - *(SORT(.data.vpci.*)) - __end_vpci_array =3D .; + VPCI_SECTION #endif } :text =20 @@ -109,10 +107,7 @@ SECTIONS __end_schedulers_array =3D .; =20 #ifdef CONFIG_HYPFS - . =3D ALIGN(8); - __paramhypfs_start =3D .; - *(.data.paramhypfs) - __paramhypfs_end =3D .; + HYPFS_SECTION #endif =20 *(.data .data.*) @@ -178,10 +173,7 @@ SECTIONS __alt_instructions_end =3D .; =20 #ifdef CONFIG_DEBUG_LOCK_PROFILE - . =3D ALIGN(POINTER_ALIGN); - __lock_profile_start =3D .; - *(.lockprofile.data) - __lock_profile_end =3D .; + LOCK_PROFILE_SECTION #endif =20 *(.init.data) @@ -221,22 +213,17 @@ SECTIONS /* Section for the device tree blob (if any). */ .dtb : { *(.dtb) } :text =20 + /* + * 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 =20 /* 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 } =20 /* --=20 2.25.1