Skip to content

Revert "linker/rap: Ignore relocation records with no section"

xiaojun zheng requested to merge zhengxiaojun/rtems-tools:main into main

Summary

Revert "linker/rap: Ignore relocation records with no section"

This reverts commit 0ad4aaaf

The latest rtems-tools generated wrong RAP file, the object file become too small(elf,2184bytes==>rap,736bytes) and the RAP file loaded failed, error message like this:

load app.out error:offset past end of file: offset=736 size=736 error.

I reverted the rtl-rap.cpp commit (0ad4aaaf), the rap file can be loaded. At Chris's suggestion, I found get_relocations(s) return all the count of relocation and write to rap file, but actual count is less, because the reloc with section=0 is ignored.

I tried to make the length fit the relocs write to rap file, but the file can not be loaded, it crashed. So the relocs(reloc.symsect == 0) can not be ignored.

The command line I used to create RAP file is:

rtems-ld -n -e appmain -s -O rap --base rtems.elf app.elf -o app.out

Close #4952 rtems/rtos/rtems#4952 (moved)

Edited by Chris Johns

Merge request reports