Different memory of one variable from .bss section

ToTamire

I have a huge DDR memory (2GB) with long access times and a small internal RAM (1MB) with short access times. At the moment, DDR has the entire .bss section. The .bss section contains one variable that is frequently used from external libraries. How can I move from low speed DDR to high speed RAM? There is no way to fit the entire .bss in RAM, nor can I modify external libraries.

Disassembly of section .bss:
8000008c <some_variable>
.bss (NOLOAD) : {
   . = ALIGN(4);
   __bss_start = .;
   *(.bss)
   *(.bss.*)
   *(.gnu.linkonce.b.*)
   *(COMMON)
   . = ALIGN(4);
   __bss_end = .;
} > DDR

I tried something like that, but it doesn't work.

.bssFAST (NOLOAD) : {
   . = ALIGN(4);
   file.o:some_variable(.bss)
   . = ALIGN(4);
} > RAM
Employed Russian

I tried something like that, but it doesn't work.

It didn't work. The linker doesn't work at the variable level, it works at the section .

If the section is not too large , you may be able to move the entire section to .foo.o.bss.bssFAST

If that is not possible, the only other option is foo.oto apply a binary patch such as:

  1. There is a new .bssFASTsection ( objcopy --add-sectionshould work),
  2. Change it to be included in that new section some_variable(this should be relatively easy- .st_shndxit needs to be updated).

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324044222&siteId=291194637
BSS