Put saved data in flash of STM32 at the end of all other sections
The simplest solution of such problem is to put the section .myvars after latest section in ram. In my case it should be after section .data. The full linker file:

MEMORY
{
    rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K
    ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
}

ENTRY(reset_handler)

SECTIONS {
  .vector_table 0x08000000 :
  {
    _sisrvectors = .;
    KEEP(*(.vector_table))
    /* ASSERT(. == _isrvectors_tend, "The vector table needs to be 84 elements long!"); */
    _eisrvectors = .;
  } &gt;rom

  .text :
  {
    . = ALIGN(4);
    _stext = .;
    *(.text*)
    *(.rodata*)
    . = ALIGN(4);
    _etext = .;
  } &gt;rom

  .ARM.extab :
  {
    *(.ARM.extab* .gnu.linkonce.armextab.*)
  } &gt;rom

  .ARM : {
    *(.ARM.exidx*)
  } &gt;rom

  .data :
  {
    . = ALIGN(4);
    _sdata = .;
    *(.data*)
    . = ALIGN(4);
    _edata = .;
  } &gt;ram AT &gt;rom

  .myvars :
  {
    . = ALIGN(1024);
    KEEP(*(.myvars))
  } &gt; rom

  _ldata = LOADADDR(.data);

  .bss :
  {
    . = ALIGN(4);
    _sbss = .;
    *(.bss*)
    *(COMMON)
    . = ALIGN(4);
    _ebss = .;
  } &gt;ram
}

PROVIDE(_stack = ORIGIN(ram) + LENGTH(ram));


Here is the code.