#4673 closed defect (fixed)

Runtime loader exported symbols address size not consistent

Reported by: Ryan Long Owned by: Ryan Long <ryan.long@…>
Priority: normal Milestone: 6.1
Component: lib/dl Version: 6
Severity: normal Keywords:
Cc: Blocked By:


In rtl-sym.c, where the exported symbols table is read in rtems_rtl_symbol_global_add, the addresses are expected to be of size sizeof(unsigned long). This works fine for most architectures because most of them evaluate to 4. For Aarch64 however, this evaluates to 8.

Change History (2)

comment:1 Changed on 07/29/22 at 13:17:44 by Ryan Long <ryan.long@…>

Owner: set to Ryan Long <ryan.long@…>
Resolution: fixed
Status: newclosed

In ace7db9/rtems-tools:

rtems-syms.cpp: Change check to pointer size

Changed from a RISC-V specific value being in the conditional to a check for
the size of the architecture's pointer.

Closes #4673

comment:2 Changed on 07/29/22 at 13:25:02 by Ryan Long <ryan.long@…>

In 1c6ac88/rtems:

cpukit/libdl/rtl-sym.c: Fix increment of variable

In rtems_rtl_symbol_global_add() the loop that gets to the end of the symbol
table used "unsigned long" to increment the index for the table. For most
architectures this resulted in 4, but with AArch64, it results in 8. This
resulted in the symbols being read in wrong. Changing this to void* along with
changing the RISC-V specific code for 8 byte pointers in rtems-tools to work
independent of the architecture.

Updates #4673
Closes #4682

Note: See TracTickets for help on using tickets.