Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ports/analog/linking/max32690_cktpy.ld
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ SECTIONS {
.text :
{
. = ALIGN(4);
__property_getter_start = .;
*(.property_getter)
__property_getter_end = .;
__property_getset_start = .;
*(.property_getset)
__property_getset_end = .;
_text = .;

/* ISR Vector beginning of .text */
Expand Down Expand Up @@ -183,4 +189,9 @@ SECTIONS {

/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__StackLimit >= _ebss, "region RAM overflowed with stack")

ASSERT((__property_getter_end - __property_getter_start) % 8 == 0,
"the .property_getter section must hold whole 8-byte objects")
ASSERT((__property_getset_end - __property_getset_start) % 12 == 0,
"the .property_getset section must hold whole 12-byte objects")
}
3 changes: 3 additions & 0 deletions ports/analog/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#
# SPDX-License-Identifier: MIT

# Properties get a dedicated linker section here, so they can drop the unused slots.
CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1

CHIP_FAMILY ?= max32

# Necessary to build CircuitPython
Expand Down
11 changes: 11 additions & 0 deletions ports/mimxrt10xx/linking/common.ld
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ SECTIONS
.text :
{
. = ALIGN(4);
__property_getter_start = .;
*(.property_getter)
__property_getter_end = .;
__property_getset_start = .;
*(.property_getset)
__property_getset_end = .;
*(EXCLUDE_FILE(
*fsl_flexspi.o
*cd_ci_hs.o
Expand Down Expand Up @@ -210,4 +216,9 @@ SECTIONS
__StackTop = ORIGIN(DTCM) + LENGTH(DTCM);

.ARM.attributes 0 : { *(.ARM.attributes) }

ASSERT((__property_getter_end - __property_getter_start) % 8 == 0,
"the .property_getter section must hold whole 8-byte objects")
ASSERT((__property_getset_end - __property_getset_start) % 12 == 0,
"the .property_getset section must hold whole 12-byte objects")
}
3 changes: 3 additions & 0 deletions ports/mimxrt10xx/mpconfigport.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Properties get a dedicated linker section here, so they can drop the unused slots.
CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1

LD_FILE = $(FLASH).ld $(CHIP_FAMILY).ld imxrt10xx.ld

INTERNAL_LIBM = 1
Expand Down
11 changes: 11 additions & 0 deletions ports/nordic/boards/common.template.ld
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ SECTIONS
.text :
{
. = ALIGN(4);
__property_getter_start = .;
*(.property_getter)
__property_getter_end = .;
__property_getset_start = .;
*(.property_getset)
__property_getset_end = .;
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.text))) /* .text sections (code) */
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.text*))) /* .text* sections (code) */
*(.rodata) /* .rodata sections (constants, strings, etc.) */
Expand Down Expand Up @@ -155,4 +161,9 @@ SECTIONS
*/

.ARM.attributes 0 : { *(.ARM.attributes) }

ASSERT((__property_getter_end - __property_getter_start) % 8 == 0,
"the .property_getter section must hold whole 8-byte objects")
ASSERT((__property_getset_end - __property_getset_start) % 12 == 0,
"the .property_getset section must hold whole 12-byte objects")
}
3 changes: 3 additions & 0 deletions ports/nordic/mpconfigport.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# All linking can be done with this common templated linker script, which has
# parameters that vary based on chip and/or board.
# Properties get a dedicated linker section here, so they can drop the unused slots.
CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1

LD_TEMPLATE_FILE = boards/common.template.ld

INTERNAL_LIBM = 1
Expand Down
11 changes: 11 additions & 0 deletions ports/stm/boards/common_default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ SECTIONS
.text :
{
. = ALIGN(4);
__property_getter_start = .;
*(.property_getter)
__property_getter_end = .;
__property_getset_start = .;
*(.property_getset)
__property_getset_end = .;
*(.text*) /* .text* sections (code) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
/* *(.glue_7) */ /* glue arm to thumb code */
Expand Down Expand Up @@ -95,4 +101,9 @@ SECTIONS


.ARM.attributes 0 : { *(.ARM.attributes) }

ASSERT((__property_getter_end - __property_getter_start) % 8 == 0,
"the .property_getter section must hold whole 8-byte objects")
ASSERT((__property_getset_end - __property_getset_start) % 12 == 0,
"the .property_getset section must hold whole 12-byte objects")
}
11 changes: 11 additions & 0 deletions ports/stm/boards/common_nvm.ld
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ SECTIONS
.text :
{
. = ALIGN(4);
__property_getter_start = .;
*(.property_getter)
__property_getter_end = .;
__property_getset_start = .;
*(.property_getset)
__property_getset_end = .;
*(.text*) /* .text* sections (code) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
/* *(.glue_7) */ /* glue arm to thumb code */
Expand Down Expand Up @@ -105,4 +111,9 @@ SECTIONS


.ARM.attributes 0 : { *(.ARM.attributes) }

ASSERT((__property_getter_end - __property_getter_start) % 8 == 0,
"the .property_getter section must hold whole 8-byte objects")
ASSERT((__property_getset_end - __property_getset_start) % 12 == 0,
"the .property_getset section must hold whole 12-byte objects")
}
11 changes: 11 additions & 0 deletions ports/stm/boards/common_tcm.ld
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ SECTIONS
.text :
{
. = ALIGN(4);
__property_getter_start = .;
*(.property_getter)
__property_getter_end = .;
__property_getset_start = .;
*(.property_getset)
__property_getset_end = .;
*(.text*) /* .text* sections (code) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
/* *(.glue_7) */ /* glue arm to thumb code */
Expand Down Expand Up @@ -146,4 +152,9 @@ SECTIONS
} >FLASH_FIRMWARE

.ARM.attributes 0 : { *(.ARM.attributes) }

ASSERT((__property_getter_end - __property_getter_start) % 8 == 0,
"the .property_getter section must hold whole 8-byte objects")
ASSERT((__property_getset_end - __property_getset_start) % 12 == 0,
"the .property_getset section must hold whole 12-byte objects")
}
3 changes: 3 additions & 0 deletions ports/stm/mpconfigport.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Properties get a dedicated linker section here, so they can drop the unused slots.
CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1

LONGINT_IMPL ?= MPZ
INTERNAL_LIBM ?= 1

Expand Down
Loading