From e1fddd5b3b678c43ee59835d7b57bbc063a22d28 Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Sat, 11 Feb 2023 16:35:32 -0500 Subject: Generate one linker script; add unit tests We can still maintain individual linker script components, then write them into one, larger linker script. We're effectively implementing the same behavior as INCLUDE while disallowing overrides of the linker search path to find the INCLUDEd files. Once we have one linker script, we can refactor for easier unit testing. This commit adds simple unit tests for the default builder, and some of the expected errors. --- src/host/imxrt-boot-header.x | 5 ++++- src/host/imxrt-link.x | 10 ++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src/host') diff --git a/src/host/imxrt-boot-header.x b/src/host/imxrt-boot-header.x index 67355a2..296eff5 100644 --- a/src/host/imxrt-boot-header.x +++ b/src/host/imxrt-boot-header.x @@ -1,4 +1,5 @@ -/* This extra file is injected into imxrt-memory.x depending on the +/* ===--- Begin imxrt-boot-header.x ---=== + * This extra content is injected into the linker script depending on the * runtime configuration. */ @@ -71,3 +72,5 @@ SECTIONS . = ORIGIN(FLASH) + 0x2000; /* Reserve the remaining 8K as a convenience for a non-XIP boot. */ } > FLASH } + +/* ===--- End imxrt-boot-header.x ---=== */ diff --git a/src/host/imxrt-link.x b/src/host/imxrt-link.x index 272ffd8..d02a170 100644 --- a/src/host/imxrt-link.x +++ b/src/host/imxrt-link.x @@ -1,12 +1,8 @@ -/* - * This linker script is a fork of the default linker script provided by +/* ===--- Begin imxrt-link.x ---=== + * This section of the linker script is a fork of the default linker script provided by * imxrt-rt, version 0.7.1. It's modified to support the needs of imxrt-rt. */ -/* Provides information about the memory layout of the device */ -/* This will be provided by the build script that uses imxrt-rt. */ -INCLUDE imxrt-memory.x - /* # Entry point = reset vector */ EXTERN(__RESET_VECTOR); EXTERN(Reset); @@ -196,3 +192,5 @@ Dynamic relocations are not supported. If you are linking to C code compiled usi the 'cc' crate then modify your build script to compile the C code _without_ the -fPIC flag. See the documentation of the `cc::Build.pic` method for details."); /* Do not exceed this mark in the error messages above | */ + +/* ===--- End imxrt-link.x ---=== */ -- cgit v1.2.3