Skip to content

Commit 4a73ffa

Browse files
committed
pbio/platform/ev3: Fix linker script to merge sections
This allows re-enabling the -fdata-sections -ffunction-sections optimization
1 parent 625e80b commit 4a73ffa

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

bricks/_common/arm_none_eabi.mk

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,8 @@ else ifeq ($(DEBUG), 2)
196196
CFLAGS += -Os -DNDEBUG -flto=auto
197197
else
198198
CFLAGS += -Os -DNDEBUG -flto=auto
199-
ifneq ($(PB_MCU_FAMILY),TIAM1808)
200-
# This is used for trimming unused code on smaller platforms, but on EV3 we
201-
# don't want to enable these flags in order to keep the size of the .elf file
202-
# small by avoiding huge tables of section names.
203199
CFLAGS += -fdata-sections -ffunction-sections
204200
endif
205-
endif
206201

207202
ifeq ($(PB_MCU_FAMILY),STM32)
208203
# Required for STM32 library

lib/pbio/platform/ev3/platform.ld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,29 @@ SECTIONS
1919
{
2020
. = ALIGN(4);
2121
*(.text)
22+
*(.text.*)
23+
} > DDR
24+
25+
.rodata :
26+
{
27+
. = ALIGN(4);
28+
*(.rodata)
29+
*(.rodata.*)
2230
} > DDR
2331

2432
.data :
2533
{
2634
. = ALIGN(4);
2735
*(.data)
36+
*(.data.*)
2837
} > DDR
2938

3039
.bss :
3140
{
3241
. = ALIGN(4);
3342
_bss_start = .;
3443
*(.bss)
44+
*(.bss.*)
3545
. = ALIGN(4);
3646
_bss_end = .;
3747
} > DDR

0 commit comments

Comments
 (0)