#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 09/25/18 at 13:25:27.
Patch to libtests/dl01 to reproduce the unresolved symbol failure

Download all attachments as: .zip

Change History (2)

Changed on 09/25/18 at 13:25:27 by Joseph Hickey

Patch to libtests/dl01 to reproduce the unresolved symbol failure

comment:1 Changed on 09/25/18 at 13:28:54 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.