bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange behaviour of ld output with '-print-memory-usage'


From: Boris Valerievich
Subject: Strange behaviour of ld output with '-print-memory-usage'
Date: Mon, 3 Apr 2023 17:42:23 +0300

Hello
I am trying to get %-age of using RAM and FLASH memory sections for microcontroller

(toolchain: xPack for RISC-V, GCC-12.2) When I'm using the first notation:
-
    .stack ORIGIN(RAM) + LENGTH(RAM) - __stack_size :
    {
        . = ALIGN(4);
        PROVIDE(_susrstack = . );
        . = . + __stack_size;
        PROVIDE( _eusrstack = .);
    } >RAM 

I've got 100% usage of RAM.

When I'm using the next one notation:

    .stack :
    {
        . = ALIGN(4);
        PROVIDE(_susrstack = . );
        . = . + __stack_size;
        PROVIDE( _eusrstack = .);
    } >RAM 

I've got 3% of RAM usage.

But in fact I've just moved the stack inside the section.


When I'm using old one GCC 8.3 - everything is OK in both cases.

LD file there:

https://github.com/sadkotheguest/ch32v307-cmake-vsc-noos-template/blob/main/wch/Ld/Link.ld


Regards Boris

reply via email to

[Prev in Thread] Current Thread [Next in Thread]