Skip to content

Commit

Permalink
Unify linkscript for all targets
Browse files Browse the repository at this point in the history
  • Loading branch information
yhql committed Aug 3, 2023
1 parent d31f67c commit f1b8243
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 585 deletions.
4 changes: 3 additions & 1 deletion Makefile.rules_generic
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ $(OBJ_DIR)/%.o: %.S $(BUILD_DEPENDENCIES) prepare
$(L)$(call as_cmdline,$(INCLUDES_PATH), $(DEFINES),$<,$@)

ifeq ($(SCRIPT_LD),)
SCRIPT_LD:=$(BOLOS_SDK)/target/$(TARGET)/script.ld
MEMORY_LAYOUT:=$(BOLOS_SDK)/target/$(TARGET)/layout.ld
SCRIPT_LD:=$(BOLOS_SDK)/target/script.ld
LDFLAGS += -T$(MEMORY_LAYOUT)
else
$(info Using custom link script: $(SCRIPT_LD))
endif
Expand Down
32 changes: 32 additions & 0 deletions target/nanos/layout.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*******************************************************************************
* Ledger Blue - Secure firmware
* (c) 2016, 2017, 2018, 2019, 2020 Ledger
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
********************************************************************************/

MEMORY
{
FLASH (rx) : ORIGIN = 0xc0d00000, LENGTH = 400K
SRAM (rwx) : ORIGIN = 0x20000200, LENGTH = 4K+512
CXSRAM (rwx) : ORIGIN = 0x20001400, LENGTH = 1K
}

PAGE_SIZE = 64;
STACK_SIZE = DEFINED(stack_size) ? stack_size : 1024;

SECTIONS {
.cx_ram : {
*(.bss.G_cx)
} > CXSRAM = 0x00
}
198 changes: 0 additions & 198 deletions target/nanos/script.ld

This file was deleted.

25 changes: 25 additions & 0 deletions target/nanos2/layout.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*******************************************************************************
* Ledger Blue - Secure firmware
* (c) 2016, 2017, 2018, 2019 Ledger
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
********************************************************************************/

MEMORY
{
FLASH (rx) : ORIGIN = 0xc0de0000, LENGTH = 400K
SRAM (rwx) : ORIGIN = 0xda7a0000, LENGTH = 30K
}

PAGE_SIZE = 512;
STACK_SIZE = 1500;
Loading

0 comments on commit f1b8243

Please sign in to comment.