diff options
author | Philip Blundell <pb@nexus.co.uk> | 1999-09-15 14:27:19 +0000 |
---|---|---|
committer | Nick Clifton <nickc@gcc.gnu.org> | 1999-09-15 14:27:19 +0000 |
commit | e68eda91013d5c1f1c319cab0c401e329e06cd6b (patch) | |
tree | bf9b8902c1a6be7c764efbf82ee15bee6dcdffbc | |
parent | 23fb21ff10deb6f32e430d9924c30b14a2d3a022 (diff) | |
download | gcc-e68eda91013d5c1f1c319cab0c401e329e06cd6b.zip gcc-e68eda91013d5c1f1c319cab0c401e329e06cd6b.tar.gz gcc-e68eda91013d5c1f1c319cab0c401e329e06cd6b.tar.bz2 |
Fix profiling support and unique section support.
From-SVN: r29436
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/arm/linux-elf.h | 48 |
2 files changed, 56 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f143f13..d4bc549 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h index 78fd743..f7bd3b2 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -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}" |