Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#4952 new defect

rtems-ld created wrong RAP file on arm

Reported by: zhengxiaojun Owned by:
Priority: normal Milestone:
Component: tool Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

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( 0ad4aaafc20afcb5aacb7a82b0b3a8150b638975 linker/rap: Ignore relocation records with no section), the rap file can be loaded.

At Chris's suggestion, I founded 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 like this:
rtems-ld -n -e appmain -s -O rap --base rtems.elf app.elf -o app.out

Change History (0)

Note: See TracTickets for help on using tickets.