From 160e1a965d47f8d29e1d79a470810b7a16f4ef81 Mon Sep 17 00:00:00 2001 From: Stuart Ianna Date: Mon, 26 Jun 2023 16:17:23 +1000 Subject: [PATCH] mkexport: Allow boards to supply custom gnu-elf.ld. Allows boards to supply their own gnu-elf linker script, used when building Nuttx applications and CONFIG_BUILD_KERNEL. This is useful when building fully-linked applications (see #9395). --- tools/mkexport.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/mkexport.sh b/tools/mkexport.sh index aac0006c9d..90cb041fef 100755 --- a/tools/mkexport.sh +++ b/tools/mkexport.sh @@ -180,9 +180,13 @@ fi cp "${TOPDIR}/tools/mkdeps.c" "${EXPORTDIR}/tools/." cp "${TOPDIR}/tools/incdir.c" "${EXPORTDIR}/tools/." -# Copy the default linker script +# Copy the board specific linker if found, or use the default when not. -cp -f "${TOPDIR}/binfmt/libelf/gnu-elf.ld" "${EXPORTDIR}/scripts/." +if [ -f "${BOARDDIR}/scripts/gnu-elf.ld" ]; then + cp -f "${BOARDDIR}/scripts/gnu-elf.ld" "${EXPORTDIR}/scripts/." +else + cp -f "${TOPDIR}/binfmt/libelf/gnu-elf.ld" "${EXPORTDIR}/scripts/." +fi # Copy the board config script