diff options
author | Chris Johns <chrisj@rtems.org> | 2018-12-17 16:36:48 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2019-02-09 10:06:34 +1100 |
commit | 89c59be38d9c83437abb9002e8fea5012652e5ff (patch) | |
tree | 954df408c26a58ae41851502f427f30771952bdf /cpukit/libdl/rtl-elf.c | |
parent | powerpc/psim: Increase the psim memory to 256M (diff) | |
download | rtems-89c59be38d9c83437abb9002e8fea5012652e5ff.tar.bz2 |
libdl: Add symbol searching and loading from archives.
- Load archive symbol tables to support searching of archives
for symbols.
- Search archive symbols and load the object file that contains
the symbol.
- Search the global and archives until all remaining unresolved symbols
are not found. Group the loaded object files in the pending queue.
- Run the object file and loaded dependents as a group before adding to the
main object list.
- Remove orphaned object files after references are removed.
Updates #3686
Diffstat (limited to 'cpukit/libdl/rtl-elf.c')
-rw-r--r-- | cpukit/libdl/rtl-elf.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cpukit/libdl/rtl-elf.c b/cpukit/libdl/rtl-elf.c index 762130b9e7..caa37e6bab 100644 --- a/cpukit/libdl/rtl-elf.c +++ b/cpukit/libdl/rtl-elf.c @@ -248,6 +248,13 @@ rtems_rtl_elf_reloc_relocator (rtems_rtl_obj* obj, } sobj = rtems_rtl_find_obj_with_symbol (symbol); + + if (rtems_rtl_trace (RTEMS_RTL_TRACE_DEPENDENCY)) + printf ("rtl: depend: %s -> %s:%s\n", + obj->oname, + sobj == NULL ? "not-found" : sobj->oname, + symname); + if (sobj != NULL) { if (rtems_rtl_obj_add_dependent (obj, sobj)) @@ -471,6 +478,13 @@ rtems_rtl_obj_relocate_unresolved (rtems_rtl_unresolv_reloc* reloc, } sobj = rtems_rtl_find_obj_with_symbol (sym); + + if (rtems_rtl_trace (RTEMS_RTL_TRACE_DEPENDENCY)) + printf ("rtl: depend: %s -> %s:%s\n", + reloc->obj->oname, + sobj == NULL ? "not-found" : sobj->oname, + sym->name); + if (sobj != NULL) { if (rtems_rtl_obj_add_dependent (reloc->obj, sobj)) @@ -1274,8 +1288,6 @@ rtems_rtl_elf_file_load (rtems_rtl_obj* obj, int fd) if (!rtems_rtl_obj_relocate (obj, fd, rtems_rtl_elf_relocs_locator, &ehdr)) return false; - rtems_rtl_obj_synchronize_cache (obj); - rtems_rtl_symbol_obj_erase_local (obj); if (!rtems_rtl_elf_load_linkmap (obj)) |