From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A88173857818; Fri, 4 Dec 2020 14:47:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A88173857818 From: "jozefl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/98146] New: [11 Regression] section type conflict when "used" attribute is applied to decl with specific section Date: Fri, 04 Dec 2020 14:47:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jozefl at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2020 14:47:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98146 Bug ID: 98146 Summary: [11 Regression] section type conflict when "used" attribute is applied to decl with specific section Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jozefl at gcc dot gnu.org Target Milestone: --- For targets that support the SHF_GNU_RETAIN ELF section flag, the "used" attribute will set the internal GCC SECTION_RETAIN flag on the section containing the "used" decl. If a "used" decl, and a decl without "used" both specify the same section w= ith the "section" attribute, GCC will emit an error: $ cat tester.c int __attribute__((section(".data.foo"))) foo1 =3D 1; int __attribute__((used,section(".data.foo"))) foo2 =3D 2; $ gcc -S tester.c tester.c:2:48: error: 'foo2' causes a section type conflict with 'foo1' 2 | int __attribute__((used,section(".data.foo"))) foo2 =3D 2; | ^~~~ tester.c:1:43: note: 'foo1' was declared here 1 | int __attribute__((section(".data.foo"))) foo1 =3D 1; | ^~~~ This was originally reported in glibc PR 27002, but is actually a GCC bug.=