URL: <http://savannah.nongnu.org/bugs/?36124>
Summary: Improve documentation on .bss clear when used in assembler Project: AVR C Runtime Library Submitted by: wek Submitted on: Sat 07 Apr 2012 02:02:23 PM GMT Category: Documentation Severity: 3 - Normal Priority: 5 - Normal Item Group: Documentation Status: None Percent Complete: 0% Assigned to: None Open/Closed: Open Discussion Lock: Any Release: Any Fixed Release: None _______________________________________________________ Details: 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= ) _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?36124> _______________________________________________ Message sent via/by Savannah http://savannah.nongnu.org/ _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-libc-dev