summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-06-25 22:25:30 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-06-25 22:25:30 +0000
commit3613119317b5e5b9e2e45311f9e42629562c0885 (patch)
tree88ff7c69e68f59cf705dfff6217516924f0fcc90
parentae9d6c8fa77b4f18594f11b603d27a9a8146a632 (diff)
downloadnuttx-3613119317b5e5b9e2e45311f9e42629562c0885.tar.gz
nuttx-3613119317b5e5b9e2e45311f9e42629562c0885.tar.bz2
nuttx-3613119317b5e5b9e2e45311f9e42629562c0885.zip
ROMFS was in RAM
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1954 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/binfmt/nxflat.c16
-rw-r--r--nuttx/examples/nxflat/tests/Makefile2
2 files changed, 12 insertions, 6 deletions
diff --git a/nuttx/binfmt/nxflat.c b/nuttx/binfmt/nxflat.c
index f4eac0fcf..0c179053a 100644
--- a/nuttx/binfmt/nxflat.c
+++ b/nuttx/binfmt/nxflat.c
@@ -158,7 +158,7 @@ static int nxflat_loadbinary(struct binary_s *binp)
if (ret != 0)
{
bdbg("Failed to initialize for load of NXFLT program: %d\n", ret);
- return ret;
+ goto errout;
}
/* Load the program binary */
@@ -168,8 +168,7 @@ static int nxflat_loadbinary(struct binary_s *binp)
if (ret != 0)
{
bdbg("Failed to load NXFLT program binary: %d\n", ret);
- nxflat_uninit(&loadinfo);
- return ret;
+ goto errout_with_init;
}
/* Bind the program to the exported symbol table */
@@ -178,8 +177,7 @@ static int nxflat_loadbinary(struct binary_s *binp)
if (ret != 0)
{
bdbg("Failed to bind symbols program binary: %d\n", ret);
- nxflat_uninit(&loadinfo);
- return ret;
+ goto errout_with_load;
}
/* Return the load information */
@@ -192,8 +190,16 @@ static int nxflat_loadbinary(struct binary_s *binp)
nxflat_dumpbuffer("Entry code", (FAR const ubyte*)binp->entrypt,
MIN(binp->isize - loadinfo.entryoffs,512));
+
nxflat_uninit(&loadinfo);
return OK;
+
+errout_with_load:
+ nxflat_unload(&loadinfo);
+errout_with_init:
+ nxflat_uninit(&loadinfo);
+errout:
+ return ret;
}
/***********************************************************************
diff --git a/nuttx/examples/nxflat/tests/Makefile b/nuttx/examples/nxflat/tests/Makefile
index 1a7c64ef6..638b2548c 100644
--- a/nuttx/examples/nxflat/tests/Makefile
+++ b/nuttx/examples/nxflat/tests/Makefile
@@ -82,7 +82,7 @@ $(ROMFS_IMG): populate
# Create the romfs.h header file from the romfs.img file
$(ROMFS_HDR) : $(ROMFS_IMG)
- @(cd $(TESTS_DIR); xxd -i romfs.img >$@)
+ @(cd $(TESTS_DIR); xxd -i romfs.img | sed -e "s/^unsigned/static const unsigned/g" >$@)
# Create the dirlist.h header file from the romfs directory