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

 
 

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

Submitted by:  Tyg <tyg>
Submitted on:  Mon 11 Jul 2016 06:26:31 PM UTC  
 
Category: DocumentationSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Documentation
Status: NonePercent Complete: 0%
Assigned to: NoneOpen/Closed: Open
Release: 1.8.0Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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.)

Attach File(s):
   
   
Comment:
   

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
  • -unavailable- added by gjlayde (Posted a comment)
  • -unavailable- added by tyg (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
    Mon 11 Jul 2016 06:26:31 PM UTCtygAttached File-=>Added inline_section_bug_sample.zip, #37813

    Back to the top


    Powered by Savane 3.1-cleanup1