Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify linkscript for all targets #398

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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