public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/98146] New: [11 Regression] section type conflict when "used" attribute is applied to decl with specific section
@ 2020-12-04 14:47 jozefl at gcc dot gnu.org
  2020-12-07  7:49 ` [Bug target/98146] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jozefl at gcc dot gnu.org @ 2020-12-04 14:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98146

            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 with
the "section" attribute, GCC will emit an error:

$ cat tester.c
int __attribute__((section(".data.foo"))) foo1 = 1;
int __attribute__((used,section(".data.foo"))) foo2 = 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 = 2;
      |                                                ^~~~
tester.c:1:43: note: 'foo1' was declared here
    1 | int __attribute__((section(".data.foo"))) foo1 = 1;
      |                                           ^~~~

This was originally reported in glibc PR 27002, but is actually a GCC bug.

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

end of thread, other threads:[~2020-12-16 13:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 14:47 [Bug target/98146] New: [11 Regression] section type conflict when "used" attribute is applied to decl with specific section jozefl at gcc dot gnu.org
2020-12-07  7:49 ` [Bug target/98146] " rguenth at gcc dot gnu.org
2020-12-07 21:11 ` hjl.tools at gmail dot com
2020-12-11 15:41 ` hjl.tools at gmail dot com
2020-12-11 15:46 ` hjl.tools at gmail dot com
2020-12-16 13:43 ` cvs-commit at gcc dot gnu.org
2020-12-16 13:43 ` cvs-commit at gcc dot gnu.org
2020-12-16 13:43 ` cvs-commit at gcc dot gnu.org
2020-12-16 13:45 ` hjl.tools at gmail dot com

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).