@@ -211,6 +211,32 @@ config BR2_BINFMT_FLAT
endchoice
+# Set up flat binary type
+choice
+ prompt "FLAT Binary type"
+ depends on BR2_BINFMT_FLAT
+ default BR2_BINFMT_FLAT_ONE
+
+config BR2_BINFMT_FLAT_ONE
+ bool "One memory region"
+ help
+ All segments are linked into one memory region.
+
+config BR2_BINFMT_FLAT_SEP_DATA
+ bool "Separate data and code region"
+ depends on BR2_bfin || BR2_m68k
+ help
+ Allow for the data and text segments to be separated and placed in
+ different regions of memory.
+
+config BR2_BINFMT_FLAT_SHARED
+ bool "Shared binary"
+ depends on BR2_bfin || BR2_m68k
+ help
+ Allow to load and link indiviual FLAT binaries at run time.
+
+endchoice
+
if BR2_arm || BR2_armeb
source "arch/Config.in.arm"
endif
@@ -168,6 +168,14 @@ ifeq ($(BR2_BINFMT_FLAT),y)
TOOLCHAIN_EXTERNAL_CFLAGS += -Wl,-elf2flt
TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT
endif
+ifeq ($(BR2_BINFMT_FLAT_SEP_DATA),y)
+TOOLCHAIN_EXTERNAL_CFLAGS += -msep-data
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT_SEP_DATA
+endif
+ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
+TOOLCHAIN_EXTERNAL_CFLAGS += -mid-shared-library -mshared-library-id=0
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT_SHARED
+endif
ifneq ($(BR2_TARGET_OPTIMIZATION),)
TOOLCHAIN_EXTERNAL_CFLAGS += $(call qstrip,$(BR2_TARGET_OPTIMIZATION))
@@ -50,6 +50,13 @@ static char *predef_args[] = {
#ifdef BR_BINFMT_FLAT
"-Wl,-elf2flt",
#endif
+#ifdef BR_BINFMT_FLAT_SEP_DATA
+ "-msep-data",
+#endif
+#ifdef BR_BINFMT_FLAT_SHARED
+ "-mid-shared-library",
+ "-mshared-library-id=0",
+#endif
#ifdef BR_ADDITIONAL_CFLAGS
BR_ADDITIONAL_CFLAGS
#endif