arch: add BR2_READELF_ARCH_NAME hidden config option
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 19 Mar 2017 13:07:51 +0000 (14:07 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 20 Mar 2017 21:22:17 +0000 (22:22 +0100)
This config option corresponds to the string returned by readelf for
the "Machine" field of the ELF header. It will be used to check if the
architecture of binaries built by Buildroot match the target
architecture.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
15 files changed:
arch/Config.in
arch/Config.in.arc
arch/Config.in.arm
arch/Config.in.bfin
arch/Config.in.csky
arch/Config.in.m68k
arch/Config.in.microblaze
arch/Config.in.mips
arch/Config.in.nios2
arch/Config.in.or1k
arch/Config.in.powerpc
arch/Config.in.sh
arch/Config.in.sparc
arch/Config.in.x86
arch/Config.in.xtensa

index 65a33fbb64aee2a45a7ad2525c37b7755e25fe8c..50377a9af8752068e8bdaba50d453917ffa2dde4 100644 (file)
@@ -292,6 +292,12 @@ config BR2_GCC_TARGET_MODE
 config BR2_BINFMT_SUPPORTS_SHARED
        bool
 
+# Must match the name of the architecture from readelf point of view,
+# i.e the "Machine:" field of readelf output. See get_machine_name()
+# in binutils/readelf.c for the list of possible values.
+config BR2_READELF_ARCH_NAME
+       string
+
 # Set up target binary format
 choice
        prompt "Target Binary Format"
index 7d341f31366c5e46364b22f65b580454fe47d460..dcdba68749adb3ae5c46ebff8d2b067d23e2f189 100644 (file)
@@ -38,6 +38,9 @@ config BR2_GCC_TARGET_CPU
        default "arc700" if BR2_arc770d
        default "archs"  if BR2_archs38
 
+config BR2_READELF_ARCH_NAME
+       default "ARCv2"
+
 choice
        prompt "MMU Page Size"
        default BR2_ARC_PAGE_SIZE_8K
index 2617976f135e095231167ce0a3246ec00cbe9dac..f910364960eec1ba8ff6fe70377fca0eb0090637 100644 (file)
@@ -568,3 +568,7 @@ config BR2_GCC_TARGET_FLOAT_ABI
 config BR2_GCC_TARGET_MODE
        default "arm"           if BR2_ARM_INSTRUCTIONS_ARM
        default "thumb"         if BR2_ARM_INSTRUCTIONS_THUMB || BR2_ARM_INSTRUCTIONS_THUMB2
+
+config BR2_READELF_ARCH_NAME
+       default "ARM"           if BR2_arm || BR2_armeb
+       default "AArch64"       if BR2_aarch64 || BR2_aarch64_be
index 9f7056a6dcb28b0ecfea59fb287d33fe02497585..90e4ab97b0d10abc6f85219790430a7b8e61aafc 100644 (file)
@@ -105,3 +105,6 @@ config BR2_GCC_TARGET_CPU_REVISION
          value of the -mcpu option. For example, if the selected CPU is
          bf609, and then selected CPU revision is "0.0", then gcc will
          receive the -mcpu=bf609-0.0 option.
+
+config BR2_READELF_ARCH_NAME
+       default "Analog Devices Blackfin"
index 7029c6047f5668dda0ff5367986ca09375ba35a2..e88e4e2d121d11c028c2cc346a539444a099c41d 100644 (file)
@@ -44,3 +44,5 @@ config BR2_GCC_TARGET_CPU
        default "ck810f"        if (BR2_ck810 &&  BR2_CSKY_FPU && !BR2_CSKY_DSP)
        default "ck810ef"       if (BR2_ck810 &&  BR2_CSKY_FPU &&  BR2_CSKY_DSP)
 
+config BR2_READELF_ARCH_NAME
+       default "CSKY"
index ced871f58bfeee59e7c40b2fbc3e6e9f8a3d5600..c56031cb780b30796365dcd6e6ffef1e2784fc4e 100644 (file)
@@ -35,3 +35,6 @@ endchoice
 config BR2_GCC_TARGET_CPU
        default "68040"         if BR2_m68k_68040
        default "5208"          if BR2_m68k_cf5208
+
+config BR2_READELF_ARCH_NAME
+       default "MC68000"
index 2d4c1fec439d470be55ed4fcc6703e54b892cbea..042712a1b68d04903fde27861c4a8eb95db6c425 100644 (file)
@@ -6,6 +6,9 @@ config BR2_ENDIAN
        default "LITTLE" if BR2_microblazeel
        default "BIG"    if BR2_microblazebe
 
+config BR2_READELF_ARCH_NAME
+       default "Xilinx MicroBlaze"
+
 config BR2_microblaze
        bool
        default y if BR2_microblazeel || BR2_microblazebe
index ce41e9e725f3a9bf52429f6e9e43c4033edc4121..22819d02536a206266f12d783058032db1b8db7e 100644 (file)
@@ -161,3 +161,6 @@ config BR2_GCC_TARGET_ABI
        default "32"            if BR2_MIPS_OABI32
        default "n32"           if BR2_MIPS_NABI32
        default "64"            if BR2_MIPS_NABI64
+
+config BR2_READELF_ARCH_NAME
+       default "MIPS R3000"
index ed638981aaa275e5dbecf49451b04862c3ba1abf..7466331016b91ccc66df22fc2410179b31ab9c3f 100644 (file)
@@ -3,3 +3,6 @@ config BR2_ARCH
 
 config BR2_ENDIAN
        default "LITTLE"
+
+config BR2_READELF_ARCH_NAME
+       default "Altera Nios II"
index dba64a6ac9c1f12d2995258b567dffe247046751..b31ab3e95b6fddb76da48807d7ba93b906f68a1c 100644 (file)
@@ -3,3 +3,6 @@ config BR2_ARCH
 
 config BR2_ENDIAN
        default "BIG"
+
+config BR2_READELF_ARCH_NAME
+       default "OpenRISC 1000"
index 09ac794d61b6582bcb3295b0e2900c76f74c1a1c..09684126472742598d0d4e5d19553b09562fc6a1 100644 (file)
@@ -212,3 +212,7 @@ config BR2_GCC_TARGET_ABI
        default "no-spe"                if BR2_PPC_ABI_no-spe
        default "ibmlongdouble"         if BR2_PPC_ABI_ibmlongdouble
        default "ieeelongdouble"        if BR2_PPC_ABI_ieeelongdouble
+
+config BR2_READELF_ARCH_NAME
+       default "PowerPC"       if BR2_powerpc
+       default "PowerPC64"     if BR2_powerpc64 || BR2_powerpc64le
index 4705212583aa8af58e20cc806961d16cfb9fca3c..deb7244f291f2b8ea955efc31cc4c900eb95e92a 100644 (file)
@@ -27,3 +27,6 @@ config BR2_ARCH
 config BR2_ENDIAN
        default "LITTLE"        if BR2_sh4 || BR2_sh4a
        default "BIG"           if BR2_sh2a || BR2_sh4eb || BR2_sh4aeb
+
+config BR2_READELF_ARCH_NAME
+       default "Renesas / SuperH SH"
index 307540fdbf011522b54cdf5484ba7072e792b0c9..9b6a6aa21aaf6603a42c3cb5728b0d87971b553c 100644 (file)
@@ -28,3 +28,7 @@ config BR2_GCC_TARGET_CPU
        default "leon3"         if BR2_sparc_leon3
        default "v8"            if BR2_sparc_v8
        default "ultrasparc"    if BR2_sparc_v9
+
+config BR2_READELF_ARCH_NAME
+       default "Sparc"         if BR2_sparc
+       default "Sparc v9"      if BR2_sparc64
index efa9567811765c36a52b52b3d4081265a9be8196..0d9e93b089dfe0734e9be9c847e54d0d4cf09207 100644 (file)
@@ -275,3 +275,7 @@ config BR2_GCC_TARGET_ARCH
        default "c3"            if BR2_x86_c3
        default "c3-2"          if BR2_x86_c32
        default "geode"         if BR2_x86_geode
+
+config BR2_READELF_ARCH_NAME
+       default "Intel 80386"                   if BR2_i386
+       default "Advanced Micro Devices X86-64" if BR2_x86_64
index fcb3dc926f923274aac379354f2152cb457548c8..88dbe18feeee3fef734e0a9b59dc96ee2d6dfac8 100644 (file)
@@ -54,3 +54,6 @@ config BR2_ENDIAN
 
 config BR2_ARCH
        default "xtensa"        if BR2_xtensa
+
+config BR2_READELF_ARCH_NAME
+       default "Tensilica Xtensa Processor"