diff --git a/binfmt/elf.c b/binfmt/elf.c index 85fbe300aa..ef225ec06e 100644 --- a/binfmt/elf.c +++ b/binfmt/elf.c @@ -277,9 +277,10 @@ static int elf_loadbinary(FAR struct binary_s *binp, up_addrenv_clone(&loadinfo.addrenv, &binp->addrenv); #else binp->alloc[0] = (FAR void *)loadinfo.textalloc; + binp->alloc[1] = (FAR void *)loadinfo.dataalloc; #ifdef CONFIG_BINFMT_CONSTRUCTORS - binp->alloc[1] = loadinfo.ctoralloc; - binp->alloc[2] = loadinfo.dtoralloc; + binp->alloc[2] = loadinfo.ctoralloc; + binp->alloc[3] = loadinfo.dtoralloc; #endif #endif diff --git a/include/nuttx/binfmt/binfmt.h b/include/nuttx/binfmt/binfmt.h index 8c17d8f53b..e730551628 100644 --- a/include/nuttx/binfmt/binfmt.h +++ b/include/nuttx/binfmt/binfmt.h @@ -39,7 +39,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define BINFMT_NALLOC 3 +#define BINFMT_NALLOC 4 /**************************************************************************** * Public Types