#3686 assigned defect

Add library searching and loading to libdl

Reported by: Chris Johns Owned by: Chris Johns
Priority: normal Milestone: 5.1
Component: lib/dl Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Provide support to search library files (archives) for symbols loading the object file that contains the symbol. The support shall:

  1. Parse a configuration file called /etc/libdl.conf for the list of archive symbols to load. Support fnmatch() wildcard parsing. Allow runtime updates reloading if there is a change.
  1. Maintain archive symbol tables in memory to improve symbol search performance. Archives must have a ranlib generated symbol table. Reload an archive if it has changed.
  1. Make sure separate text and data built object files is supported. Assume a duplicate symbol means that section and symbol has already been loaded. Load all sections not loaded. There is no need to be efficient at this point in time.
  1. Add support to check if there are any system wide unresolved symbols.
  1. Automatically unloaded archive object files that are not referenced.
  1. Duplicate symbols in archives is not an error. The first archive that has the symbol in an object file is loaded.

The feature adds symbol based demand loading of object files to libdl. A user loads an object file using the dlopen function and unresolved symbols are loaded from the libraries hosted on the target.

Change History (4)

comment:1 Changed on Feb 8, 2019 at 11:08:15 PM by Chris Johns <chrisj@…>

In 89c59be/rtems:

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

comment:2 Changed on Feb 8, 2019 at 11:08:19 PM by Chris Johns <chrisj@…>

In 85b59974/rtems:

libtests/dl02: Update the rtl-shell path.

Updates #3686

comment:3 Changed on Feb 8, 2019 at 11:08:23 PM by Chris Johns <chrisj@…>

In bac53634/rtems:

libtests/dl02: Update the rtl-shell path. More verbose test.

Updates #3686

comment:4 Changed on Feb 8, 2019 at 11:08:26 PM by Chris Johns <chrisj@…>

In a7c6176/rtems:

libtest/dl08: Add a test for archives.

  • Create 2 archives.
  • Load 1 object file which loads 6 object files from the libraries.

Updates #3686

Note: See TracTickets for help on using tickets.