fix(ld): fix cannot move location counter backwards (from 3fc88000 to 3fc87a00)

This commit is contained in:
Li Shuai
2025-11-05 20:53:49 +08:00
parent 52bc4e27fd
commit 1f95182e55
@@ -205,7 +205,8 @@ SECTIONS
*/
.dram0.dummy (NOLOAD):
{
. = ORIGIN(dram0_0_seg) + MAX(_iram_end - _diram_i_start, 0);
/* MAX() uses unsigned long arithmetic. Add offset to prevent underflow when _iram_end < _diram_i_start */
. = ORIGIN(dram0_0_seg) + MAX(_iram_end - _diram_i_start + (_diram_i_start - ORIGIN(iram0_0_seg)), (_diram_i_start - ORIGIN(iram0_0_seg))) - (_diram_i_start - ORIGIN(iram0_0_seg));
} > dram0_0_seg
.dram0.data :