public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug web/34460]  New: The GCC manual about section variable attribute is incorrect
@ 2007-12-14  8:51 fbuihuu at gmail dot com
  2007-12-17 16:43 ` [Bug web/34460] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: fbuihuu at gmail dot com @ 2007-12-14  8:51 UTC (permalink / raw)
  To: gcc-bugs

Since at least 3.4, the GCC manual says:

     Use the `section' attribute with an _initialized_ definition of a
     _global_ variable, as shown in the example.  GCC issues a warning
     and otherwise ignores the `section' attribute in uninitialized
     variable declarations.

but this doesn't seem correct.

For example compiling the following tiny program:

        int foo __attribute__ ((__section__ (".init.data")));

        int main(int argc, char **argv)
        {
                foo = 4;
                return 0;
        }

produces no warning and the section attribute is not ignored at all:

        $ readelf -S a.out | grep -A1 init.data
        [24] .init.data        PROGBITS         000000000060080c  0000080c
        0000000000000004  0000000000000000  WA       0     0     4

This is with 4.1.2 from fedora, but I guess other GCC give the same result.

I would be nice to have all manuals reflecting this too.
%0


-- 
           Summary: The GCC manual about section variable attribute is
                    incorrect
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: web
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fbuihuu at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34460


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug web/34460] The GCC manual about section variable attribute is incorrect
  2007-12-14  8:51 [Bug web/34460] New: The GCC manual about section variable attribute is incorrect fbuihuu at gmail dot com
@ 2007-12-17 16:43 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-12-17 16:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-12-17 16:43 -------


*** This bug has been marked as a duplicate of 34443 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34460


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-12-17 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-14  8:51 [Bug web/34460] New: The GCC manual about section variable attribute is incorrect fbuihuu at gmail dot com
2007-12-17 16:43 ` [Bug web/34460] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).