summaryrefslogtreecommitdiffstats
path: root/cpukit/libdl/rtl.c
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2019-05-03 10:15:20 +1000
committerChris Johns <chrisj@rtems.org>2019-05-03 10:15:20 +1000
commitb36c52097f52012f9a52dff6fc8393d63805158b (patch)
tree011b4cb678d343e0e6422d36bbcce982fdf48e30 /cpukit/libdl/rtl.c
parentbsp/motorola_powerpc: Fix debug output (diff)
downloadrtems-b36c52097f52012f9a52dff6fc8393d63805158b.tar.bz2
libdl: Do not access the ELF file while the allocator is locked.
- Load symbols before allocation. - Parse reloc records and place any reloc recs in a cache to use while the allocator is locked. - Relocate symbols after section allocation. - Split section loading into allocation/locating and loading. - Update all arch back-ends with a new reloc interface to control tramp handling. - Add `-a` and `-t` to the object list shell command. Closes #3741
Diffstat (limited to '')
-rw-r--r--cpukit/libdl/rtl.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/cpukit/libdl/rtl.c b/cpukit/libdl/rtl.c
index e3dba5a206..d4103bace6 100644
--- a/cpukit/libdl/rtl.c
+++ b/cpukit/libdl/rtl.c
@@ -477,21 +477,24 @@ rtems_rtl_find_obj (const char* name)
rtems_rtl_obj*
rtems_rtl_find_obj_with_symbol (const rtems_rtl_obj_sym* sym)
{
- rtems_chain_node* node = rtems_chain_first (&rtl->objects);
- while (!rtems_chain_is_tail (&rtl->objects, node))
+ if (sym != NULL)
{
- rtems_rtl_obj* obj = (rtems_rtl_obj*) node;
- if (rtems_rtl_obj_has_symbol (obj, sym))
- return obj;
- node = rtems_chain_next (node);
- }
- node = rtems_chain_first (&rtl->pending);
- while (!rtems_chain_is_tail (&rtl->pending, node))
- {
- rtems_rtl_obj* obj = (rtems_rtl_obj*) node;
- if (rtems_rtl_obj_has_symbol (obj, sym))
- return obj;
- node = rtems_chain_next (node);
+ rtems_chain_node* node = rtems_chain_first (&rtl->objects);
+ while (!rtems_chain_is_tail (&rtl->objects, node))
+ {
+ rtems_rtl_obj* obj = (rtems_rtl_obj*) node;
+ if (rtems_rtl_obj_has_symbol (obj, sym))
+ return obj;
+ node = rtems_chain_next (node);
+ }
+ node = rtems_chain_first (&rtl->pending);
+ while (!rtems_chain_is_tail (&rtl->pending, node))
+ {
+ rtems_rtl_obj* obj = (rtems_rtl_obj*) node;
+ if (rtems_rtl_obj_has_symbol (obj, sym))
+ return obj;
+ node = rtems_chain_next (node);
+ }
}
return NULL;
}