RTEMS Tools | rtems-ld: Code and symbols of a RAP object disagree (#44)

Sebastian Huber (@sebhub) gitlab at rtems.org
Sat Oct 3 13:33:05 UTC 2026



Issue created by Sebastian Huber: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/work_items/44



The layout aligns the start of an object in a RAP section to the alignment of its first input section.  This is often an empty `.text` section with an alignment of one.  The offsets of the other input sections are aligned relative to the object start.  The writer pads each input section to its alignment relative to the RAP section start.  The written code thus lies at other offsets than its symbols and the targets of its relocations.

On i386 the code of a function lies two bytes after the address of its symbol, and `dl06` of RTEMS faults with a divide error.  The alignment of a RAP section is the one of the last object, not the largest one.

Found while running the RTEMS test suite on eleven simulators.  This description was created with Claude Code assistance.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/work_items/44
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/5-dvfzep62ipzxq8j0v5n0vdi83-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/20261003/dd39d582/attachment-0001.htm>


More information about the bugs mailing list