This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Add SECTION_EXCLUDE to list of section flags
- From: Sriraman Tallam <tmsriram at google dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 26 Sep 2011 14:09:00 -0700
- Subject: [PATCH] Add SECTION_EXCLUDE to list of section flags
Hi,
Here is a simple patch to add SECTION_EXCLUDE to the list of
section flag macros. Is this ok for trunk?
Thanks,
-Sri.
* output.h (SECTION_EXCLUDE): New macro.
* varasm.c (default_elf_asm_named_section): Check for
SECTION_EXCLUDE.
Index: gcc/varasm.c
===================================================================
--- gcc/varasm.c (revision 179208)
+++ gcc/varasm.c (working copy)
@@ -6159,6 +6159,8 @@ default_elf_asm_named_section (const char *name, u
if (!(flags & SECTION_DEBUG))
*f++ = 'a';
+ if (flags & SECTION_EXCLUDE)
+ *f++ = 'e';
if (flags & SECTION_WRITE)
*f++ = 'w';
if (flags & SECTION_CODE)
Index: gcc/output.h
===================================================================
--- gcc/output.h (revision 179208)
+++ gcc/output.h (working copy)
@@ -443,6 +443,7 @@ extern void no_asm_to_stream (FILE *);
#define SECTION_COMMON 0x800000 /* contains common data */
#define SECTION_RELRO 0x1000000 /* data is readonly after relocation
processing */
#define SECTION_MACH_DEP 0x2000000 /* subsequent bits reserved for target */
+#define SECTION_EXCLUDE 0x4000000 /* discarded by the linker */
/* This SECTION_STYLE is used for unnamed sections that we can switch
to using a special assembler directive. */