summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-19 21:16:03 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-19 21:16:03 +0000
commit1f5151d2c5574cbb57e57ea32416ca8970e0dec4 (patch)
tree96a1a335193aa75f1690a4226655ddbf2dc7bb73 /nuttx
parent913f876fac94f21a683809d9f648e4793f61e237 (diff)
downloadpx4-nuttx-1f5151d2c5574cbb57e57ea32416ca8970e0dec4.tar.gz
px4-nuttx-1f5151d2c5574cbb57e57ea32416ca8970e0dec4.tar.bz2
px4-nuttx-1f5151d2c5574cbb57e57ea32416ca8970e0dec4.zip
Some minor fixes for CONFIG_ADDRENV=y
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5444 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/binfmt/binfmt_unloadmodule.c2
-rw-r--r--nuttx/binfmt/libnxflat/libnxflat_addrenv.c1
-rw-r--r--nuttx/binfmt/libnxflat/libnxflat_bind.c9
-rw-r--r--nuttx/binfmt/libnxflat/libnxflat_unload.c1
4 files changed, 10 insertions, 3 deletions
diff --git a/nuttx/binfmt/binfmt_unloadmodule.c b/nuttx/binfmt/binfmt_unloadmodule.c
index a0050481c..a03b98d6c 100644
--- a/nuttx/binfmt/binfmt_unloadmodule.c
+++ b/nuttx/binfmt/binfmt_unloadmodule.c
@@ -183,7 +183,7 @@ int unload_module(FAR const struct binary_s *binp)
if (binp->alloc[i])
{
bvdbg("Freeing alloc[%d]: %p\n", i, binp->alloc[i]);
- free(binp->alloc[i]);
+ free((FAR void *)binp->alloc[i]);
}
}
diff --git a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c
index c6b3fce34..233713ccd 100644
--- a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c
+++ b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c
@@ -39,6 +39,7 @@
#include <nuttx/config.h>
+#include <string.h>
#include <errno.h>
#include <debug.h>
diff --git a/nuttx/binfmt/libnxflat/libnxflat_bind.c b/nuttx/binfmt/libnxflat/libnxflat_bind.c
index 3a86d5355..816810a46 100644
--- a/nuttx/binfmt/libnxflat/libnxflat_bind.c
+++ b/nuttx/binfmt/libnxflat/libnxflat_bind.c
@@ -38,6 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
+#include <nuttx/compiler.h>
#include <stdint.h>
#include <string.h>
@@ -248,7 +249,7 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
DEBUGASSERT(offset + nrelocs * sizeof(struct nxflat_reloc_s)
<= (loadinfo->isize + loadinfo->dsize));
- relocs = (FAR struct nxflat_reloc_s*)
+ relocs = (FAR struct nxflat_reloc_s *)
(offset - loadinfo->isize + loadinfo->dspace->region);
bvdbg("isize: %08lx dpsace: %p relocs: %p\n",
(long)loadinfo->isize, loadinfo->dspace->region, relocs);
@@ -276,7 +277,13 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
{
/* Handle the relocation by the relocation type */
+#ifdef CONFIG_CAN_PASS_STRUCTS
reloc = *relocs++;
+#else
+ memcpy(&reloc, relocs, sizeof(struct nxflat_reloc_s));
+ relocs++;
+#endif
+
result = OK;
switch (NXFLAT_RELOC_TYPE(reloc.r_info))
{
diff --git a/nuttx/binfmt/libnxflat/libnxflat_unload.c b/nuttx/binfmt/libnxflat/libnxflat_unload.c
index 71d0c8499..eb1aa0343 100644
--- a/nuttx/binfmt/libnxflat/libnxflat_unload.c
+++ b/nuttx/binfmt/libnxflat/libnxflat_unload.c
@@ -95,4 +95,3 @@ int nxflat_unload(struct nxflat_loadinfo_s *loadinfo)
nxflat_addrenv_free(loadinfo);
return OK;
}
-