Back-out one relocation type

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1926 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2009-06-22 22:42:21 +00:00
parent bd11dc8305
commit 4a7bdfa37c
4 changed files with 6 additions and 66 deletions

View File

@@ -144,47 +144,6 @@ static inline int nxflat_bindrel32d(FAR struct nxflat_loadinfo_s *loadinfo,
}
}
/****************************************************************************
* Name: nxflat_bindrel32id
*
* Description:
* Perform the NXFLAT_RELOC_TYPE_REL32ID binding:
*
* Meaning: Object file contains a 32-bit offsetinto I-Space at the the
* offset, but will be referenced as data
* Fixup: Add mapped I-Space address - allocated D-Space address to the
* offset.
*
* Returned Value:
* 0 (OK) is returned on success and a negated errno is returned on
* failure.
*
****************************************************************************/
static inline int nxflat_bindrel32id(FAR struct nxflat_loadinfo_s *loadinfo,
uint32 offset)
{
uint32 *addr;
bvdbg("NXFLAT_RELOC_TYPE_REL32I Offset: %08x I-Space: %p D-Space: %p\n",
offset, loadinfo->ispace, loadinfo->dspace->region);
if (offset < loadinfo->dsize)
{
addr = (uint32*)(offset + loadinfo->dspace->region);
bvdbg(" Before: %08x\n", *addr);
*addr += ((uint32)(loadinfo->ispace) - (uint32)(loadinfo->dspace->region));
bvdbg(" After: %08x\n", *addr);
return OK;
}
else
{
bdbg("Offset: %08 does not lie in D-Space size: %08x\n",
offset, loadinfo->dsize);
return -EINVAL;
}
}
/****************************************************************************
* Name: nxflat_gotrelocs
*
@@ -264,19 +223,6 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo)
}
break;
/* NXFLAT_RELOC_TYPE_REL32ID Meaning: Object file contains a 32-bit offset
* into I-Space at the the offset, but will
* be referenced as data
* Fixup: Add mapped I-Space address - allocated
* D-Space address to the offset.
*/
case NXFLAT_RELOC_TYPE_REL32ID:
{
result = nxflat_bindrel32id(loadinfo, NXFLAT_RELOC_OFFSET(reloc.r_info));
}
break;
/* NXFLAT_RELOC_TYPE_ABS32 Meaning: Offset refers to a struct nxflat_import_s
* describing a function pointer to be
* imported.

View File

@@ -64,15 +64,15 @@
#if defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_BINFMT)
static const char g_relocrel32i[] = "RELOC_REL32I";
static const char g_relocrel32d[] = "RELOC_REL32D";
static const char g_relocrel32id[] = "RELOC_REL32ID";
static const char g_relocabs32[] = "RELOC_AB32";
static const char g_undefined[] = "UNDEFINED";
static const char *g_reloctype[] =
{
g_relocrel32i,
g_relocrel32d,
g_relocrel32id,
g_relocabs32
g_relocabs32.
g_undefined
};
# define RELONAME(rl) g_reloctype[NXFLAT_RELOC_TYPE(rl)]
#else

View File

@@ -95,7 +95,7 @@ static void nxflat_dumpmemory(void *addr, int nbytes)
}
}
#else
# define nnxflat_dumpmemory(a,n)
# define nxflat_dumpmemory(a,n)
#endif
/****************************************************************************