This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Placement failure with -mh=auto in v7.4.6



I'm having a look at automatic speculation of loads with the 7.4 series of compiler/linkers. However, if I turn it on, I get link failures for all the sections sized to exactly fit their contents. Two examples are the stack and a single pointer:

-stack 0x1000

MEMORY
{
    ICB_PTR   :    org = 000800CFCh, len = 000000004h  /* 4 bytes */
    STACK     :    org = 000840000h, len = 000001000h  /* 4096 bytes */
}

SECTIONS
{
    icbPtrSect: type = NOLOAD
    {
        _lnk_pIcb = .;
        . += 4;
    }                  >          ICB_PTR

    .stack: fill = 0xCCCCCCCC
    {
        _lnk_DataMemoryStart = .;
    }                  >          STACK
}

but, on linking, I get:

"link.cmd", line 76: error:
   program will not fit into available memory.  placement with alignment fails
   for section ".stack" size 0x1000 .  Available memory ranges:
   STACK        size: 0x1000       unused: 0x1000       max hole: 0x1000

"link.cmd", line 63: error:
   program will not fit into available memory.  run placement with alignment
   fails for section "icbPtrSect" size 0x4 .  Available memory ranges:
   ICB_PTR      size: 0x4          unused: 0x4          max hole: 0x4

Does anyone know what is going on here and how to overcome it? I still get the errors if I remove the -mh-auto option from the file(s) access those sections but leave it there for other seemingly independent files...

The target is a C6455, if that makes any difference.

Thanks in advance,

SPH

  • I'm think what is occurring is described in the section titled Selecting the Best Threshold Value in the C6000 compiler manual.  I'll quote the most relevant bit ...

    If the symbol information is not known during compile time, the linker will ensure that the placement of data sections will allow legal accessing beyond the boundaries of the data sections. The linker does this by simply padding the start and end of the memory range(s) where the data sections are placed.

    I'm pretty sure that, due to using -mh=auto, the linker is adding padding to every section that may contain data, including .stack and icbPtrSect.

    Thanks and regards,

    -George

  • Yes, I saw that but didn't realise the full implications. So, if I understand what you are saying, if any loop anywhere in the code ends up doing speculative loads due to -mh=auto and the data structure upon which it speculates is an arbitrary pointer (so the section in which the data structure resides is unknown), then the linker will pad every single section and (from a quick search of the Assembly Language Tools UG) there is no way to tell the linker not to pad certain sections?

    If so, that completely rules out the use of -mh=auto for us - which is a shame as it otherwise seems like a really nice feature.

    Thanks,

    SPH

  • I filed SDSCM00049238 as an enhancement request in the SDOWP system.  I don't want to say what we might do to respond to this shortcoming.  I'm trying to get some discussion started on our end.  Feel free to follow the issue with the SDOWP link below in my signature.

    Thanks and regards,

    -George