summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-09-01 09:53:35 +1000
committerChris Johns <chrisj@rtems.org>2014-09-01 09:53:35 +1000
commit7eec769550d6c548a3a80c3413c93e4abdc479cd (patch)
treecfe50430ff0a4ffc5e71cf4383bc5a921a6c68e1
parentd7aca117e2aaa7dca6db40f182f64fd66644a198 (diff)
Clean up the obj parse patch.HEADmaster
-rw-r--r--rtl-obj.c2
-rw-r--r--rtl-obj.h2
-rw-r--r--rtl.c19
3 files changed, 17 insertions, 6 deletions
diff --git a/rtl-obj.c b/rtl-obj.c
index 532756a..15de926 100644
--- a/rtl-obj.c
+++ b/rtl-obj.c
@@ -119,7 +119,7 @@ bool
rtems_rtl_parse_name (const char* name,
const char** aname,
const char** oname,
- int* ooffset)
+ off_t* ooffset)
{
const char* laname = NULL;
const char* loname = NULL;
diff --git a/rtl-obj.h b/rtl-obj.h
index 7e200d6..cc6d832 100644
--- a/rtl-obj.h
+++ b/rtl-obj.h
@@ -294,7 +294,7 @@ bool rtems_rtl_obj_unresolved (rtems_rtl_obj_t* obj);
bool rtems_rtl_parse_name (const char* name,
const char** aname,
const char** oname,
- int* ooffset);
+ off_t* ooffset);
/**
* Load the object file.
diff --git a/rtl.c b/rtl.c
index 3e96742..4b92992 100644
--- a/rtl.c
+++ b/rtl.c
@@ -378,7 +378,7 @@ rtems_rtl_find_obj (const char* name)
rtems_rtl_obj_t* found = NULL;
const char* aname = NULL;
const char* oname = NULL;
- int ooffset;
+ off_t ooffset;
if (!rtems_rtl_parse_name (name, &aname, &oname, &ooffset))
return NULL;
@@ -388,12 +388,23 @@ rtems_rtl_find_obj (const char* name)
while (!rtems_chain_is_tail (&rtl->objects, node))
{
rtems_rtl_obj_t* obj = (rtems_rtl_obj_t*) node;
- if (rtems_rtl_match_name (obj, name))
- return obj;
+ if ((aname == NULL && strcmp (obj->oname, oname) == 0) ||
+ (aname != NULL &&
+ strcmp (obj->aname, aname) == 0 && strcmp (obj->oname, oname) == 0))
+ {
+ found = obj;
+ break;
+ }
node = rtems_chain_next (node);
}
- return NULL;
+ if (!aname)
+ rtems_rtl_alloc_del(RTEMS_RTL_ALLOC_OBJECT, (void*) aname);
+
+ if (!oname)
+ rtems_rtl_alloc_del(RTEMS_RTL_ALLOC_OBJECT, (void*) oname);
+
+ return found;
}
rtems_rtl_obj_t*