diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-09-07 12:11:45 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-09-07 13:47:02 -0600 |
commit | 49a83a0b9398633d3721f53cb4e34141be79ba69 (patch) | |
tree | 759ee7db870df139e2eb936bd71da3890390f615 /nuttx/configs | |
parent | fd27da194c956e624c9a6e69a368ececaa4b2b27 (diff) | |
download | px4-nuttx-49a83a0b9398633d3721f53cb4e34141be79ba69.tar.gz px4-nuttx-49a83a0b9398633d3721f53cb4e34141be79ba69.tar.bz2 px4-nuttx-49a83a0b9398633d3721f53cb4e34141be79ba69.zip |
Need to call elf_initialize() on bring-up before attempting to load ELF modules
Diffstat (limited to 'nuttx/configs')
-rw-r--r-- | nuttx/configs/sama5d4-ek/src/sam_bringup.c | 27 | ||||
-rw-r--r-- | nuttx/configs/sama5d4-ek/src/sama5d4-ek.h | 7 |
2 files changed, 29 insertions, 5 deletions
diff --git a/nuttx/configs/sama5d4-ek/src/sam_bringup.c b/nuttx/configs/sama5d4-ek/src/sam_bringup.c index ab6f4de18..b1c795fb8 100644 --- a/nuttx/configs/sama5d4-ek/src/sam_bringup.c +++ b/nuttx/configs/sama5d4-ek/src/sam_bringup.c @@ -50,6 +50,8 @@ # include <apps/usbmonitor.h> #endif +#include <nuttx/binfmt/elf.h> + #include "sama5d4-ek.h" /**************************************************************************** @@ -58,10 +60,14 @@ /* Debug ********************************************************************/ -#ifdef CONFIG_CPP_HAVE_VARARGS -# define message(...) syslog(__VA_ARGS__) +#ifdef CONFIG_BOARD_INITIALIZE +# define message lldbg #else -# define message syslog +# ifdef CONFIG_CPP_HAVE_VARARGS +# define message(...) syslog(__VA_ARGS__) +# else +# define message syslog +# endif #endif /**************************************************************************** @@ -78,9 +84,9 @@ int sam_bringup(void) { -#if defined(HAVE_NAND) || defined(HAVE_AT25) || defined(HAVE_HSMCI) || \ +#if defined(HAVE_NAND) || defined(HAVE_AT25) || defined(HAVE_HSMCI) || \ defined(HAVE_USBHOST) || defined(HAVE_USBMONITOR) || defined(HAVE_WM8904) || \ - defined(HAVE_AUTOMOUNTER) + defined(HAVE_AUTOMOUNTER) || defined(HAVE_ELF) int ret; #endif @@ -212,6 +218,17 @@ int sam_bringup(void) } #endif +#ifdef HAVE_ELF + /* Initialize the ELF binary loader */ + + message("Initializing the ELF binary loader\n"); + ret = elf_initialize(); + if (ret < 0) + { + message("ERROR: Initialization of the ELF loader failed: %d\n", ret); + } +#endif + /* If we got here then perhaps not all initialization was successful, but * at least enough succeeded to bring-up NSH with perhaps reduced * capabilities. diff --git a/nuttx/configs/sama5d4-ek/src/sama5d4-ek.h b/nuttx/configs/sama5d4-ek/src/sama5d4-ek.h index ee898be3e..dbcc0987f 100644 --- a/nuttx/configs/sama5d4-ek/src/sama5d4-ek.h +++ b/nuttx/configs/sama5d4-ek/src/sama5d4-ek.h @@ -68,6 +68,7 @@ #define HAVE_WM8904 1 #define HAVE_AUDIO_NULL 1 #define HAVE_PMIC 1 +#define HAVE_ELF 1 /* HSMCI */ /* Can't support MMC/SD if the card interface(s) are not enable */ @@ -455,6 +456,12 @@ # undef HAVE_PMIC /* REVISIT: Disable anyway because it does not yet work */ #endif +/* ELF */ + +#if defined(CONFIG_BINFMT_DISABLE) || !defined(CONFIG_ELF) +# undef HAVE_ELF +#endif + /* LEDs *****************************************************************************/ /* There are 3 LEDs on the SAMA5D4-EK: * |