diff options
author | Doug Evans <dje@gnu.org> | 1996-05-16 22:28:47 +0000 |
---|---|---|
committer | Doug Evans <dje@gnu.org> | 1996-05-16 22:28:47 +0000 |
commit | c30ac676411db2b1354229a08308a29724378e76 (patch) | |
tree | cefe530e144e2d14089bbf94fe45625b69850193 /gcc/varasm.c | |
parent | 4ac14744830df0e672c6b0fbf57823f3b95c0be4 (diff) | |
download | gcc-c30ac676411db2b1354229a08308a29724378e76.zip gcc-c30ac676411db2b1354229a08308a29724378e76.tar.gz gcc-c30ac676411db2b1354229a08308a29724378e76.tar.bz2 |
varasm.c (function_section): Delete flag_function_sections support.
* varasm.c (function_section): Delete flag_function_sections support.
(assemble_start_function): Put it here. Use UNIQUE_SECTION if defined.
From-SVN: r11975
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 09ab0d6..11bab79 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -352,29 +352,6 @@ void function_section (decl) tree decl; { - -#ifdef ASM_OUTPUT_SECTION_NAME - /* If we are placing functions into their own sections, and this - function doesn't already have a section specified, set it now. */ - if (flag_function_sections - && decl != NULL_TREE - && DECL_SECTION_NAME (decl) == NULL_TREE) - { - int len; - char *string; - - len = IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (decl)) + 1; - string = alloca (len); - strcpy (string, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))); - - /* Strip off any encoding in fnname. */ - STRIP_NAME_ENCODING (string, string); - - /* Set DECL_SECTION_NAME. */ - DECL_SECTION_NAME (decl) = build_string (len, string); - } -#endif - if (decl != NULL_TREE && DECL_SECTION_NAME (decl) != NULL_TREE) named_section (decl, (char *) 0); @@ -916,6 +893,23 @@ assemble_start_function (decl, fnname) output_constant_pool (fnname, decl); +#ifdef ASM_OUTPUT_SECTION_NAME + /* If the function is to be put in its own section and it's not in a section + already, indicate so. */ + if (flag_function_sections + && DECL_SECTION_NAME (decl) == NULL_TREE) + { +#ifdef UNIQUE_SECTION + DECL_SECTION_NAME(decl) = UNIQUE_SECTION (decl); +#else + char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); + /* Strip off any encoding in name. */ + STRIP_NAME_ENCODING (name, name); + DECL_SECTION_NAME (decl) = build_string (strlen (name), name); +#endif + } +#endif + function_section (decl); /* Tell assembler to move to target machine's alignment for functions. */ |