Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit afc47f7

Browse files
facchinmalfran
authored andcommitted
Fix ld symbols import
Avoid linking syscall.c.o object twice and allow using precompiled core
1 parent 4a3b1a6 commit afc47f7

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mcpu={b
6969
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
7070

7171
## Combine gc-sections, archives, and objects
72-
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "{build.path}/core/syscalls.c.o" {object_files} -Wl,--whole-archive "{build.variant.path}/{build.variant_system_lib}" -Wl,--no-whole-archive "{build.path}/{archive_file}" -Wl,--end-group
72+
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group {object_files} -Wl,--whole-archive "{build.variant.path}/{build.variant_system_lib}" -Wl,--no-whole-archive "{build.path}/{archive_file}" -Wl,--end-group -lm -lgcc
7373

7474
## Create eeprom
7575
recipe.objcopy.eep.pattern=

variants/otto/link-tools/common.inc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,17 @@ SECTIONS
171171
_end = __bss_end__;
172172
} > REGION_BSS
173173

174+
175+
.heap : {
176+
__heap_start__ = .;
177+
end = __heap_start__;
178+
_end = end;
179+
__end = end;
180+
KEEP(*(.heap))
181+
__heap_end__ = .;
182+
__HeapLimit = __heap_end__;
183+
} > REGION_HEAP
184+
174185
/*
175186
* Debugging sections
176187
*/

variants/otto/link-tools/flash.ld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ REGION_ALIAS("REGION_TEXT", rom);
1515
REGION_ALIAS("REGION_DATA", ram);
1616
REGION_ALIAS("REGION_BSS", ram);
1717
REGION_ALIAS("REGION_RODATA", rom);
18+
REGION_ALIAS("REGION_HEAP", ram);
1819

1920
_FLASH_BUILD = 1;
2021
INCLUDE common.inc

variants/otto/link-tools/jtag.ld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ REGION_ALIAS("REGION_TEXT", rom);
1717
REGION_ALIAS("REGION_DATA", ram);
1818
REGION_ALIAS("REGION_BSS", ram);
1919
REGION_ALIAS("REGION_RODATA", rom);
20+
REGION_ALIAS("REGION_HEAP", ram);
2021

2122
_FLASH_BUILD = 1;
2223
INCLUDE common.inc

variants/otto/link-tools/ram.ld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ REGION_ALIAS("REGION_TEXT", ram);
1616
REGION_ALIAS("REGION_DATA", ram);
1717
REGION_ALIAS("REGION_BSS", ram);
1818
REGION_ALIAS("REGION_RODATA", ram);
19+
REGION_ALIAS("REGION_HEAP", ram);
1920

2021
INCLUDE common.inc

0 commit comments

Comments
 (0)