linker: cxx: Include .gcc_except_table sections
Include .gcc_except_table (sub-)sections in linker files to support C++ with exceptions enabled. If these sections are not mapped warnings will be generated for orphaned sections at link time. Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
This commit is contained in:
parent
70fb574a6e
commit
ff36fc7d67
|
@ -132,6 +132,8 @@ SECTIONS {
|
||||||
|
|
||||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||||
|
|
||||||
|
#include <linker/cplusplus-rom.ld>
|
||||||
|
|
||||||
_image_rodata_end = .;
|
_image_rodata_end = .;
|
||||||
MPU_ALIGN(_image_rodata_end - _image_rom_start);
|
MPU_ALIGN(_image_rodata_end - _image_rom_start);
|
||||||
_image_rom_end = .;
|
_image_rom_end = .;
|
||||||
|
@ -227,6 +229,7 @@ SECTIONS {
|
||||||
|
|
||||||
#include <linker/common-ram.ld>
|
#include <linker/common-ram.ld>
|
||||||
#include <linker/kobject.ld>
|
#include <linker/kobject.ld>
|
||||||
|
#include <linker/cplusplus-ram.ld>
|
||||||
|
|
||||||
__data_ram_end = .;
|
__data_ram_end = .;
|
||||||
|
|
||||||
|
|
|
@ -273,6 +273,8 @@ SECTIONS
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||||
|
|
||||||
|
#include <linker/cplusplus-rom.ld>
|
||||||
|
|
||||||
_image_rodata_end = .;
|
_image_rodata_end = .;
|
||||||
MPU_ALIGN(_image_rodata_end -_image_rom_start);
|
MPU_ALIGN(_image_rodata_end -_image_rom_start);
|
||||||
_image_rom_end = .;
|
_image_rom_end = .;
|
||||||
|
@ -411,6 +413,7 @@ SECTIONS
|
||||||
#include <linker/kobject.ld>
|
#include <linker/kobject.ld>
|
||||||
|
|
||||||
#include <linker/priv_stacks-noinit.ld>
|
#include <linker/priv_stacks-noinit.ld>
|
||||||
|
#include <linker/cplusplus-ram.ld>
|
||||||
|
|
||||||
__data_ram_end = .;
|
__data_ram_end = .;
|
||||||
|
|
||||||
|
|
|
@ -272,6 +272,8 @@ SECTIONS
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||||
|
|
||||||
|
#include <linker/cplusplus-rom.ld>
|
||||||
|
|
||||||
_image_rodata_end = .;
|
_image_rodata_end = .;
|
||||||
MPU_ALIGN(_image_rodata_end -_image_rom_start);
|
MPU_ALIGN(_image_rodata_end -_image_rom_start);
|
||||||
_image_rom_end = .;
|
_image_rom_end = .;
|
||||||
|
@ -412,6 +414,8 @@ SECTIONS
|
||||||
|
|
||||||
#include <linker/priv_stacks-noinit.ld>
|
#include <linker/priv_stacks-noinit.ld>
|
||||||
|
|
||||||
|
#include <linker/cplusplus-ram.ld>
|
||||||
|
|
||||||
__data_ram_end = .;
|
__data_ram_end = .;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -163,6 +163,8 @@ SECTIONS
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||||
|
|
||||||
|
#include <linker/cplusplus-rom.ld>
|
||||||
|
|
||||||
_image_rom_end = .;
|
_image_rom_end = .;
|
||||||
__data_rom_start = ALIGN(4); /* XIP imaged DATA ROM start addr */
|
__data_rom_start = ALIGN(4); /* XIP imaged DATA ROM start addr */
|
||||||
|
|
||||||
|
@ -280,6 +282,8 @@ SECTIONS
|
||||||
|
|
||||||
} GROUP_LINK_IN(RAMABLE_REGION)
|
} GROUP_LINK_IN(RAMABLE_REGION)
|
||||||
|
|
||||||
|
#include <linker/cplusplus-ram.ld>
|
||||||
|
|
||||||
/* Define linker symbols */
|
/* Define linker symbols */
|
||||||
_image_ram_end = .;
|
_image_ram_end = .;
|
||||||
_end = .; /* end of image */
|
_end = .; /* end of image */
|
||||||
|
|
|
@ -120,6 +120,8 @@ SECTIONS
|
||||||
|
|
||||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||||
|
|
||||||
|
#include <linker/cplusplus-rom.ld>
|
||||||
|
|
||||||
_image_rom_end = .;
|
_image_rom_end = .;
|
||||||
__data_rom_start = .;
|
__data_rom_start = .;
|
||||||
|
|
||||||
|
@ -196,6 +198,8 @@ SECTIONS
|
||||||
|
|
||||||
} GROUP_LINK_IN(RAMABLE_REGION)
|
} GROUP_LINK_IN(RAMABLE_REGION)
|
||||||
|
|
||||||
|
#include <linker/cplusplus-ram.ld>
|
||||||
|
|
||||||
_image_ram_end = .;
|
_image_ram_end = .;
|
||||||
_end = .; /* end of image */
|
_end = .; /* end of image */
|
||||||
|
|
||||||
|
|
|
@ -160,6 +160,8 @@ SECTIONS
|
||||||
#include <linker/kobject-rom.ld>
|
#include <linker/kobject-rom.ld>
|
||||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||||
|
|
||||||
|
#include <linker/cplusplus-rom.ld>
|
||||||
|
|
||||||
MMU_PAGE_ALIGN
|
MMU_PAGE_ALIGN
|
||||||
/* ROM ends here, position counter will now be in RAM areas */
|
/* ROM ends here, position counter will now be in RAM areas */
|
||||||
_image_rom_end = .;
|
_image_rom_end = .;
|
||||||
|
@ -348,6 +350,7 @@ SECTIONS
|
||||||
#include <linker/common-ram.ld>
|
#include <linker/common-ram.ld>
|
||||||
|
|
||||||
#include <linker/kobject.ld>
|
#include <linker/kobject.ld>
|
||||||
|
#include <linker/cplusplus-ram.ld>
|
||||||
|
|
||||||
MMU_PAGE_ALIGN
|
MMU_PAGE_ALIGN
|
||||||
__data_ram_end = .;
|
__data_ram_end = .;
|
||||||
|
|
|
@ -54,9 +54,12 @@ SECTIONS
|
||||||
#include <custom-rodata.ld>
|
#include <custom-rodata.ld>
|
||||||
#endif /* CONFIG_CUSTOM_RODATA_LD */
|
#endif /* CONFIG_CUSTOM_RODATA_LD */
|
||||||
|
|
||||||
|
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||||
|
|
||||||
|
#include <linker/cplusplus-rom.ld>
|
||||||
|
|
||||||
_image_rodata_end = .;
|
_image_rodata_end = .;
|
||||||
_image_rodata_size = _image_rodata_end - _image_rodata_start;
|
_image_rodata_size = _image_rodata_end - _image_rodata_start;
|
||||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
|
||||||
|
|
||||||
SECTION_PROLOGUE(_DATA_SECTION_NAME,,ALIGN(16))
|
SECTION_PROLOGUE(_DATA_SECTION_NAME,,ALIGN(16))
|
||||||
{
|
{
|
||||||
|
@ -70,6 +73,7 @@ SECTIONS
|
||||||
|
|
||||||
#include <snippets-ram-sections.ld>
|
#include <snippets-ram-sections.ld>
|
||||||
#include <linker/common-ram.ld>
|
#include <linker/common-ram.ld>
|
||||||
|
#include <linker/cplusplus-ram.ld>
|
||||||
|
|
||||||
SECTION_PROLOGUE(_BSS_SECTION_NAME, (NOLOAD), ALIGN(16))
|
SECTION_PROLOGUE(_BSS_SECTION_NAME, (NOLOAD), ALIGN(16))
|
||||||
{
|
{
|
||||||
|
|
12
include/linker/cplusplus-ram.ld
Normal file
12
include/linker/cplusplus-ram.ld
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined (CONFIG_CPLUSPLUS)
|
||||||
|
SECTION_PROLOGUE(.gcc_except_table,,ONLY_IF_RW)
|
||||||
|
{
|
||||||
|
*(.gcc_except_table .gcc_except_table.*)
|
||||||
|
} GROUP_LINK_IN(RAMABLE_REGION)
|
||||||
|
#endif
|
12
include/linker/cplusplus-rom.ld
Normal file
12
include/linker/cplusplus-rom.ld
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined (CONFIG_CPLUSPLUS)
|
||||||
|
SECTION_PROLOGUE(.gcc_except_table,,ONLY_IF_RO)
|
||||||
|
{
|
||||||
|
*(.gcc_except_table .gcc_except_table.*)
|
||||||
|
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||||
|
#endif
|
|
@ -163,6 +163,8 @@ SECTIONS
|
||||||
|
|
||||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||||
|
|
||||||
|
#include <linker/cplusplus-rom.ld>
|
||||||
|
|
||||||
_image_rodata_end = .;
|
_image_rodata_end = .;
|
||||||
_image_rom_end = .;
|
_image_rom_end = .;
|
||||||
|
|
||||||
|
@ -202,6 +204,7 @@ SECTIONS
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||||
|
|
||||||
#include <linker/common-ram.ld>
|
#include <linker/common-ram.ld>
|
||||||
|
#include <linker/cplusplus-ram.ld>
|
||||||
|
|
||||||
__data_ram_end = .;
|
__data_ram_end = .;
|
||||||
__data_rom_start = LOADADDR(_DATA_SECTION_NAME);
|
__data_rom_start = LOADADDR(_DATA_SECTION_NAME);
|
||||||
|
|
Loading…
Reference in a new issue