Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnu linker section of non-contiguous memory region

I'm trying to write a linker script to write one section content into two non-contiguous memory regions.

I have found an old thread in this mail list about this: "ld linker script and non-contiguous memory region" http://sourceware.org/ml/binutils/2012-01/msg00188.html

I know a feature from the C28x Compiler for this problem is spliting the sections across multiple memory segments: (with an or function)

SECTIONS { .text: { *(.text) } >> FLASH1| FLASH3 }

described here: http://processors.wiki.ti.com/index.php/C28x_Compiler_-_Understanding_Linking

I have try it without success. At the moment I have to manually fill the fist memory region. but is a difficult to search parts of code witch I will not change in the future and fit and fill completely the first memory region.

Is such feature in the GNU linker implemented? Or does anyone has a better idea how can I solve this problem?

like image 970
dispatcher Avatar asked Mar 01 '13 11:03

dispatcher


People also ask

What is the main purpose of linker file format?

The main purpose of the linker script is to describe how the sections in the input files should be mapped into the output file, and to control the memory layout of the output file.

What is a linker command?

Linker command files allow you to put linker options and directives in a file; this is useful when you invoke the linker often with the same options and directives. Linker command files are also useful because they allow you to use the MEMORY and SECTIONS directives to customize your application.

What is linker directive?

The Linker Script is a text file made up of a series of Linker directives which tell the Linker where the available memory is and how it should be used. Thus, they reflect exactly the memory resources and memory map of the target microcontroller.


1 Answers

I think the easiest way (and maybe the only way) would be to split your section up into two sections, then assign one section to the first memory region, and the second section to the second memory region.

You have probably already seen this, but it is a pretty concise description of link scripts: http://www.math.utah.edu/docs/info/ld_3.html

like image 66
Chris Desjardins Avatar answered Sep 16 '22 11:09

Chris Desjardins