#3604 closed defect (fixed)

RTL Unresolved Symbols from common section on i386/pc686 (cloned)

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

Description

Cloned from #3527:


By default GCC puts uninitialized global variables into a common section in the ELF file. When attempting to load the resulting ELF file at runtime using dlopen(), these global symbols are not resolved as expected.

The RTL reports unresolved symbols, and runtime code that take the address of the global get NULL instead.

This is reproducible using the libtests/dl01 example by adding a global variable to the module code. I will attach a patch that replicates the issue.

Test platform is QEMU using pc686 BSP, RTEMS source version 4.11.3 (latest on 4.11 git branch as of this writing)

Change History (3)

comment:1 Changed on Nov 13, 2018 at 6:14:16 AM by Chris Johns

Owner: set to Chris Johns
Status: newaccepted

comment:2 Changed on Nov 22, 2018 at 2:17:39 AM by Chris Johns <chrisj@…>

In 803eac9/rtems:

libdl: Manage the allocation of common uninitialised variables.

The use of separate text and data results in uninitialised variables
being placed in the common section. There is no section in ELF for
the common variables so the loader needs to create the section and
allocate the variables in that section. This patch does that.

The patch adds a second pass over the symbols.

The issue can also be seen as a section 65522 error.

Updates #3604

comment:3 Changed on Nov 27, 2018 at 6:12:05 AM by Chris Johns

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.