Skip to content

Commit abc172e

Browse files
committed
Unify linkscript for all targets
1 parent d31f67c commit abc172e

File tree

9 files changed

+112
-581
lines changed

9 files changed

+112
-581
lines changed

Makefile.rules_generic

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ $(OBJ_DIR)/%.o: %.S $(BUILD_DEPENDENCIES) prepare
8989
$(L)$(call as_cmdline,$(INCLUDES_PATH), $(DEFINES),$<,$@)
9090

9191
ifeq ($(SCRIPT_LD),)
92-
SCRIPT_LD:=$(BOLOS_SDK)/target/$(TARGET)/script.ld
92+
MEMORY_LAYOUT:=$(BOLOS_SDK)/target/$(TARGET)/layout.ld
93+
SCRIPT_LD:=$(BOLOS_SDK)/target/script.ld
94+
LDFLAGS += -T$(MEMORY_LAYOUT) -T$(SCRIPT_LD)
9395
else
9496
$(info Using custom link script: $(SCRIPT_LD))
95-
endif
9697
LDFLAGS += -T$(SCRIPT_LD)
98+
endif
9799

98100
$(LINK_DEPENDENCIES): prepare
99101

target/nanos/layout.ld

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*******************************************************************************
2+
* Ledger Blue - Secure firmware
3+
* (c) 2016, 2017, 2018, 2019, 2020 Ledger
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
********************************************************************************/
17+
18+
MEMORY
19+
{
20+
FLASH (rx) : ORIGIN = 0xc0d00000, LENGTH = 400K
21+
SRAM (rwx) : ORIGIN = 0x20000200, LENGTH = 4K+512
22+
CXSRAM (rwx) : ORIGIN = 0x20001400, LENGTH = 1K
23+
}
24+
25+
PAGE_SIZE = 64;
26+
STACK_SIZE = DEFINED(stack_size) ? stack_size : 1024;

target/nanos/script.ld

Lines changed: 0 additions & 198 deletions
This file was deleted.

target/nanos2/layout.ld

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*******************************************************************************
2+
* Ledger Blue - Secure firmware
3+
* (c) 2016, 2017, 2018, 2019 Ledger
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
********************************************************************************/
17+
18+
MEMORY
19+
{
20+
FLASH (rx) : ORIGIN = 0xc0de0000, LENGTH = 400K
21+
SRAM (rwx) : ORIGIN = 0xda7a0000, LENGTH = 30K
22+
}
23+
24+
PAGE_SIZE = 512;
25+
STACK_SIZE = 1500;

0 commit comments

Comments
 (0)