PR middle-end/34443
authorsje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 3 Mar 2009 18:27:42 +0000 (18:27 +0000)
committersje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 3 Mar 2009 18:27:42 +0000 (18:27 +0000)
* doc/extend.texi (section): Update description.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144582 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/doc/extend.texi

index 3d4b017..a4a1874 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-03  Steve Ellcey  <sje@cup.hp.com>
+
+       PR middle-end/34443
+       * doc/extend.texi (section): Update description.
+
 2009-03-03  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR middle-end/39345
index 21769c1..f901db3 100644 (file)
@@ -3872,7 +3872,7 @@ section.  For example, this small program uses several specific section names:
 struct duart a __attribute__ ((section ("DUART_A"))) = @{ 0 @};
 struct duart b __attribute__ ((section ("DUART_B"))) = @{ 0 @};
 char stack[10000] __attribute__ ((section ("STACK"))) = @{ 0 @};
-int init_data __attribute__ ((section ("INITDATA"))) = 0;
+int init_data __attribute__ ((section ("INITDATA")));
 
 main()
 @{
@@ -3889,18 +3889,19 @@ main()
 @end smallexample
 
 @noindent
-Use the @code{section} attribute with an @emph{initialized} definition
-of a @emph{global} variable, as shown in the example.  GCC issues
-a warning and otherwise ignores the @code{section} attribute in
-uninitialized variable declarations.
+Use the @code{section} attribute with
+@emph{global} variables and not @emph{local} variables,
+as shown in the example.
 
-You may only use the @code{section} attribute with a fully initialized
-global definition because of the way linkers work.  The linker requires
+You may use the @code{section} attribute with initialized or
+uninitialized global variables but the linker requires
 each object be defined once, with the exception that uninitialized
 variables tentatively go in the @code{common} (or @code{bss}) section
-and can be multiply ``defined''.  You can force a variable to be
-initialized with the @option{-fno-common} flag or the @code{nocommon}
-attribute.
+and can be multiply ``defined''.  Using the @code{section} attribute
+will change what section the variable goes into and may cause the
+linker to issue an error if an uninitialized variable has multiple
+definitions.  You can force a variable to be initialized with the
+@option{-fno-common} flag or the @code{nocommon} attribute.
 
 Some file formats do not support arbitrary sections so the @code{section}
 attribute is not available on all platforms.