Fix profiling support and unique section support.

From-SVN: r29436
This commit is contained in:
Philip Blundell 1999-09-15 14:27:19 +00:00 committed by Nick Clifton
parent 23fb21ff10
commit e68eda9101
2 changed files with 56 additions and 0 deletions

View File

@ -1,3 +1,11 @@
Wed Sep 15 15:23:28 1999 Philip Blundell <pb@nexus.co.uk>
* config/arm/linux-elf.h (MAKE_DECL_ONE_ONLY): Copy definition
from config/svr4.h.
(UNIQUE_SECTION_P, UNIQUE_SECTION): Likewise.
(FUNCTION_PROFILER): Redefine appropriately for Linux.
(CC1_SPEC): Likewise.
Wed Sep 15 10:09:48 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* genattr.c (main): Add extern prototype. Call return, not exit.

View File

@ -224,6 +224,44 @@ const_section () \
const_section (); \
}
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
#define UNIQUE_SECTION(DECL, RELOC) \
do \
{ \
int len; \
char * name; \
char * string; \
char * prefix; \
\
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
\
if (! DECL_ONE_ONLY (DECL)) \
{ \
prefix = "."; \
if (TREE_CODE (DECL) == FUNCTION_DECL) \
prefix = ".text."; \
else if (DECL_READONLY_SECTION (DECL, RELOC)) \
prefix = ".rodata."; \
else \
prefix = ".data."; \
} \
else if (TREE_CODE (DECL) == FUNCTION_DECL) \
prefix = ".gnu.linkonce.t."; \
else if (DECL_READONLY_SECTION (DECL, RELOC)) \
prefix = ".gnu.linkonce.r."; \
else \
prefix = ".gnu.linkonce.d."; \
\
len = strlen (name) + strlen (prefix); \
string = alloca (len + 1); \
sprintf (string, "%s%s", prefix, name); \
\
DECL_SECTION_NAME (DECL) = build_string (len, string); \
} \
while (0)
/* A C statement or statements to switch to the appropriate
section for output of RTX in mode MODE. RTX is some kind
of constant in RTL. The argument MODE is redundant except
@ -267,3 +305,13 @@ const_section () \
/* NWFPE always understands FPA instructions. */
#undef FP_DEFAULT
#define FP_DEFAULT FP_SOFT3
/* Call the function profiler with a given profile label. */
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(STREAM, LABELNO) \
{ \
fprintf (STREAM, "\tbl\tmcount%s\n", NEED_PLT_RELOC ? "(PLT)" : ""); \
}
#undef CC1_SPEC
#define CC1_SPEC "%{profile:-p}"