bugAVR C Runtime Library - Bugs: bug #48473, FAQ: "How do I relocate code...


You are not allowed to post comments on this tracker with your current authentication level.

bug #48473: FAQ: "How do I relocate code to a fixed address?" can be misleading

Submitter:  Tyg <tyg>
Submitted:  Mon 11 Jul 2016 06:26:31 PM UTC
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  None Percent Complete:  0%
Assigned to:  None Open/Closed:  Open
Release:  1.8.0 Fixed Release:  None

Mon 11 Jul 2016 06:44:59 PM UTC, comment #1: 

If inlining is a problem, then the same applies to cloning.  Hence the docs should also recommend __noclone__ and __no_icf__ (provided gcc supports these attributes).

Georg-Johann Lay <gjlayde>
Mon 11 Jul 2016 06:26:31 PM UTC, original submission:  

The method described in http://www.nongnu.org/avr-libc/user-manual/FAQ.html > "How do I relocate code to a fixed address?" does not work in every situation.

A function can get inlined during optimization. In this case the code is not run from the specified address as I would expect.

I recently had a problem writing the FLASH on XMEGAs because of this (as the SPM instruction has to reside in the boot section of FLASH). It took me a while to debug this. My solution was to use the following attribute:

_attribute_ ((noinline, section (".boot")))

I suggest putting a note about this case. I think it would be very useful for others like me.

Tyg <tyg>


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

Attached Files
file #37813:  inline_section_bug_sample.zip added by tyg (1022B - application/zip)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by gjlayde (Posted a comment)
  • -email is unavailable- added by tyg (Submitted the item)

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-07-11 tyg Attached File- Added inline_section_bug_sample.zip, #37813

    Back to the top

    Powered by Savane 3.12