You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by bt...@apache.org on 2020/06/01 04:38:44 UTC
[incubator-nuttx] 02/02: arch: Select 64bit elf base on the
architecture characteristic
This is an automated email from the ASF dual-hosted git repository.
btashton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit b932b653dd5979f9ae6dc5acac5461ec8b41fc0d
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Jun 1 02:41:11 2020 +0800
arch: Select 64bit elf base on the architecture characteristic
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
Change-Id: I09eec5a76f255016a910cfec3b3f70cd7577525e
---
arch/Kconfig | 1 +
arch/risc-v/Kconfig | 1 +
arch/sim/Kconfig | 1 +
binfmt/Kconfig | 7 -------
boards/risc-v/k210/maix-bit/configs/elf/defconfig | 1 -
boards/risc-v/k210/maix-bit/configs/module/defconfig | 1 -
boards/risc-v/k210/maix-bit/configs/posix_spawn/defconfig | 1 -
boards/sim/sim/sim/configs/module/defconfig | 1 -
include/elf.h | 2 +-
libs/libc/machine/Kconfig | 5 +++++
10 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index d157c4d..eaebb89 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -84,6 +84,7 @@ config ARCH_X86
config ARCH_X86_64
bool "x86_64"
+ select LIBC_ARCH_ELF_64BIT if LIBC_ARCH_ELF
---help---
x86-64 architectures.
diff --git a/arch/risc-v/Kconfig b/arch/risc-v/Kconfig
index c7a4115..5b23671 100644
--- a/arch/risc-v/Kconfig
+++ b/arch/risc-v/Kconfig
@@ -58,6 +58,7 @@ config ARCH_RV32IM
config ARCH_RV64GC
bool
default n
+ select LIBC_ARCH_ELF_64BIT if LIBC_ARCH_ELF
config ARCH_FAMILY
string
diff --git a/arch/sim/Kconfig b/arch/sim/Kconfig
index 6e8a72e..6ffd1a1 100644
--- a/arch/sim/Kconfig
+++ b/arch/sim/Kconfig
@@ -13,6 +13,7 @@ choice
config HOST_X86_64
bool "x86_64"
select ARCH_HAVE_STACKCHECK
+ select LIBC_ARCH_ELF_64BIT if LIBC_ARCH_ELF && !SIM_M32
config HOST_X86
bool "x86"
diff --git a/binfmt/Kconfig b/binfmt/Kconfig
index 300a137..15e878a 100644
--- a/binfmt/Kconfig
+++ b/binfmt/Kconfig
@@ -10,13 +10,6 @@ config BINFMT_DISABLE
By default, support for loadable binary formats is built. This logic
may be suppressed be defining this setting.
-config ELF_64BIT
- bool "64bit ELF support"
- default n
- depends on (!BINFMT_DISABLE && ELF) || LIBC_MODLIB
- ---help---
- This option is used to load 64bit ELF files
-
if !BINFMT_DISABLE
config PATH_INITIAL
diff --git a/boards/risc-v/k210/maix-bit/configs/elf/defconfig b/boards/risc-v/k210/maix-bit/configs/elf/defconfig
index c313c2c..8137908 100644
--- a/boards/risc-v/k210/maix-bit/configs/elf/defconfig
+++ b/boards/risc-v/k210/maix-bit/configs/elf/defconfig
@@ -21,7 +21,6 @@ CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEV_ZERO=y
CONFIG_ELF=y
-CONFIG_ELF_64BIT=y
CONFIG_ELF_ALIGN_LOG2=3
CONFIG_EXAMPLES_ELF=y
CONFIG_FS_PROCFS=y
diff --git a/boards/risc-v/k210/maix-bit/configs/module/defconfig b/boards/risc-v/k210/maix-bit/configs/module/defconfig
index dc0f20a..69f0059 100644
--- a/boards/risc-v/k210/maix-bit/configs/module/defconfig
+++ b/boards/risc-v/k210/maix-bit/configs/module/defconfig
@@ -21,7 +21,6 @@ CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEV_ZERO=y
CONFIG_ELF=y
-CONFIG_ELF_64BIT=y
CONFIG_ELF_ALIGN_LOG2=3
CONFIG_EXAMPLES_MODULE=y
CONFIG_FS_PROCFS=y
diff --git a/boards/risc-v/k210/maix-bit/configs/posix_spawn/defconfig b/boards/risc-v/k210/maix-bit/configs/posix_spawn/defconfig
index 974b668..b72cf8a 100644
--- a/boards/risc-v/k210/maix-bit/configs/posix_spawn/defconfig
+++ b/boards/risc-v/k210/maix-bit/configs/posix_spawn/defconfig
@@ -21,7 +21,6 @@ CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEV_ZERO=y
CONFIG_ELF=y
-CONFIG_ELF_64BIT=y
CONFIG_EXAMPLES_POSIXSPAWN=y
CONFIG_FS_PROCFS=y
CONFIG_FS_ROMFS=y
diff --git a/boards/sim/sim/sim/configs/module/defconfig b/boards/sim/sim/sim/configs/module/defconfig
index 12fb776..d1e0505 100644
--- a/boards/sim/sim/sim/configs/module/defconfig
+++ b/boards/sim/sim/sim/configs/module/defconfig
@@ -19,7 +19,6 @@ CONFIG_BUILTIN=y
CONFIG_CLOCK_MONOTONIC=y
CONFIG_DEV_LOOP=y
CONFIG_DEV_ZERO=y
-CONFIG_ELF_64BIT=y
CONFIG_EXAMPLES_MODULE=y
CONFIG_EXAMPLES_MODULE_DEVMINOR=4
CONFIG_EXAMPLES_MODULE_DEVPATH="/dev/ram4"
diff --git a/include/elf.h b/include/elf.h
index bff9a49..8f599d7 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -33,7 +33,7 @@
/* NOTE: elf64.h and elf32.h refer EI_NIDENT defined above */
-#ifdef CONFIG_ELF_64BIT
+#ifdef CONFIG_LIBC_ARCH_ELF_64BIT
# include <elf64.h>
#else
# include <elf32.h>
diff --git a/libs/libc/machine/Kconfig b/libs/libc/machine/Kconfig
index f0c34ac..e02f87e 100644
--- a/libs/libc/machine/Kconfig
+++ b/libs/libc/machine/Kconfig
@@ -88,6 +88,11 @@ config LIBC_ARCH_ELF
bool
default n
+config LIBC_ARCH_ELF_64BIT
+ bool
+ default n
+ depends on LIBC_ARCH_ELF
+
config LIBM_ARCH_CEIL
bool
default n