RTEMS | libdl fails to load ELF objects on 64-bit targets due to 32-bit address truncation (#5816)

xiaojun zheng (@zhengxiaojun) gitlab at rtems.org
Wed Nov 11 01:55:33 UTC 2026



Issue created by xiaojun zheng: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5816



## Summary
The RTEMS run-time loader (libdl) fails to load ELF objects on 64-bit targets. So far I have reproduced this on aarch64; other 64-bit targets are presumably affected as well, since the root cause is the loader's fixed 32-bit internal word size.

The type rtems_rtl_word is defined as uint32_t, and fields that carry addresses or symbol values, such as rtems_rtl_unresolv_symbol::symvalue, are declared as Elf_Word. Elf_Word is 32-bit in both the ELF32 and ELF64 formats, so 64-bit addresses are silently truncated to 32 bits during loading, which eventually leads to corrupted relocations and load failures.

## Steps to reproduce

1. Build an RTEMS application for aarch64 with libdl enabled, and load an ELF object at run time on a 64-bit target (observed on an RK3576-based board).
2. The object contains symbols or references with addresses above 4 GiB.
3. The loader either fails to load the object or the loaded code crashes, because the addresses are truncated to 32 bits. 

<!-- Pre-set options
- milestone
-->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5816
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/namespace/49/sent_notifications/6-duwdqvth6fdgt0psnbpp6zue3-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20261111/bf30dc1f/attachment.htm>


More information about the bugs mailing list