Link RAP file error on zynq BSP

Joel Sherrill joel at rtems.org
Fri Oct 12 17:05:38 UTC 2018


On Thu, Oct 11, 2018 at 11:45 PM jameszxj <jameszxj at gmail.com> 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
>
>     At last I found the bsp_spec file has been modified,
> "*link:%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N}" was removed
> from the bsp_spec file.  Add this line to the file, ld is OK.
>    Why removed these lines?
>

The long-term goal is to remove the bsp_specs. I made a sweep making them
more consistent and have a set of patches against gcc master which
eliminates them on many architectures. Working so the details are implied
by GCC.

So let's look at the options and see which one has an impact which mattered
that I didn't catch. This is the description of these options from ld's man
page:

      -N
       --omagic
           Set the text and data sections to be readable and writable.
Also,
           do not page-align the data segment, and disable linking against
           shared libraries.  If the output format supports Unix style magic
           numbers, mark the output as "OMAGIC". Note: Although a writable
           text section is allowed for PE-COFF targets, it does not conform
to
           the format specification published by Microsoft.

      -d
      -dc
       -dp These three options are equivalent; multiple forms are supported
           for compatibility with other linkers.  They assign space to
common
           symbols even if a relocatable output file is specified (with -r).
           The script command "FORCE_COMMON_ALLOCATION" has the same effect.

I'm going to guess that it is -dc/-dp but have no idea how this would
impact RAP except to confuse the code.

Can you try adding adding the options one at a time until you make it work?
Then Chris can figure out why it breaks RAP.


>    Does the newest RTEMS support the loading of incrementally linked ELF
> files? RAP format runs OK, but the link needs BSP image, this
> make BSP's development and APP's development not so independent. a little
> pity, :)
>

This is a Chris question.
'

> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20181012/ec13fcb1/attachment-0002.html>


More information about the devel mailing list