#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 (9)

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

comment:5 Changed on Feb 19, 2019 at 10:09:52 PM by Chris Johns <chrisj@…>

In be62def9/rtems:

libdl/archive: Return false on read failure.

Coverity issue 1442641

Updates #3686

comment:6 Changed on Feb 19, 2019 at 10:09:56 PM by Chris Johns <chrisj@…>

In 62b01ab/rtems:

libdl/archive: Fix the config file string index while removing tailing white space.

Coverity issue 1442540

Updates #3686

comment:7 Changed on Feb 19, 2019 at 10:10:00 PM by Chris Johns <chrisj@…>

In 7aa0530/rtems:

libdl/archive: Check for an overflow of the symbol table.

Coverty 1442636

Updates #3686

comment:8 Changed on Feb 19, 2019 at 10:10:03 PM by Chris Johns <chrisj@…>

In c5615ddc/rtems:

libdl/unresolved: Fix return value for rtems_rtl_unresolved_remove

Coverity 1399717

Updates #3686

comment:9 Changed on Mar 13, 2019 at 7:15:22 AM by Sebastian Huber <sebastian.huber@…>

In 286e935/rtems:

Regenerate cpukit/headers.am

Updates #3686.

Note: See TracTickets for help on using tickets.