Patchwork Add SECTION_EXCLUDE to list of section flags

login
register
mail settings
Submitter Sriraman Tallam
Date Sept. 26, 2011, 9:09 p.m.
Message ID <CAAs8HmzWAZK2TN6DQaDq_COLGe3=dV7rgtNyG0f1iitOkXrBEQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/116481/
State New
Headers show

Comments

Sriraman Tallam - Sept. 26, 2011, 9:09 p.m.
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.

    to using a special assembler directive.  */
Sriraman Tallam - Sept. 27, 2011, 5:52 p.m.
Submitted to trunk after approval from Richard :
http://gcc.gnu.org/ml/gcc-patches/2011-09/msg01747.html
Thanks,
-Sri.

On Mon, Sep 26, 2011 at 2:09 PM, Sriraman Tallam <tmsriram@google.com> wrote:
> 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.  */
>

Patch

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