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
This commit is contained in:
patacongo 2012-12-19 21:16:03 +00:00
parent a160442b78
commit d6f761430c
4 changed files with 10 additions and 3 deletions

View File

@ -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]);
}
}

View File

@ -39,6 +39,7 @@
#include <nuttx/config.h>
#include <string.h>
#include <errno.h>
#include <debug.h>

View File

@ -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))
{

View File

@ -95,4 +95,3 @@ int nxflat_unload(struct nxflat_loadinfo_s *loadinfo)
nxflat_addrenv_free(loadinfo);
return OK;
}