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

            Bug ID: 62093
           Summary: multi-argument section attribute for bss, rodata, data
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: josh at joshtriplett dot org

The Linux kernel and similar use the section __attribute__ to place some data
and code into sections like "init", which can be discarded from memory at some
point, or "percpu", which gets mapped to different memory on each CPU. 
However, the section attribute only takes a single section argument, overriding
GCC's usual logic to place const data in rodata and uninitialized data in bss;
in particular, even uninitialized data always gets a value stored for it. 
Peter Anvin and others proposed a three-argument form of the section attribute,
providing three potentially different sections for data that would otherwise go
in data, bss, or rodata.  This would provide a significant space savings in the
compiled binary, as well as enforcing protection for read-only data.

Reply via email to