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:
parent
a160442b78
commit
d6f761430c
@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,7 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -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))
|
||||
{
|
||||
|
@ -95,4 +95,3 @@ int nxflat_unload(struct nxflat_loadinfo_s *loadinfo)
|
||||
nxflat_addrenv_free(loadinfo);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user