[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Remove .bss size from RAM segment of AVR ELF?

From: Tero Sinervo
Subject: Re: [avr-gcc-list] Remove .bss size from RAM segment of AVR ELF?
Date: Fri, 06 Jun 2008 15:04:03 +0300
User-agent: Thunderbird (Windows/20071210)

Weddington, Eric wrote:
I can make it unambiguous: The .bss segment should NOT be written to
Flash after .data as it would take up too much space in the precious
Flash. The .data section has to be initialized from somewhere so it has
to be stored in Flash.

Yes it's only ambiguous when you look at the ELF file. If you look at the RAM init segment you see that its paddr points to Flash memory and its size is .data+.bss even if we only want to program .data to the Flash.

This can be easily fixed in programming software but I wonder if it should be done in AVR ELF files too. Would it be possible to exclude .bss from AVR ELF file segments by setting memsz==filesz and only keep .bss as a section header? That would make the program part of the ELF file more consistent with actual programming.

What advantage does making this change bring?

The program part of AVR ELF files would be closer to actual device programming by stating that you don't want to program .bss to Flash memory. Nothing big as it's not a large obstacle to write your programming software only to write .data and not initialize .bss.

One disadvantage I thought of is dynamic loading. The ELF files of dynamically loaded modules shouldn't of course be affected, only standalone embedded programs.

Tero Sinervo
Elekno Oy

reply via email to

[Prev in Thread] Current Thread [Next in Thread]