rtems-ld created wrong RAP file on arm
Original author: jameszxj
I use the latest rtems-tools to generate RAP file, I found the object file become too small(elf,2184bytes==>rap,736bytes) and the 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).
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 ignore the reloc with section=0
.
I tried to make the length fit the relocs write to rap file, the file can not be loaded, it crashed. So the relocs(reloc.symsect == 0)
can not be ignored, at least on arm.
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
Edited by xiaojun zheng