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 abc172e
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 581 deletions.
6 changes: 4 additions & 2 deletions Makefile.rules_generic
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ $(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) -T$(SCRIPT_LD)
else
$(info Using custom link script: $(SCRIPT_LD))
endif
LDFLAGS += -T$(SCRIPT_LD)
endif

$(LINK_DEPENDENCIES): prepare

Expand Down
26 changes: 26 additions & 0 deletions target/nanos/layout.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*******************************************************************************
* 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;
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;

0 comments on commit abc172e

Please sign in to comment.