diff --git a/arch/risc-v/src/common/Toolchain.defs b/arch/risc-v/src/common/Toolchain.defs index 41beb62335..4600f915fb 100644 --- a/arch/risc-v/src/common/Toolchain.defs +++ b/arch/risc-v/src/common/Toolchain.defs @@ -114,8 +114,11 @@ ifneq ($(CONFIG_CXX_RTTI),y) ARCHCXXFLAGS += -fno-rtti endif +SHMODULEFLAGS = -Bsymbolic -G -Bdynamic --entry=__start + ifeq ($(CONFIG_ARCH_RV32),y) LDFLAGS += -melf32lriscv +SHMODULEFLAGS += -melf32lriscv else LDFLAGS += -melf64lriscv endif diff --git a/arch/xtensa/src/lx6/Toolchain.defs b/arch/xtensa/src/lx6/Toolchain.defs index 0417bef85a..a02d98e147 100644 --- a/arch/xtensa/src/lx6/Toolchain.defs +++ b/arch/xtensa/src/lx6/Toolchain.defs @@ -134,6 +134,8 @@ endif LDFLAGS += -nostdlib +SHMODULEFLAGS = -Bsymbolic -G -Bdynamic --entry=__start + # Optimization of unused sections ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) diff --git a/arch/xtensa/src/lx7/Toolchain.defs b/arch/xtensa/src/lx7/Toolchain.defs index c46fcca9d2..e4a2b10b28 100644 --- a/arch/xtensa/src/lx7/Toolchain.defs +++ b/arch/xtensa/src/lx7/Toolchain.defs @@ -138,6 +138,8 @@ endif LDFLAGS += -nostdlib +SHMODULEFLAGS = -Bsymbolic -G -Bdynamic --entry=__start + # Optimization of unused sections ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) diff --git a/boards/arm64/qemu/qemu-armv8a/scripts/Make.defs b/boards/arm64/qemu/qemu-armv8a/scripts/Make.defs index fce2c86eea..2b76e1b08d 100644 --- a/boards/arm64/qemu/qemu-armv8a/scripts/Make.defs +++ b/boards/arm64/qemu/qemu-armv8a/scripts/Make.defs @@ -46,6 +46,8 @@ CMODULEFLAGS = $(CFLAGS) LDMODULEFLAGS = -r -e module_initialize LDMODULEFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/libs/libc/modlib/gnu-elf.ld) +SHMODULEFLAGS = -Bsymbolic -G -Bdynamic + CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs diff --git a/boards/sim/sim/sim/scripts/Make.defs b/boards/sim/sim/sim/scripts/Make.defs index c9530c01b8..c67fb73021 100644 --- a/boards/sim/sim/sim/scripts/Make.defs +++ b/boards/sim/sim/sim/scripts/Make.defs @@ -290,7 +290,7 @@ ifeq ($(CONFIG_DEBUG_LINK_MAP),y) endif SHCCFLAGS = -fPIC -fPIE -fvisibility=default -SHLDFLAGS = -shared -Bsymbolic -Bdynamic -G +SHMODULEFLAGS = -shared -Bsymbolic -Bdynamic -G ifeq ($(CONFIG_DEBUG_LINK_MAP),y) ifeq ($(CONFIG_HOST_MACOS),) @@ -302,6 +302,6 @@ ifeq ($(CONFIG_SIM_M32),y) LDLINKFLAGS += -melf_i386 LDFLAGS += -m32 LDMODULEFLAGS += -melf_i386 - SHLDFLAGS += -melf_i386 + SHMODULEFLAGS += -melf_i386 LDELFFLAGS += -melf_i386 endif