Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#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:
Blocking:

Description

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 [changeset:"ace7db96d4561665b07ba15c2fe5f9349f4d3d8c/rtems-tools" 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 [changeset:"1c6ac88f938f4b135f3bbffc4b19bbc540508c80/rtems" 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.