From 99f459184fbbb75fa100f40e9ccb6184aae73dce Mon Sep 17 00:00:00 2001 From: tmsriram Date: Tue, 27 Sep 2011 18:54:37 +0000 Subject: [PATCH] 2011-09-27 Sriraman Tallam * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/google@179289 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc-4_6/gcc/ChangeLog.google-4_6 | 7 +++++++ gcc-4_6/gcc/final.c | 2 +- gcc-4_6/gcc/output.h | 1 + gcc-4_6/gcc/varasm.c | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc-4_6/gcc/ChangeLog.google-4_6 b/gcc-4_6/gcc/ChangeLog.google-4_6 index ec98cf3333f..b792b255a32 100644 --- a/gcc-4_6/gcc/ChangeLog.google-4_6 +++ b/gcc-4_6/gcc/ChangeLog.google-4_6 @@ -1,3 +1,10 @@ +2011-09-27 Sriraman Tallam + + * 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. + 2011-09-22 Sriraman Tallam * cgraphbuild.c (remove_cgraph_callee_edges): Preserve callee edges if diff --git a/gcc-4_6/gcc/final.c b/gcc-4_6/gcc/final.c index fc023d03e69..da45e681fc9 100644 --- a/gcc-4_6/gcc/final.c +++ b/gcc-4_6/gcc/final.c @@ -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); diff --git a/gcc-4_6/gcc/output.h b/gcc-4_6/gcc/output.h index c668d352112..7031b084371 100644 --- a/gcc-4_6/gcc/output.h +++ b/gcc-4_6/gcc/output.h @@ -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. */ diff --git a/gcc-4_6/gcc/varasm.c b/gcc-4_6/gcc/varasm.c index 8eca4e262f4..82b13570dfb 100644 --- a/gcc-4_6/gcc/varasm.c +++ b/gcc-4_6/gcc/varasm.c @@ -6191,6 +6191,8 @@ default_elf_asm_named_section (const char *name, unsigned int flags, if (!(flags & SECTION_DEBUG)) *f++ = 'a'; + if (flags & SECTION_EXCLUDE) + *f++ = 'e'; if (flags & SECTION_WRITE) *f++ = 'w'; if (flags & SECTION_CODE) -- 2.11.4.GIT