This adds a note to the user manual that code with label differences is not supported. This is because adding an offset to a stub address as generated with gs() will in general not yield the address of the label+offset.

This actually occurs only if gs() has something to do, e.g. on devices with more than 128KiB of flash; but I don't see any benefit from supporting the feature on small devices -- left out all the problems caused by relaxing and when gas resolves the label difference.

Thus, add a note that it's not available on any AVR and mark the PR as invalid.

Ok for trunk?

Johann


        PR target/61044
        * doc/extend.texi (Local Labels): Note that label differences are
        not supported for AVR.

Index: doc/extend.texi
===================================================================
--- doc/extend.texi     (revision 210936)
+++ doc/extend.texi     (working copy)
@@ -373,6 +373,8 @@ goto *(&&foo + array[i]);
 This is more friendly to code living in shared libraries, as it reduces
 the number of dynamic relocations that are needed, and by consequence,
 allows the data to be read-only.
+This alternative with label differences is not supported for the AVR target,
+please use the first approach for AVR programs.

 The @code{&&foo} expressions for the same label might have different
 values if the containing function is inlined or cloned.  If a program

Reply via email to