#3527 new defect

RTL Unresolved Symbols from common section on i386/pc686

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

Description

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)

Attachments (1)

rtems-common-global-symbol-test.patch (560 bytes) - added by Joseph Hickey on Sep 25, 2018 at 1:25:27 PM.
Patch to libtests/dl01 to reproduce the unresolved symbol failure

Download all attachments as: .zip

Change History (2)

Changed on Sep 25, 2018 at 1:25:27 PM by Joseph Hickey

Patch to libtests/dl01 to reproduce the unresolved symbol failure

comment:1 Changed on Sep 25, 2018 at 1:28:54 PM by Joseph Hickey

Note: The -fno-common GCC switch appears to be a viable workaround for this. The ELF loads successfully after adding this option to the CFLAGS.

Note: See TracTickets for help on using tickets.