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.

AM335x StarterWare - Wrong gcc linker script?

Hi,

I'm using AM335X_StarterWare_02_00_00_07. The provided gcc makefile passes the compiler with "-fdata-sections -ffunction-sections" flags. Thus, all the static variables are placed in .bss.varname sections and not in .bss sections.

So regarding this, shouldn't the linker script include the following line? (my addition is marked with red)

        _bss_start = .;
        .bss :
        {
                *(.bss)
                *(.bss.*)
        }
        . = ALIGN(4);
        _bss_end = .;

Otherwise the static variables aren't initialized by the startup code! Is my understanding correct?

Same about .text and .data.

  •  

    Hi Vasili,

    The StarterWare 02.00.00.07 release was built using CodeSourcery2009q1-161 version, with this toolchain version

    the uninitialized and zero-initialized variables are placed correctly in the BSS section.

    However, if you migrate to the newer version of CodeSourcery or someother toolChain the BSS segment variables might not

    be initialized properly during the system startup.

    This is a known issue and a fix for this with an updated linker script will be released in the upcoming new release.

    The change you have highlighted is correct and you can use the change in your linker scripts to get the examples

    working correctly across all toolchains temporarily till the new updated StarterWare release.

    Regards

    Anant Pai

  • Hi Anant,

    Indeed. I was using a different toolchain (Cygwin based, vanilla gcc-4.8.1)

    Many thanks,
    Vasili