This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/81457] New: Inconsistent section flags for section attribute
- From: "joerg at netbsd dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 16 Jul 2017 21:57:51 +0000
- Subject: [Bug other/81457] New: Inconsistent section flags for section attribute
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81457
Bug ID: 81457
Summary: Inconsistent section flags for section attribute
Product: gcc
Version: 5.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: joerg at netbsd dot org
Target Milestone: ---
Created attachment 41767
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41767&action=edit
Potential fix, relative to GCC 5.4.0.
Assemble the following input for any ELF target:
__attribute__((section("foo1s"))) const int foo1;
__attribute__((section("foo2s"))) const int foo2 = 42;
Note that foo1s has flags "AW", but foo2s has flags "A".
Bug reproduces on the GCC snapshot option of godbolt.org. The attached patch
applies against GCC 5.4.0, it might need shuffling for newer versions. The
additional null checks are required for correct handling of e.g. __thread
variables.