public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jifl-bugzilla at jifvik dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/15486] New: -fdata-sections moves COMMON vars to .bss Date: Mon, 17 May 2004 19:32:00 -0000 [thread overview] Message-ID: <20040517064727.15486.jifl-bugzilla@jifvik.org> (raw) This is a regression from GCC 3.2.1 (at least). If I create a file foo.c containing simply: int x; and compile it with: arm-elf-gcc -c foo.c then I can get the following with 'arm-elf-nm foo.o' 00000004 C x However if I compile with arm-elf-gcc -c -fdata-sections foo.c then with arm-elf-nm I get: 00000000 B x i.e. x is in the BSS. This results in breaking the long-standing behaviour of common variables being merged. If you typed the following: cat >foo2.c int x=0; int main(){ return x; } arm-elf-gcc -c -fdata-sections foo.c arm-elf-gcc -c -fdata-sections foo2.c arm-elf-gcc -o foo foo.o foo2.o then you get: foo2.o(.data.x+0x0): multiple definition of `x' foo.o(.bss.x+0x0): first defined here I can see how this behaviour would be beneficial if "-fno-common" was passed to gcc and if not using "legacy" code (actually the real code I'm having trouble with is derived from a BSD kernel of about 4 years ago, so not that old), but in the absence of -fno-common, -fdata-sections should not operate on uninitialised data. Perhaps the default should be -fno-common, and I should be required to pass -fcommon to get the old behaviour, I'm not bothered. Or alternatively perhaps this treatment of uninitialised data should only happen with a separate -fbss-sections option (for symmetry with -ffunction-sections and -fdata-sections). -- Summary: -fdata-sections moves COMMON vars to .bss Product: gcc Version: 3.3.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jifl-bugzilla at jifvik dot org CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linuxgnulibc2.2 GCC host triplet: i686-pc-linuxgnulibc2.2 GCC target triplet: arm-elf http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15486
next reply other threads:[~2004-05-17 6:47 UTC|newest] Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-05-17 19:32 jifl-bugzilla at jifvik dot org [this message] 2004-05-17 21:59 ` [Bug middle-end/15486] " pinskia at gcc dot gnu dot org 2004-05-17 22:03 ` jifl-bugzilla at jifvik dot org 2004-05-17 22:04 ` ebotcazou at gcc dot gnu dot org 2004-05-17 22:05 ` [Bug middle-end/15486] [3.3/3.4/3.5] -fdata-sections moves common " ebotcazou at gcc dot gnu dot org 2004-05-18 14:17 ` jifl-bugzilla at jifvik dot org 2004-06-06 3:58 ` giovannibajo at libero dot it 2004-06-19 17:46 ` mmitchel at gcc dot gnu dot org 2004-06-22 10:26 ` rearnsha at gcc dot gnu dot org 2004-06-22 11:12 ` jifl-bugzilla at jifvik dot org 2004-06-22 11:33 ` rearnsha at gcc dot gnu dot org 2004-06-22 19:37 ` jifl-bugzilla at jifvik dot org 2004-06-22 22:13 ` jifl-bugzilla at jifvik dot org 2004-08-17 23:17 ` pinskia at gcc dot gnu dot org 2004-08-18 1:39 ` jifl-bugzilla at jifvik dot org 2004-08-18 2:22 ` pinskia at gcc dot gnu dot org 2004-08-18 4:42 ` jifl-bugzilla at jifvik dot org 2004-08-19 21:18 ` mmitchel at gcc dot gnu dot org 2004-08-20 21:09 ` jason at redhat dot com 2004-08-29 19:09 ` mmitchel at gcc dot gnu dot org 2004-10-13 13:42 ` [Bug middle-end/15486] [3.3/3.4/4.0 regression] " pinskia at gcc dot gnu dot org 2004-10-31 2:07 ` mmitchel at gcc dot gnu dot org 2004-12-09 13:16 ` ebotcazou at gcc dot gnu dot org 2004-12-14 8:22 ` ebotcazou at gcc dot gnu dot org 2004-12-18 21:50 ` cvs-commit at gcc dot gnu dot org 2004-12-18 21:56 ` ebotcazou at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20040517064727.15486.jifl-bugzilla@jifvik.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).