Linker command to append user data section at end?

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

I know, that I can tell the linker to add a new section to a given fixed address for example with the following linker command:

-Wl,--section-start,.FPGA_DATA=0x00010000

But in this way, I have either a gap of unused FLASH-memory between the application and my data section, or if my application is growing, it could overlapp with the user data section. This is not a serious problem, since the linker does generate a warning or error, if it occures.

Nevertheless, is there a way to tell the linker to append my data section just at the end of the application, respectively immediate after the .text section?

Kind regards Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why not simply embed it into the existing progmem section?

Otherwise, I think you have to write up your own linkerscript.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Because then the progmem data range will grow over the 64 kBit limit and I don't know which datas I have to access with ELPM instructions.

And I am not sure if the compiler is aware to use ELPM, to initialize its .data section in the RAM, if the data init-contents is stored in FLASH above 64 kByte?

If I can ensure, that the one big block is stored at the end of the existing progmem section, I have to use ELPM respectively progmem_read_byte_far() only for this big block and don't have to care for all the other datas!

[edit]

Isn't there a GCC linker variable with the adress of the progmem section end, I could use instaed a hard coded section address?

Or is it possible to allign a user defined section at the upper limit of the available progmem, something like:

-Wl,--section-end,.My_DATA=0x1E000

or maybe

-Wl,--section-start,.My_DATA=(0x1E000-My_DATA_size)