diff options
author | Richard Henderson <rth@redhat.com> | 2002-05-19 00:55:48 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-05-19 00:55:48 -0700 |
commit | 772c52657977a3d3bb3990d98a0b695c8eac6dc1 (patch) | |
tree | 4ddec3992557b6c2d8d93182967d4ae32a004621 /gcc/config/mcore | |
parent | ae6ac996cc2382cf37cd0eb1a23d21cf2ca16b8e (diff) | |
download | gcc-772c52657977a3d3bb3990d98a0b695c8eac6dc1.zip gcc-772c52657977a3d3bb3990d98a0b695c8eac6dc1.tar.gz gcc-772c52657977a3d3bb3990d98a0b695c8eac6dc1.tar.bz2 |
system.h (STRIP_NAME_ENCODING): Poison it.
* system.h (STRIP_NAME_ENCODING): Poison it.
* output.h (STRIP_NAME_ENCODING): Remove.
(default_strip_name_encoding): Declare.
* target-def.h (TARGET_STRIP_NAME_ENCODING): New.
* target.h (strip_name_encoding): New.
* varasm.c (default_strip_name_encoding): New.
* dwarf2asm.c, varasm.c, config/darwin.c, config/darwin.h,
config/alpha/alpha.c, config/arm/pe.c, config/avr/avr.c,
config/cris/cris.c, config/i386/cygwin.h, config/i386/interix.c,
config/i386/winnt.c, config/m32r/m32r.h, config/mcore/mcore-elf.h,
config/mcore/mcore-pe.h, config/mcore/mcore.c, config/mcore/mcore.h,
config/mips/mips.c, config/mn10200/mn10200.h, config/mn10300/mn10300.h,
config/pa/pa.c, config/pa/pa.h, config/pa/som.h,
config/rs6000/rs6000.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h,
config/v850/v850.h: Use the hook, not the macro.
* config/darwin-protos.h, config/darwin.c, config/darwin.h,
config/alpha/alpha.c, config/alpha/alpha.h, config/h8300/h8300.c,
config/h8300/h8300.h, config/i386/cygwin.h, config/i386/i386-interix.h,
config/i386/i386-protos.h, config/i386/win32.h, config/i386/winnt.c,
config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c,
config/m32r/m32r.h, config/mcore/mcore.c, config/mcore/mcore.h,
config/pa/pa.c, config/rs6000/rs6000.c, config/rs6000/sysv4.h,
config/rs6000/xcoff.h, config/sh/sh.c, config/sh/sh.h,
config/v850/v850.c, config/v850/v850.h:
Move STRIP_NAME_ENCODING to out-of-line function and add
TARGET_STRIP_NAME_ENCODING.
* config/arm/arm.c, config/arm/arm.h, config/mmix/mmix-protos.h,
config/mmix/mmix.c, config/mmix/mmix.h: Replace STRIP_NAME_ENCODING
with TARGET_STRIP_NAME_ENCODING referencing existing function;
make function static.
* xcoffout.c: Include target.h
* Makefile.in (xcoffout.o): Update.
* config/avr/avr.c (avr_encode_section_info): Correct prototype.
* config/avr/avr.h (STRIP_NAME_ENCODING): Remove.
* config/rs6000/rs6000.c (rs6000_xcoff_unique_section): Mark
reloc argument unused.
* config/sh/sh.c (TARGET_ENCODE_SECTION_INFO): New.
* doc/tm.texi (TARGET_STRIP_NAME_ENCODING): Update from previous
STRIP_NAME_ENCODING docs.
From-SVN: r53615
Diffstat (limited to 'gcc/config/mcore')
-rw-r--r-- | gcc/config/mcore/mcore-elf.h | 2 | ||||
-rw-r--r-- | gcc/config/mcore/mcore-pe.h | 2 | ||||
-rw-r--r-- | gcc/config/mcore/mcore.c | 14 | ||||
-rw-r--r-- | gcc/config/mcore/mcore.h | 14 |
4 files changed, 17 insertions, 15 deletions
diff --git a/gcc/config/mcore/mcore-elf.h b/gcc/config/mcore/mcore-elf.h index 2cdbae0..ced4886 100644 --- a/gcc/config/mcore/mcore-elf.h +++ b/gcc/config/mcore/mcore-elf.h @@ -67,7 +67,7 @@ exports_section () \ { \ exports_section (); \ fprintf (STREAM, "\t.ascii \" -export:%s\"\n", \ - MCORE_STRIP_NAME_ENCODING (NAME)); \ + (* targetm.strip_name_encoding) (NAME)); \ } \ while (0); diff --git a/gcc/config/mcore/mcore-pe.h b/gcc/config/mcore/mcore-pe.h index 651f338..6668574 100644 --- a/gcc/config/mcore/mcore-pe.h +++ b/gcc/config/mcore/mcore-pe.h @@ -69,7 +69,7 @@ drectve_section () \ { \ drectve_section (); \ fprintf (STREAM, "\t.ascii \" -export:%s\"\n", \ - MCORE_STRIP_NAME_ENCODING (NAME)); \ + (* targetm.strip_name_encoding) (NAME)); \ } \ while (0); diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c index 61fc5bd..7276d81 100644 --- a/gcc/config/mcore/mcore.c +++ b/gcc/config/mcore/mcore.c @@ -139,6 +139,7 @@ static void mcore_asm_named_section PARAMS ((const char *, #endif static void mcore_unique_section PARAMS ((tree, int)); static void mcore_encode_section_info PARAMS ((tree, int)); +static const char *mcore_strip_name_encoding PARAMS ((const char *)); /* Initialize the GCC target structure. */ #ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES @@ -159,6 +160,8 @@ static void mcore_encode_section_info PARAMS ((tree, int)); #define TARGET_ASM_UNIQUE_SECTION mcore_unique_section #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO mcore_encode_section_info +#undef TARGET_STRIP_NAME_ENCODING +#define TARGET_STRIP_NAME_ENCODING mcore_strip_name_encoding struct gcc_target targetm = TARGET_INITIALIZER; @@ -3467,6 +3470,15 @@ mcore_encode_section_info (decl, first) } } +/* Undo the effects of the above. */ + +static const char * +mcore_strip_name_encoding (str) + const char *str; +{ + return str + (str[0] == '@' ? 3 : 0); +} + /* MCore specific attribute support. dllexport - for exporting a function/variable that will live in a dll dllimport - for importing a function/variable from a dll @@ -3535,7 +3547,7 @@ mcore_unique_section (decl, reloc) name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); /* Strip off any encoding in name. */ - STRIP_NAME_ENCODING (name, name); + name = (* targetm.strip_name_encoding) (name); /* The object is put in, for example, section .text$foo. The linker will then ultimately place them in .text diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h index da9d20c..682039e 100644 --- a/gcc/config/mcore/mcore.h +++ b/gcc/config/mcore/mcore.h @@ -1119,8 +1119,8 @@ switch_to_section (section, decl) \ /* Output a reference to a label. */ #undef ASM_OUTPUT_LABELREF #define ASM_OUTPUT_LABELREF(STREAM, NAME) \ - fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, MCORE_STRIP_NAME_ENCODING (NAME)) - + fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, \ + (* targetm.strip_name_encoding) (NAME)) /* This is how to output an assembler line that says to advance the location counter @@ -1133,16 +1133,6 @@ switch_to_section (section, decl) \ #define ASM_DECLARE_RESULT(FILE, RESULT) #endif -/* Strip export encoding from a function name. */ -#define MCORE_STRIP_NAME_ENCODING(SYM_NAME) \ - ((SYM_NAME) + ((SYM_NAME)[0] == '@' ? 3 : 0)) - -/* Strip any text from SYM_NAME added by targetm.encode_section_info - and store the result in VAR. */ -#undef STRIP_NAME_ENCODING -#define STRIP_NAME_ENCODING(VAR, SYM_NAME) \ - (VAR) = MCORE_STRIP_NAME_ENCODING (SYM_NAME) - #define MULTIPLE_SYMBOL_SPACES 1 #define SUPPORTS_ONE_ONLY 1 |