Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(46)

Issue 5126041: [google] Add SECTION_EXCLUDE flag and exclude .gnu.callgraph sections

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 7 months ago by Sriraman
Modified:
13 years, 7 months ago
Reviewers:
Cary, ktietz70, rth
CC:
gcc-patches_gcc.gnu.org
Base URL:
svn+ssh://gcc.gnu.org/svn/gcc/branches/google/gcc-4_6/gcc/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -1 line) Patch
M final.c View 1 chunk +1 line, -1 line 0 comments Download
M output.h View 1 chunk +1 line, -0 lines 0 comments Download
M varasm.c View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 6
Sriraman
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
rth_redhat.com
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
ktietz70_googlemail.com
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
Sriraman
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
Cary
> Index: final.c > =================================================================== > --- final.c (revision 179104) > +++ final.c (working copy) ...
13 years, 7 months ago (2011-09-27 18:02:52 UTC) #5
Sriraman
13 years, 7 months ago (2011-09-27 18:57:39 UTC) #6
I committed the patch to google/gcc-4_6 branch.

Thanks,
-Sri.


	* output.h (SECTION_EXCLUDE): New flag for exclude sections.
	* varasm.c (default_elf_asm_named_section): Add "e" to section flags
	marked as SECTION_EXCLUDE.
	* final.c (rest_of_handle_final): Exclude .gnu.callgraph sections.

Index: gcc/varasm.c
===================================================================
--- gcc/varasm.c	(revision 179288)
+++ gcc/varasm.c	(working copy)
@@ -6191,6 +6191,8 @@

   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 179288)
+++ gcc/output.h	(working copy)
@@ -443,6 +443,7 @@
 #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 */
Index: gcc/final.c
===================================================================
--- gcc/final.c	(revision 179288)
+++ gcc/final.c	(working copy)
@@ -4428,7 +4428,7 @@
       && 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);


On Tue, Sep 27, 2011 at 11:02 AM, Cary Coutant <ccoutant@google.com> wrote:
>> 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);
>
> This part is OK for the google/gcc-4_6 branch.
>
> -cary
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b