This patch adds a new flag to mark sections as exclude sections. Such sections will ...
13 years, 7 months ago
(2011-09-23 23:45:54 UTC)
#1
This patch adds a new flag to mark sections as exclude sections. Such
sections will be discarded by the linker. Also, mark .gnu.callgraph
sections which store the callgraph edge profile info as exclude
sections.
I also want the SECTION_EXCLUDE part alone to be considered for trunk.
Index: final.c
===================================================================
--- final.c (revision 179104)
+++ final.c (working copy)
@@ -4428,7 +4428,7 @@ rest_of_handle_final (void)
&& cgraph_node (current_function_decl) != NULL
&& (cgraph_node (current_function_decl))->callees != NULL)
{
- flags = SECTION_DEBUG;
+ flags = SECTION_DEBUG | SECTION_EXCLUDE;
asprintf (&profile_fnname, ".gnu.callgraph.text.%s", fnname);
switch_to_section (get_section (profile_fnname, flags, NULL));
fprintf (asm_out_file, "\t.string \"Function %s\"\n", fnname);
Index: varasm.c
===================================================================
--- varasm.c (revision 179098)
+++ varasm.c (working copy)
@@ -6191,6 +6191,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: output.h
===================================================================
--- output.h (revision 179098)
+++ 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. */
--
This patch is available for review at http://codereview.appspot.com/5126041
On 09/23/2011 04:45 PM, Sriraman Tallam wrote: > I also want the SECTION_EXCLUDE part alone ...
13 years, 7 months ago
(2011-09-27 17:25:38 UTC)
#2
On 09/23/2011 04:45 PM, Sriraman Tallam wrote:
> I also want the SECTION_EXCLUDE part alone to be considered for trunk.
This is ok for trunk.
Kai, is there a similar flag for pe-coff? I.e. is there something
reasonable that we can add to i386_pe_asm_named_section?
r~
2011/9/27 Richard Henderson <rth@redhat.com>: > On 09/23/2011 04:45 PM, Sriraman Tallam wrote: >> I also ...
13 years, 7 months ago
(2011-09-27 17:51:25 UTC)
#3
2011/9/27 Richard Henderson <rth@redhat.com>:
> On 09/23/2011 04:45 PM, Sriraman Tallam wrote:
>> I also want the SECTION_EXCLUDE part alone to be considered for trunk.
>
> This is ok for trunk.
>
> Kai, is there a similar flag for pe-coff? I.e. is there something
> reasonable that we can add to i386_pe_asm_named_section?
Well, pe-coff also has SEC_EXCLUDE. Its meaning is that the section
gets discarded on linking. I checked in gas/config/obj-coff.c and
there is right now AFAICS no way to specify this flag for a section.
But it should be trivial to add it there with specifier 'e'.
Kai
Submitted the SECTION_EXCLUDE part to trunk. Thanks, -Sri. On Tue, Sep 27, 2011 at 10:51 ...
13 years, 7 months ago
(2011-09-27 17:53:52 UTC)
#4
Submitted the SECTION_EXCLUDE part to trunk.
Thanks,
-Sri.
On Tue, Sep 27, 2011 at 10:51 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>
> 2011/9/27 Richard Henderson <rth@redhat.com>:
> > On 09/23/2011 04:45 PM, Sriraman Tallam wrote:
> >> I also want the SECTION_EXCLUDE part alone to be considered for trunk.
> >
> > This is ok for trunk.
> >
> > Kai, is there a similar flag for pe-coff? I.e. is there something
> > reasonable that we can add to i386_pe_asm_named_section?
>
> Well, pe-coff also has SEC_EXCLUDE. Its meaning is that the section
> gets discarded on linking. I checked in gas/config/obj-coff.c and
> there is right now AFAICS no way to specify this flag for a section.
> But it should be trivial to add it there with specifier 'e'.
>
> Kai
Issue 5126041: [google] Add SECTION_EXCLUDE flag and exclude .gnu.callgraph sections
Created 13 years, 7 months ago by Sriraman
Modified 13 years, 7 months ago
Reviewers: Cary, rth_redhat.com, ktietz70_googlemail.com
Base URL: svn+ssh://gcc.gnu.org/svn/gcc/branches/google/gcc-4_6/gcc/
Comments: 0