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:
Jan Van Winkel 2019-09-07 15:10:45 +02:00 committed by Kumar Gala
parent 70fb574a6e
commit ff36fc7d67
10 changed files with 53 additions and 1 deletions

View file

@ -132,6 +132,8 @@ SECTIONS {
} GROUP_LINK_IN(ROMABLE_REGION)
#include <linker/cplusplus-rom.ld>
_image_rodata_end = .;
MPU_ALIGN(_image_rodata_end - _image_rom_start);
_image_rom_end = .;
@ -227,6 +229,7 @@ SECTIONS {
#include <linker/common-ram.ld>
#include <linker/kobject.ld>
#include <linker/cplusplus-ram.ld>
__data_ram_end = .;

View file

@ -273,6 +273,8 @@ SECTIONS
. = ALIGN(4);
} GROUP_LINK_IN(ROMABLE_REGION)
#include <linker/cplusplus-rom.ld>
_image_rodata_end = .;
MPU_ALIGN(_image_rodata_end -_image_rom_start);
_image_rom_end = .;
@ -411,6 +413,7 @@ SECTIONS
#include <linker/kobject.ld>
#include <linker/priv_stacks-noinit.ld>
#include <linker/cplusplus-ram.ld>
__data_ram_end = .;

View file

@ -272,6 +272,8 @@ SECTIONS
. = ALIGN(4);
} GROUP_LINK_IN(ROMABLE_REGION)
#include <linker/cplusplus-rom.ld>
_image_rodata_end = .;
MPU_ALIGN(_image_rodata_end -_image_rom_start);
_image_rom_end = .;
@ -412,6 +414,8 @@ SECTIONS
#include <linker/priv_stacks-noinit.ld>
#include <linker/cplusplus-ram.ld>
__data_ram_end = .;

View file

@ -163,6 +163,8 @@ SECTIONS
. = ALIGN(4);
} GROUP_LINK_IN(ROMABLE_REGION)
#include <linker/cplusplus-rom.ld>
_image_rom_end = .;
__data_rom_start = ALIGN(4); /* XIP imaged DATA ROM start addr */
@ -280,6 +282,8 @@ SECTIONS
} GROUP_LINK_IN(RAMABLE_REGION)
#include <linker/cplusplus-ram.ld>
/* Define linker symbols */
_image_ram_end = .;
_end = .; /* end of image */

View file

@ -120,6 +120,8 @@ SECTIONS
} GROUP_LINK_IN(ROMABLE_REGION)
#include <linker/cplusplus-rom.ld>
_image_rom_end = .;
__data_rom_start = .;
@ -196,6 +198,8 @@ SECTIONS
} GROUP_LINK_IN(RAMABLE_REGION)
#include <linker/cplusplus-ram.ld>
_image_ram_end = .;
_end = .; /* end of image */

View file

@ -160,6 +160,8 @@ SECTIONS
#include <linker/kobject-rom.ld>
} GROUP_LINK_IN(ROMABLE_REGION)
#include <linker/cplusplus-rom.ld>
MMU_PAGE_ALIGN
/* ROM ends here, position counter will now be in RAM areas */
_image_rom_end = .;
@ -348,6 +350,7 @@ SECTIONS
#include <linker/common-ram.ld>
#include <linker/kobject.ld>
#include <linker/cplusplus-ram.ld>
MMU_PAGE_ALIGN
__data_ram_end = .;

View file

@ -54,9 +54,12 @@ SECTIONS
#include <custom-rodata.ld>
#endif /* CONFIG_CUSTOM_RODATA_LD */
} GROUP_LINK_IN(ROMABLE_REGION)
#include <linker/cplusplus-rom.ld>
_image_rodata_end = .;
_image_rodata_size = _image_rodata_end - _image_rodata_start;
} GROUP_LINK_IN(ROMABLE_REGION)
SECTION_PROLOGUE(_DATA_SECTION_NAME,,ALIGN(16))
{
@ -70,6 +73,7 @@ SECTIONS
#include <snippets-ram-sections.ld>
#include <linker/common-ram.ld>
#include <linker/cplusplus-ram.ld>
SECTION_PROLOGUE(_BSS_SECTION_NAME, (NOLOAD), ALIGN(16))
{

View 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

View 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

View file

@ -163,6 +163,8 @@ SECTIONS
} GROUP_LINK_IN(ROMABLE_REGION)
#include <linker/cplusplus-rom.ld>
_image_rodata_end = .;
_image_rom_end = .;
@ -202,6 +204,7 @@ SECTIONS
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#include <linker/common-ram.ld>
#include <linker/cplusplus-ram.ld>
__data_ram_end = .;
__data_rom_start = LOADADDR(_DATA_SECTION_NAME);