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
This commit is contained in:
Chris Johns
2019-05-03 10:15:20 +10:00
parent be50969881
commit b36c52097f
26 changed files with 1091 additions and 520 deletions

View File

@@ -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;
}