RTEMS Tools | rtems-ld: Fix the RAP output (!100)
Sebastian Huber (@sebhub)
gitlab at rtems.org
Tue Nov 10 08:15:13 UTC 2026
Sebastian Huber created a merge request: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/merge_requests/100
Project:Branches: sebhub/rtems-tools:up/rap-relocs to rtems/tools/rtems-tools:main
Author: Sebastian Huber
## Summary
Closes #1, #43, #44 and #45.
**Problem:** `rtems-ld` writes broken RAP files. The RTEMS test `dl06` fails on every simulator BSP that builds it:
- An unused undefined `_GLOBAL_OFFSET_TABLE_` stops the link on i386 and microblaze (#43).
- Relocations against undefined symbols are dropped but still counted, so the loader reads past the end of the file (#1).
- Code and symbols of an object end up at different offsets, for example on i386 (#44).
- The relocation type has only 8 bits, which is too small for AArch64 types (#45).
**Fix:** One commit per issue. The last commit adds RAP format version 3, which writes the relocation type as a word of its own. `rtems-rap` reads versions 2 and 3.
**Review hints:**
- The RTEMS loader for version 3 is rtems/rtos/rtems!1575 (rtems/rtos/rtems#5801). The loader still reads version 2.
- The `dl06` fix on the RTEMS side is rtems/rtos/rtems!1574.
## Test
RTEMS `dl06` with this `rtems-ld`, rtems/rtos/rtems!1574 and the version 3 loader: `END OF TEST` on `aarch64/a53_lp64_qemu`, `arm/xilinx_zynq_a9_qemu`, `i386/pc586-sse`, `microblaze/petalogix_s3adsp1800`, `mips/jmr3904`, `mips/malta`, `powerpc/psim`, `riscv/rv64imafdc`, `sparc/gr712rc`, `sparc/gr740` and `sparc/gr765`.
## AI Details
<!-- Make sure you have read our statement at https://www.rtems.org/generative-ai/ -->
### Prompt used
None as a single prompt. The work was done in an interactive Claude Code session on the RTEMS Tools tree. Each change was directed and reviewed.
### AI model used
Claude Opus 5.5 (claude-opus-5-5), through Claude Code.
### How AI was used for the contribution
- ( ) Formatting
- ( ) Test creation.
- (x) Code comments.
- ( ) The entire contribution was generated using AI
- ( ) AI code completion such as Copilot in VSCode.
The implementation was produced in that session under my direction, and the commit messages were drafted there.
### Access
I have not used a product which claims copyright in its output, and I have legitimate access to the one I used.
--
View it on GitLab: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/merge_requests/100
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/namespace/13/sent_notifications/6-3527uqfyo68wy7gyb9zurm7v8-d/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/20261110/04029c65/attachment-0001.htm>
More information about the bugs
mailing list