On 12/10/2018 15:45, jameszxj wrote:
> HI,
>     I run RTEMS on my xilinx z7k board and dynamic load application(RAP 
> format)
> from shell.
> In recent update, i encount a link error when link the RAP file.
> Here is the command and output message:
>                 rtems-ld -n -e PT_Init --base rtems-nsa.elf 
> wsp/build/nssys.elf
> -o wsp/build/nssys.out
>                 error: rap::object: Section index '65522' not found:
> wsp/build/nssys.elf

I have tracked the section number 65522 to being an uninitialised variable in a
module being loaded. For ELF this means:

 int sym1;

creates a symbol record in ELF in libdl of:

rtl: sym:elf:24 name:70:sym1 bind:1  type:1  sect:65522 size:4

The readelf version is:

   24: 00000004     4 OBJECT  GLOBAL DEFAULT  COM sym1

I have finally managed to find what out where these sections are defined ...

https://git.rtems.org/rtems/tree/cpukit/include/sys/exec_elf.h#n538

Peng Fan came across this issue in GSoC 2013 (2012?) on the sparc but we could
not find anything in the standards or supporting code to tell what it was and
why it existed. We seem to have just missed this detail.

The `rtems-ld` linker has support for this section hard coded into it but it is
restricted to the sparc architecture. Now I have something in the standard
headers to work with I should be able to handle this case cleanly and on all
supported archs.

James, there is no need for a test case.

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

Reply via email to