This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Scatter loading - possible to have 'root region' in library

Hi everyone,

Is it possible for armlink to handle a 'root region' from a library (not an object file)? I've tried to do that via a scatter loading file, but did not succeed.

> armlink  --noremove --callgraph --map --info totals,unused --symbols --list myprog.map   --scatter scatter.txt --entry entrypoint -o myprog.axf  myprog.o mylib.a
"scatter.txt", line 9 (column 12): Error: L6236E: No section matches selector - no section to be FIRST/LAST.

However, 'entrypoint' is part of INITCA9 section, contained in mylib.a.

> fromelf mylib.a | grep INITCA9
** Section #1 'INITCA9' (SHT_PROGBITS) [SHF_ALLOC + SHF_EXECINSTR + SHF_ENTRYSECT]

Scatter.txt looks like this:

ROM_LOAD 0x80000000
{
    ROM_EXEC +0
    {
        * (INITCA9, +First)                 ; Core initialization code
[...]

Note that linking works without complaints from armlink whenever I add the object file directly to the command line:

> armlink  --noremove --callgraph --map --info totals,unused --symbols --list myprog.map   --scatter scatter.txt --entry entrypoint -o myprog.axf  myprog.o mylib.a init.o

Thanks for your help in advance!

Ciao, Andre

  • Not sure if it's case sensitive but have you tried +FIRST? That's what I've seen in the newer manuals.

  • or try using the entrypoint symbol to select the section:

    From the manual:

    You can select the input section by the name of a global symbol that the section defines. This enables you to choose individual sections with the same name from partially linked objects.
    
    The :gdef: prefix distinguishes a global symbol pattern from a section pattern. For example, use :gdef:mysym to select the section that defines mysym. The following example shows a scatter file in which ExecReg1 contains the section that defines global symbol mysym1, and the section that contains global symbol mysym2:
    LoadRegion 0x8000
    {
        ExecReg1 +0
        {
            *(:gdef:mysym1)
            *(:gdef:mysym2)
        }
                            ; rest of scatter-loading description
    }
    

    In your case mysym1 could be entrypoint.

  • Hi Andrew,

    Thanks for the hints, unfortunately both did not work in my case. I got the same error msg as above.

    It seems I have to adapt the make process and mention the object explicitly on command line.

    Ciao, Andre