bugAVR C Runtime Library - Bugs: bug #36124, Improve documentation on .bss...

 
 

bug #36124: Improve documentation on .bss clear when used in assembler

Submitted by:  Jan Waclawek <wek>
Submitted on:  Sat 07 Apr 2012 02:02:23 PM UTC  
 
Category: DocumentationSeverity: 3 - Normal
Priority: 9 - ImmediateItem Group: Documentation
Status: NonePercent Complete: 0%
Assigned to: NoneOpen/Closed: Open
Release: AnyFixed Release: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 20 Nov 2012 06:02:09 PM UTC, comment #1:

Since GCC 3.4, the respective bits of startup code are hosted with GCC (namely as part of libgcc) and not in AVR Libc.

It's highly recommended that any user who updates or downgrades or changes vendor / distributor of the toolchain reads all the relevent release notes.

This includes the GCC release notes, of course.

If you change the distributor, it's also strongly recommended to get informed about differences in the binary interface (ABI), because some private ports like Atmel use different ABI.

Bottom line: I think a pointer to the GCC release notes in the AVR Libc documentation is reasonable, but I don't think it makes much sense to copy paste the GCC release notes to the AVR Libc docs...


For the GCC 4.7 release notes, see
http://gcc.gnu.org/gcc-4.7/changes.html

For the GCC 4.6 release notes, see
http://gcc.gnu.org/gcc-4.6/changes.html

For the avr-gcc ABI, see http://gcc.gnu.org/wiki/avr-gcc

For vendor-specific release notes and changes to the ABI please consult respective document of your vendor.

Georg-Johann Lay <gjlayde>
Sat 07 Apr 2012 02:02:23 PM UTC, original submission:

Newer builds of the avr-gcc toolchain, such as WinAVR20100110, or builds including the PR18145 fixup (4.7+), contain a patch which results in conditional linking of the .bss cleanup loop only if it is needed for the C source (similarly for the initialized .data). This may lead to surprising behaviour when such variables are defined only in assembler parts of a project.

It is therefore suggested to add something like the following text to http://www.nongnu.org/avr-libc/user-manual/assembler.html after "For devices that have RAM, initializing the RAM variables can also be utilized.", or http://www.nongnu.org/avr-libc/user-manual/mem_sections.html#sec_dot_init into the chapters dealing with .data and .bss sections, or both as appropriate:

Note: To ensure that variables in .bss section are zeroed upon startup, add the following line to the assembler source:
.global __do_clear_bss

To ensure that variables in .data section are initialized from FLASH during startup, add the following line to the assembler source:
.global __do_copy_data

(This submission is result of discussion on AVRFreaks http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=119131&highlight= )

Jan Waclawek <wek>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gjlayde (Posted a comment)
  • -unavailable- added by arcanum (Updated the item)
  • -unavailable- added by wek (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 16 Nov 2012 06:42:23 PM UTCarcanumPriority5 - Normal=>9 - Immediate

    Back to the top


    Powered by Savane 3.1-cleanup