mirror of
https://github.com/apache/nuttx.git
synced 2025-12-08 10:55:51 +08:00
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:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -95,7 +95,7 @@ static void nxflat_dumpmemory(void *addr, int nbytes)
|
||||
}
|
||||
}
|
||||
#else
|
||||
# define nnxflat_dumpmemory(a,n)
|
||||
# define nxflat_dumpmemory(a,n)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user