arch: toolchain: Introduce binary format FLAT types.
authorSonic Zhang <sonic.zhang@analog.com>
Fri, 3 May 2013 10:39:37 +0000 (18:39 +0800)
committerPeter Korsgaard <jacmet@sunsite.dk>
Sun, 5 May 2013 20:54:37 +0000 (22:54 +0200)
Just introduce the symbol and options in arch generic Config.in.
Add FLAT types specific compiling flags into package makefile.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
arch/Config.in
package/Makefile.in

index fa9dad3432159c20413500f0b700e631da401f52..5ca05cdde6d211c4d7e74fe539547396c7abee86 100644 (file)
@@ -226,6 +226,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_arcle || BR2_arceb
 source "arch/Config.in.arc"
 endif
index a8bf36b1849ae1050fc7e875ab3a97667fcccd90..dd3bc7d1a5575f3c5c1675f681bdf45e87ff094e 100644 (file)
@@ -103,6 +103,17 @@ TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET
 TARGET_CXXFLAGS = $(TARGET_CFLAGS)
 TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS))
 
+ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
+TARGET_LDFLAGS += -mid-shared-library -mshared-library-id=0
+TARGET_CFLAGS += -mid-shared-library -mshared-library-id=0
+TARGET_CXXFLAGS += -mid-shared-library -mshared-library-id=0
+endif
+ifeq ($(BR2_BINFMT_FLAT_SEP_DATA),y)
+TARGET_LDFLAGS += -msep-data
+TARGET_CFLAGS += -msep-data
+TARGET_CXXFLAGS += -msep-data
+endif
+
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y)
 TARGET_CROSS=$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-
 else