在 2023/8/31 6:05, Chris Johns 写道:
On 31/8/2023 12:48 am, zhengxiaojun wrote:
Hi,
    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."

What arch and BSP?
ARM, imx6ull


    I reverted the rtl-rap.cpp commit( 0ad4aaafc20afcb5aacb7a82b0b3a8150b638975
linker/rap: Ignore relocation records with no section), the rap file can be 
loaded.

I think the commit has the wrong ticket id, it should be 4069 ...

https://devel.rtems.org/ticket/4069

My guess is the length includes the relocs that have been dropped because they
do not have a symbol section. A reloc without a symbol section cannot be located
because you do not know the section to locate it against.

Are you able to review the rtems-ld code for the issue?
I am trying to find something, but I do not know elf/rap format well. I found when ignore synsect==0, the GLOBAL symbol will be ignore too.
Should the GLOBAL symbol be dealt with?

Here is part of ELF:
Symbol table (.symtab)
[  Nr ] Value    Size     Type    Bind      Sect Name
[    0] 00000000 00000000 NOTYPE  LOCAL        0
[    1] 00000000 00000000 NOTYPE  LOCAL        4 $d
[    2] 00000001 0000011e FUNC    LOCAL        1 task_test
[    3] 00000000 00000000 NOTYPE  LOCAL        1 $t
[    4] 00000000 00000000 NOTYPE  LOCAL        3 $d
[    5] 00000000 00000000 NOTYPE  LOCAL        4 .LC0
[    6] 00000030 00000000 NOTYPE  LOCAL        4 .LC3
[    7] 00000000 00000000 NOTYPE  LOCAL        3 .LANCHOR0
[    8] 0000000c 00000000 NOTYPE  LOCAL        4 .LC1
[    9] 00000038 00000000 NOTYPE  LOCAL        4 .LC4
[   10] 00000000 00000000 NOTYPE  GLOBAL       0 putchar
[   11] 00000000 00000000 NOTYPE  GLOBAL       0 printf
[   12] 00000000 00000000 NOTYPE  GLOBAL       0 rtems_task_wake_after
[   13] 00000000 00000000 NOTYPE  GLOBAL       0 puts
[   14] 00000000 00000000 NOTYPE  GLOBAL       0 tcflush
[   15] 00000121 00000054 FUNC    GLOBAL       1 appmain
[   16] 00000000 00000000 NOTYPE  GLOBAL       0 rtems_task_start
[   17] 00000000 00000000 NOTYPE  GLOBAL       0 cfsetispeed
[   18] 00000000 00000000 NOTYPE  GLOBAL       0 write
[   19] 00000000 00000000 NOTYPE  GLOBAL       0 cfsetospeed
[   20] 00000000 00000000 NOTYPE  GLOBAL       0 read
[   21] 00000000 00000000 NOTYPE  GLOBAL       0 tcgetattr
[   22] 00000000 00000000 NOTYPE  GLOBAL       0 open
[   23] 00000000 00000000 NOTYPE  GLOBAL       0 tcsetattr
[   24] 00000000 00000000 NOTYPE  GLOBAL       0 rtems_task_create


Chris
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to