This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 547c85b0ae boards: Switch the elf link script to
binfmt/libelf/gnu-elf.ld
547c85b0ae is described below
commit 547c85b0ae7ba4bfef57c92bebc065ff4567611e
Author: Xiang Xiao <[email protected]>
AuthorDate: Sun Apr 24 09:42:58 2022 +0800
boards: Switch the elf link script to binfmt/libelf/gnu-elf.ld
Signed-off-by: Xiang Xiao <[email protected]>
---
boards/arm/cxd56xx/spresense/scripts/Make.defs | 2 +-
boards/arm/cxd56xx/spresense/scripts/gnu-elf.ld | 125 --------------------
boards/arm/imx6/sabre-6quad/scripts/Make.defs | 2 +-
boards/arm/imx6/sabre-6quad/scripts/gnu-elf.ld | 125 --------------------
.../arm/lc823450/lc823450-xgevk/scripts/Make.defs | 2 +-
.../arm/lc823450/lc823450-xgevk/scripts/gnu-elf.ld | 125 --------------------
boards/arm/lpc17xx_40xx/lx_cpu/scripts/Make.defs | 2 +-
boards/arm/lpc17xx_40xx/lx_cpu/scripts/gnu-elf.ld | 125 --------------------
boards/arm/phy62xx/phy6222/scripts/gnu-elf.ld | 116 -------------------
boards/arm/sama5/giant-board/scripts/Make.defs | 2 +-
boards/arm/sama5/giant-board/scripts/gnu-elf.ld | 124 --------------------
boards/arm/sama5/sama5d2-xult/scripts/Make.defs | 2 +-
boards/arm/sama5/sama5d2-xult/scripts/gnu-elf.ld | 124 --------------------
.../arm/sama5/sama5d3-xplained/scripts/Make.defs | 2 +-
.../arm/sama5/sama5d3-xplained/scripts/gnu-elf.ld | 124 --------------------
boards/arm/sama5/sama5d3x-ek/scripts/Make.defs | 2 +-
boards/arm/sama5/sama5d3x-ek/scripts/gnu-elf.ld | 124 --------------------
boards/arm/sama5/sama5d4-ek/configs/knsh/Make.defs | 2 +-
boards/arm/sama5/sama5d4-ek/scripts/Make.defs | 2 +-
boards/arm/sama5/sama5d4-ek/scripts/gnu-elf.ld | 125 --------------------
boards/arm/samv7/common/scripts/gnu-elf.ld | 116 -------------------
boards/arm/stm32/axoloti/scripts/Make.defs | 2 +-
boards/arm/stm32/axoloti/scripts/gnu-elf.ld | 126 ---------------------
boards/arm/stm32/clicker2-stm32/scripts/gnu-elf.ld | 126 ---------------------
boards/arm/stm32/mikroe-stm32f4/scripts/gnu-elf.ld | 116 -------------------
boards/arm/stm32/nucleo-f429zi/scripts/gnu-elf.ld | 116 -------------------
boards/arm/stm32/omnibusf4/scripts/Make.defs | 2 +-
boards/arm/stm32/omnibusf4/scripts/gnu-elf.ld | 126 ---------------------
.../arm/stm32/stm32f3discovery/scripts/gnu-elf.ld | 115 -------------------
.../arm/stm32/stm32f429i-disco/scripts/gnu-elf.ld | 116 -------------------
.../arm/stm32/stm32f4discovery/scripts/Make.defs | 2 +-
.../arm/stm32/stm32f4discovery/scripts/gnu-elf.ld | 126 ---------------------
.../arm/stm32/stm32ldiscovery/scripts/gnu-elf.ld | 116 -------------------
.../stm32f051-discovery/scripts/gnu-elf.ld | 116 -------------------
.../stm32f072-discovery/scripts/gnu-elf.ld | 116 -------------------
boards/arm/stm32h7/nucleo-h743zi/scripts/Make.defs | 2 +-
.../arm/stm32h7/nucleo-h743zi/scripts/gnu-elf.ld | 126 ---------------------
.../arm/stm32h7/nucleo-h743zi2/scripts/Make.defs | 2 +-
.../arm/stm32h7/nucleo-h743zi2/scripts/gnu-elf.ld | 126 ---------------------
boards/arm/tiva/lm3s6965-ek/scripts/Make.defs | 2 +-
boards/arm/tiva/lm3s6965-ek/scripts/gnu-elf.ld | 126 ---------------------
.../arm/tms570/launchxl-tms57004/scripts/Make.defs | 2 +-
.../tms570/tms570ls31x-usb-kit/scripts/Make.defs | 2 +-
boards/avr/atmega/amber/scripts/gnu-elf.ld | 124 --------------------
boards/risc-v/bl602/bl602evb/scripts/Make.defs | 2 +-
boards/risc-v/bl602/bl602evb/scripts/gnu-elf.ld | 115 -------------------
boards/risc-v/c906/smartl-c906/scripts/Make.defs | 2 +-
boards/risc-v/c906/smartl-c906/scripts/gnu-elf.ld | 115 -------------------
boards/risc-v/k210/maix-bit/scripts/Make.defs | 2 +-
boards/risc-v/k210/maix-bit/scripts/gnu-elf.ld | 115 -------------------
boards/risc-v/mpfs/icicle/scripts/Make.defs | 2 +-
boards/risc-v/mpfs/icicle/scripts/gnu-elf.ld | 115 -------------------
boards/risc-v/mpfs/m100pfsevp/scripts/Make.defs | 2 +-
boards/risc-v/mpfs/m100pfsevp/scripts/gnu-elf.ld | 115 -------------------
boards/sim/sim/sim/scripts/Make.defs | 2 +-
boards/sim/sim/sim/scripts/gnu-elf.ld | 117 -------------------
boards/sparc/bm3803/xx3803/scripts/gnu-elf.ld | 84 --------------
.../esp32s2/esp32s2-saola-1/scripts/Make.defs | 2 +-
.../esp32s3/esp32s3-devkit/scripts/Make.defs | 2 +-
59 files changed, 26 insertions(+), 3972 deletions(-)
diff --git a/boards/arm/cxd56xx/spresense/scripts/Make.defs
b/boards/arm/cxd56xx/spresense/scripts/Make.defs
index d0ae7c04af..20a930a6eb 100644
--- a/boards/arm/cxd56xx/spresense/scripts/Make.defs
+++ b/boards/arm/cxd56xx/spresense/scripts/Make.defs
@@ -74,7 +74,7 @@ CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
CFLAGS += -gdwarf-3
diff --git a/boards/arm/cxd56xx/spresense/scripts/gnu-elf.ld
b/boards/arm/cxd56xx/spresense/scripts/gnu-elf.ld
deleted file mode 100644
index eae9ac4aff..0000000000
--- a/boards/arm/cxd56xx/spresense/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
- * boards/arm/cxd56xx/spresense/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/imx6/sabre-6quad/scripts/Make.defs
b/boards/arm/imx6/sabre-6quad/scripts/Make.defs
index e15fcd078e..0c99b4202c 100644
--- a/boards/arm/imx6/sabre-6quad/scripts/Make.defs
+++ b/boards/arm/imx6/sabre-6quad/scripts/Make.defs
@@ -59,7 +59,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/imx6/sabre-6quad/scripts/gnu-elf.ld
b/boards/arm/imx6/sabre-6quad/scripts/gnu-elf.ld
deleted file mode 100644
index 47dbb028d1..0000000000
--- a/boards/arm/imx6/sabre-6quad/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
- * boards/arm/imx6/sabre-6quad/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/lc823450/lc823450-xgevk/scripts/Make.defs
b/boards/arm/lc823450/lc823450-xgevk/scripts/Make.defs
index c1e8f04ea6..248f12f08d 100644
--- a/boards/arm/lc823450/lc823450-xgevk/scripts/Make.defs
+++ b/boards/arm/lc823450/lc823450-xgevk/scripts/Make.defs
@@ -67,7 +67,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
# File extensions
diff --git a/boards/arm/lc823450/lc823450-xgevk/scripts/gnu-elf.ld
b/boards/arm/lc823450/lc823450-xgevk/scripts/gnu-elf.ld
deleted file mode 100644
index 922c2516a8..0000000000
--- a/boards/arm/lc823450/lc823450-xgevk/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
- * boards/arm/lc823450/lc823450-xgevk/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/lpc17xx_40xx/lx_cpu/scripts/Make.defs
b/boards/arm/lpc17xx_40xx/lx_cpu/scripts/Make.defs
index 55a6e676ca..cc289cf5b2 100644
--- a/boards/arm/lpc17xx_40xx/lx_cpu/scripts/Make.defs
+++ b/boards/arm/lpc17xx_40xx/lx_cpu/scripts/Make.defs
@@ -69,7 +69,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
# Loadable module definitions
diff --git a/boards/arm/lpc17xx_40xx/lx_cpu/scripts/gnu-elf.ld
b/boards/arm/lpc17xx_40xx/lx_cpu/scripts/gnu-elf.ld
deleted file mode 100644
index 0b6c500717..0000000000
--- a/boards/arm/lpc17xx_40xx/lx_cpu/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
- * boards/arm/lpc17xx_40xx/lx_cpu/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/phy62xx/phy6222/scripts/gnu-elf.ld
b/boards/arm/phy62xx/phy6222/scripts/gnu-elf.ld
deleted file mode 100644
index b7371d8265..0000000000
--- a/boards/arm/phy62xx/phy6222/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32f0l0g0/stm32f051-discovery/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/sama5/giant-board/scripts/Make.defs
b/boards/arm/sama5/giant-board/scripts/Make.defs
index a10cb1fe29..cfea7c68ce 100644
--- a/boards/arm/sama5/giant-board/scripts/Make.defs
+++ b/boards/arm/sama5/giant-board/scripts/Make.defs
@@ -69,7 +69,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/sama5/giant-board/scripts/gnu-elf.ld
b/boards/arm/sama5/giant-board/scripts/gnu-elf.ld
deleted file mode 100644
index 57327491c2..0000000000
--- a/boards/arm/sama5/giant-board/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
- * boards/arm/sama5/giant-board/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* Uninitialized data */
-
- .noinit :
- {
- _snoinit = . ;
- *(.noinit*)
- _enoinit = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/sama5/sama5d2-xult/scripts/Make.defs
b/boards/arm/sama5/sama5d2-xult/scripts/Make.defs
index 82f4ef3637..96ca0a1853 100644
--- a/boards/arm/sama5/sama5d2-xult/scripts/Make.defs
+++ b/boards/arm/sama5/sama5d2-xult/scripts/Make.defs
@@ -69,7 +69,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/sama5/sama5d2-xult/scripts/gnu-elf.ld
b/boards/arm/sama5/sama5d2-xult/scripts/gnu-elf.ld
deleted file mode 100644
index 7c67e77b15..0000000000
--- a/boards/arm/sama5/sama5d2-xult/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
- * boards/arm/sama5/sama5d2-xult/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* Uninitialized data */
-
- .noinit :
- {
- _snoinit = . ;
- *(.noinit*)
- _enoinit = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/sama5/sama5d3-xplained/scripts/Make.defs
b/boards/arm/sama5/sama5d3-xplained/scripts/Make.defs
index 9eac54e66d..d8d1af70a7 100644
--- a/boards/arm/sama5/sama5d3-xplained/scripts/Make.defs
+++ b/boards/arm/sama5/sama5d3-xplained/scripts/Make.defs
@@ -65,7 +65,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/sama5/sama5d3-xplained/scripts/gnu-elf.ld
b/boards/arm/sama5/sama5d3-xplained/scripts/gnu-elf.ld
deleted file mode 100644
index a1d4da7b93..0000000000
--- a/boards/arm/sama5/sama5d3-xplained/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
- * boards/arm/sama5/sama5d3-xplained/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* Uninitialized data */
-
- .noinit :
- {
- _snoinit = . ;
- *(.noinit*)
- _enoinit = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/sama5/sama5d3x-ek/scripts/Make.defs
b/boards/arm/sama5/sama5d3x-ek/scripts/Make.defs
index 26a0dfd20e..e31e892888 100644
--- a/boards/arm/sama5/sama5d3x-ek/scripts/Make.defs
+++ b/boards/arm/sama5/sama5d3x-ek/scripts/Make.defs
@@ -85,7 +85,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/sama5/sama5d3x-ek/scripts/gnu-elf.ld
b/boards/arm/sama5/sama5d3x-ek/scripts/gnu-elf.ld
deleted file mode 100644
index 42d2d0b3d6..0000000000
--- a/boards/arm/sama5/sama5d3x-ek/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
- * boards/arm/sama5/sama5d3x-ek/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* Uninitialized data */
-
- .noinit :
- {
- _snoinit = . ;
- *(.noinit*)
- _enoinit = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/sama5/sama5d4-ek/configs/knsh/Make.defs
b/boards/arm/sama5/sama5d4-ek/configs/knsh/Make.defs
index 5e3f6181bc..da24a4e8cb 100644
--- a/boards/arm/sama5/sama5d4-ek/configs/knsh/Make.defs
+++ b/boards/arm/sama5/sama5d4-ek/configs/knsh/Make.defs
@@ -69,7 +69,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/sama5/sama5d4-ek/scripts/Make.defs
b/boards/arm/sama5/sama5d4-ek/scripts/Make.defs
index a5fda87208..446f54bf3b 100644
--- a/boards/arm/sama5/sama5d4-ek/scripts/Make.defs
+++ b/boards/arm/sama5/sama5d4-ek/scripts/Make.defs
@@ -69,7 +69,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/sama5/sama5d4-ek/scripts/gnu-elf.ld
b/boards/arm/sama5/sama5d4-ek/scripts/gnu-elf.ld
deleted file mode 100644
index e2e1b1e9e2..0000000000
--- a/boards/arm/sama5/sama5d4-ek/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
- * boards/arm/sama5/sama5d4-ek/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* Uninitialized data */
-
- .noinit :
- {
- _snoinit = . ;
- *(.noinit*)
- _enoinit = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/samv7/common/scripts/gnu-elf.ld
b/boards/arm/samv7/common/scripts/gnu-elf.ld
deleted file mode 100644
index bda1b9264e..0000000000
--- a/boards/arm/samv7/common/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
- * boards/arm/samv7/common/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32/axoloti/scripts/Make.defs
b/boards/arm/stm32/axoloti/scripts/Make.defs
index d39a0de1e4..c6ece18f4d 100644
--- a/boards/arm/stm32/axoloti/scripts/Make.defs
+++ b/boards/arm/stm32/axoloti/scripts/Make.defs
@@ -64,7 +64,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/stm32/axoloti/scripts/gnu-elf.ld
b/boards/arm/stm32/axoloti/scripts/gnu-elf.ld
deleted file mode 100644
index afd759791c..0000000000
--- a/boards/arm/stm32/axoloti/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32/axoloti/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32/clicker2-stm32/scripts/gnu-elf.ld
b/boards/arm/stm32/clicker2-stm32/scripts/gnu-elf.ld
deleted file mode 100644
index a04736f672..0000000000
--- a/boards/arm/stm32/clicker2-stm32/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32/clicker2-stm32/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32/mikroe-stm32f4/scripts/gnu-elf.ld
b/boards/arm/stm32/mikroe-stm32f4/scripts/gnu-elf.ld
deleted file mode 100644
index 41072ff720..0000000000
--- a/boards/arm/stm32/mikroe-stm32f4/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32/mikroe-stm32f4/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32/nucleo-f429zi/scripts/gnu-elf.ld
b/boards/arm/stm32/nucleo-f429zi/scripts/gnu-elf.ld
deleted file mode 100644
index f1bd4bfdea..0000000000
--- a/boards/arm/stm32/nucleo-f429zi/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32/nucleo-f429zi/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32/omnibusf4/scripts/Make.defs
b/boards/arm/stm32/omnibusf4/scripts/Make.defs
index 20513229f5..d6bbd4d871 100644
--- a/boards/arm/stm32/omnibusf4/scripts/Make.defs
+++ b/boards/arm/stm32/omnibusf4/scripts/Make.defs
@@ -64,7 +64,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/stm32/omnibusf4/scripts/gnu-elf.ld
b/boards/arm/stm32/omnibusf4/scripts/gnu-elf.ld
deleted file mode 100644
index f97f39cd2f..0000000000
--- a/boards/arm/stm32/omnibusf4/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32/omnibusf4/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32/stm32f3discovery/scripts/gnu-elf.ld
b/boards/arm/stm32/stm32f3discovery/scripts/gnu-elf.ld
deleted file mode 100644
index d270ba1494..0000000000
--- a/boards/arm/stm32/stm32f3discovery/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32/stm32f3discovery/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32/stm32f429i-disco/scripts/gnu-elf.ld
b/boards/arm/stm32/stm32f429i-disco/scripts/gnu-elf.ld
deleted file mode 100644
index 02130ef20c..0000000000
--- a/boards/arm/stm32/stm32f429i-disco/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32/stm32f429i-disco/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32/stm32f4discovery/scripts/Make.defs
b/boards/arm/stm32/stm32f4discovery/scripts/Make.defs
index 15a1b12afd..39a87f97a4 100644
--- a/boards/arm/stm32/stm32f4discovery/scripts/Make.defs
+++ b/boards/arm/stm32/stm32f4discovery/scripts/Make.defs
@@ -74,7 +74,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/stm32/stm32f4discovery/scripts/gnu-elf.ld
b/boards/arm/stm32/stm32f4discovery/scripts/gnu-elf.ld
deleted file mode 100644
index 46ab302e95..0000000000
--- a/boards/arm/stm32/stm32f4discovery/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32/stm32f4discovery/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32/stm32ldiscovery/scripts/gnu-elf.ld
b/boards/arm/stm32/stm32ldiscovery/scripts/gnu-elf.ld
deleted file mode 100644
index f81e96c4dd..0000000000
--- a/boards/arm/stm32/stm32ldiscovery/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32/stm32ldiscovery/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32f0l0g0/stm32f051-discovery/scripts/gnu-elf.ld
b/boards/arm/stm32f0l0g0/stm32f051-discovery/scripts/gnu-elf.ld
deleted file mode 100644
index b7371d8265..0000000000
--- a/boards/arm/stm32f0l0g0/stm32f051-discovery/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32f0l0g0/stm32f051-discovery/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32f0l0g0/stm32f072-discovery/scripts/gnu-elf.ld
b/boards/arm/stm32f0l0g0/stm32f072-discovery/scripts/gnu-elf.ld
deleted file mode 100644
index 11771a81ac..0000000000
--- a/boards/arm/stm32f0l0g0/stm32f072-discovery/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32f0l0g0/stm32f072-discovery/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32h7/nucleo-h743zi/scripts/Make.defs
b/boards/arm/stm32h7/nucleo-h743zi/scripts/Make.defs
index 9eef66b2e7..4d31f36ed5 100644
--- a/boards/arm/stm32h7/nucleo-h743zi/scripts/Make.defs
+++ b/boards/arm/stm32h7/nucleo-h743zi/scripts/Make.defs
@@ -57,7 +57,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/stm32h7/nucleo-h743zi/scripts/gnu-elf.ld
b/boards/arm/stm32h7/nucleo-h743zi/scripts/gnu-elf.ld
deleted file mode 100644
index 6175e44d40..0000000000
--- a/boards/arm/stm32h7/nucleo-h743zi/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32h7/nucleo-h743zi/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/stm32h7/nucleo-h743zi2/scripts/Make.defs
b/boards/arm/stm32h7/nucleo-h743zi2/scripts/Make.defs
index 20e1eb3d6f..732e777d06 100644
--- a/boards/arm/stm32h7/nucleo-h743zi2/scripts/Make.defs
+++ b/boards/arm/stm32h7/nucleo-h743zi2/scripts/Make.defs
@@ -57,7 +57,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/stm32h7/nucleo-h743zi2/scripts/gnu-elf.ld
b/boards/arm/stm32h7/nucleo-h743zi2/scripts/gnu-elf.ld
deleted file mode 100644
index 153acc0695..0000000000
--- a/boards/arm/stm32h7/nucleo-h743zi2/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
- * boards/arm/stm32h7/nucleo-h743zi2/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/tiva/lm3s6965-ek/scripts/Make.defs
b/boards/arm/tiva/lm3s6965-ek/scripts/Make.defs
index a69f692b84..6333635e37 100644
--- a/boards/arm/tiva/lm3s6965-ek/scripts/Make.defs
+++ b/boards/arm/tiva/lm3s6965-ek/scripts/Make.defs
@@ -73,7 +73,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/tiva/lm3s6965-ek/scripts/gnu-elf.ld
b/boards/arm/tiva/lm3s6965-ek/scripts/gnu-elf.ld
deleted file mode 100644
index cbf5a9814b..0000000000
--- a/boards/arm/tiva/lm3s6965-ek/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
- * boards/arm/tiva/lm3s6965-ek/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/arm/tms570/launchxl-tms57004/scripts/Make.defs
b/boards/arm/tms570/launchxl-tms57004/scripts/Make.defs
index d849a4777f..220275b05c 100644
--- a/boards/arm/tms570/launchxl-tms57004/scripts/Make.defs
+++ b/boards/arm/tms570/launchxl-tms57004/scripts/Make.defs
@@ -60,7 +60,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/arm/tms570/tms570ls31x-usb-kit/scripts/Make.defs
b/boards/arm/tms570/tms570ls31x-usb-kit/scripts/Make.defs
index 98cdafef8b..9694c1b555 100644
--- a/boards/arm/tms570/tms570ls31x-usb-kit/scripts/Make.defs
+++ b/boards/arm/tms570/tms570ls31x-usb-kit/scripts/Make.defs
@@ -59,7 +59,7 @@ CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/avr/atmega/amber/scripts/gnu-elf.ld
b/boards/avr/atmega/amber/scripts/gnu-elf.ld
deleted file mode 100644
index 9abb436ae1..0000000000
--- a/boards/avr/atmega/amber/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
- * boards/avr/atmega/amber/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .ARM.extab :
- {
- *(.ARM.extab*)
- }
-
- .ARM.exidx :
- {
- *(.ARM.exidx*)
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/risc-v/bl602/bl602evb/scripts/Make.defs
b/boards/risc-v/bl602/bl602evb/scripts/Make.defs
index 20d5f04c21..f07dc8ac53 100644
--- a/boards/risc-v/bl602/bl602evb/scripts/Make.defs
+++ b/boards/risc-v/bl602/bl602evb/scripts/Make.defs
@@ -64,7 +64,7 @@ CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)
LDELFFLAGS = -melf32lriscv -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
LDFLAGS += -melf32lriscv
diff --git a/boards/risc-v/bl602/bl602evb/scripts/gnu-elf.ld
b/boards/risc-v/bl602/bl602evb/scripts/gnu-elf.ld
deleted file mode 100644
index 8bce6c2f1a..0000000000
--- a/boards/risc-v/bl602/bl602evb/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
- * boards/risc-v/bl602/bl602evb/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/risc-v/c906/smartl-c906/scripts/Make.defs
b/boards/risc-v/c906/smartl-c906/scripts/Make.defs
index ea3408ab04..5fcc4738cf 100644
--- a/boards/risc-v/c906/smartl-c906/scripts/Make.defs
+++ b/boards/risc-v/c906/smartl-c906/scripts/Make.defs
@@ -73,7 +73,7 @@ CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
# File extensions
diff --git a/boards/risc-v/c906/smartl-c906/scripts/gnu-elf.ld
b/boards/risc-v/c906/smartl-c906/scripts/gnu-elf.ld
deleted file mode 100644
index bc6180c021..0000000000
--- a/boards/risc-v/c906/smartl-c906/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
- * boards/risc-v/c906/smartl-c906/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/risc-v/k210/maix-bit/scripts/Make.defs
b/boards/risc-v/k210/maix-bit/scripts/Make.defs
index d8aea87887..2c2b83cc0f 100644
--- a/boards/risc-v/k210/maix-bit/scripts/Make.defs
+++ b/boards/risc-v/k210/maix-bit/scripts/Make.defs
@@ -63,7 +63,7 @@ CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
# File extensions
diff --git a/boards/risc-v/k210/maix-bit/scripts/gnu-elf.ld
b/boards/risc-v/k210/maix-bit/scripts/gnu-elf.ld
deleted file mode 100644
index 8e24692df2..0000000000
--- a/boards/risc-v/k210/maix-bit/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
- * boards/risc-v/k210/maix-bit/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/risc-v/mpfs/icicle/scripts/Make.defs
b/boards/risc-v/mpfs/icicle/scripts/Make.defs
index b13aeee99e..2d66e286bf 100755
--- a/boards/risc-v/mpfs/icicle/scripts/Make.defs
+++ b/boards/risc-v/mpfs/icicle/scripts/Make.defs
@@ -88,7 +88,7 @@ CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
# File extensions
diff --git a/boards/risc-v/mpfs/icicle/scripts/gnu-elf.ld
b/boards/risc-v/mpfs/icicle/scripts/gnu-elf.ld
deleted file mode 100755
index b513bc6063..0000000000
--- a/boards/risc-v/mpfs/icicle/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
- * boards/risc-v/mpfs/icicle/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/risc-v/mpfs/m100pfsevp/scripts/Make.defs
b/boards/risc-v/mpfs/m100pfsevp/scripts/Make.defs
index a15e261d01..9673e7a63f 100755
--- a/boards/risc-v/mpfs/m100pfsevp/scripts/Make.defs
+++ b/boards/risc-v/mpfs/m100pfsevp/scripts/Make.defs
@@ -73,7 +73,7 @@ CELFFLAGS = $(CFLAGS)
CXXELFFLAGS = $(CXXFLAGS)
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
# File extensions
diff --git a/boards/risc-v/mpfs/m100pfsevp/scripts/gnu-elf.ld
b/boards/risc-v/mpfs/m100pfsevp/scripts/gnu-elf.ld
deleted file mode 100755
index a31737ff41..0000000000
--- a/boards/risc-v/mpfs/m100pfsevp/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
- * boards/risc-v/mpfs/m100pfsevp/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/sim/sim/sim/scripts/Make.defs
b/boards/sim/sim/sim/scripts/Make.defs
index fb6bad3a97..d625a0a0e1 100644
--- a/boards/sim/sim/sim/scripts/Make.defs
+++ b/boards/sim/sim/sim/scripts/Make.defs
@@ -211,7 +211,7 @@ ifeq ($(CONFIG_LIBC_ARCH_ELF_64BIT),y)
endif
LDELFFLAGS = -r -e main --gc-sections
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_HOST_MACOS),y)
LDFLAGS += -Wl,-dead_strip
diff --git a/boards/sim/sim/sim/scripts/gnu-elf.ld
b/boards/sim/sim/sim/scripts/gnu-elf.ld
deleted file mode 100644
index 47cd5c7d50..0000000000
--- a/boards/sim/sim/sim/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
- * boards/sim/sim/sim/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-ENTRY(main)
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.glue_7)
- *(.glue_7t)
- *(.jcr)
-
- /* C++ support: The .init and .fini sections contain specific logic
- * to manage static constructors and destructors.
- */
-
- *(.gnu.linkonce.t.*)
- *(.init) /* Old ABI */
- *(.fini) /* Old ABI */
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- /* C++ support. For each global and static local C++ object,
- * GCC creates a small subroutine to construct the object. Pointers
- * to these routines (not the routines themselves) are stored as
- * simple, linear arrays in the .ctors section of the object file.
- * Similarly, pointers to global/static destructor routines are
- * stored in .dtors.
- */
-
- .ctors :
- {
- _sctors = . ;
- *(.ctors) /* Old ABI: Unallocated */
- *(.init_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .dtors :
- {
- _sdtors = . ;
- *(.dtors) /* Old ABI: Unallocated */
- *(.fini_array) /* New ABI: Allocated */
- _edtors = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/boards/sparc/bm3803/xx3803/scripts/gnu-elf.ld
b/boards/sparc/bm3803/xx3803/scripts/gnu-elf.ld
deleted file mode 100644
index 71f7620e89..0000000000
--- a/boards/sparc/bm3803/xx3803/scripts/gnu-elf.ld
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
- * boards/sparc/bm3803/xx3803/scripts/gnu-elf.ld
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership. The
- * ASF licenses this file to you 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.
- *
- ****************************************************************************/
-
-SECTIONS
-{
- .text 0x00000000 :
- {
- _stext = . ;
- *(.text)
- *(.text.*)
- *(.gnu.warning)
- *(.stub)
- *(.jcr)
- _etext = . ;
- }
-
- .rodata :
- {
- _srodata = . ;
- *(.rodata)
- *(.rodata1)
- *(.rodata.*)
- *(.gnu.linkonce.r*)
- _erodata = . ;
- }
-
-
- .data :
- {
- _sdata = . ;
- *(.data)
- *(.data1)
- *(.data.*)
- *(.gnu.linkonce.d*)
- . = ALIGN(4);
- _edata = . ;
- }
-
- .bss :
- {
- _sbss = . ;
- *(.bss)
- *(.bss.*)
- *(.sbss)
- *(.sbss.*)
- *(.gnu.linkonce.b*)
- *(COMMON)
- . = ALIGN(4);
- _ebss = . ;
- }
-
- /* Stabs debugging sections. */
-
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-
-}
diff --git a/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs
b/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs
index 27e7b40d00..fc8b889ef5 100644
--- a/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs
+++ b/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs
@@ -72,7 +72,7 @@ CELFFLAGS = $(CFLAGS) -mtext-section-literals
CXXELFFLAGS = $(CXXFLAGS) -mtext-section-literals
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
diff --git a/boards/xtensa/esp32s3/esp32s3-devkit/scripts/Make.defs
b/boards/xtensa/esp32s3/esp32s3-devkit/scripts/Make.defs
index c2bf6202f1..84b8348763 100644
--- a/boards/xtensa/esp32s3/esp32s3-devkit/scripts/Make.defs
+++ b/boards/xtensa/esp32s3/esp32s3-devkit/scripts/Make.defs
@@ -62,7 +62,7 @@ CELFFLAGS = $(CFLAGS) -mtext-section-literals
CXXELFFLAGS = $(CXXFLAGS) -mtext-section-literals
LDELFFLAGS = -r -e main
-LDELFFLAGS += -T $(call
CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
+LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/binfmt/libelf/gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g