+ 3) If any of the three ways of changing DECL_ASSEMBLER_NAME is
+ applied to a decl whose DECL_ASSEMBLER_NAME is already set, and the
+ new name is different, a warning issues and the name does not change.
+
+ 4) The "source name" for #pragma redefine_extname is the DECL_NAME,
+ *not* the DECL_ASSEMBLER_NAME.
+
+ 5) If #pragma extern_prefix is in effect and a declaration occurs
+ with an __asm__ name, the #pragma extern_prefix is silently
+ ignored for that declaration.
+
+ 6) If #pragma extern_prefix and #pragma redefine_extname apply to
+ the same declaration, whichever triggered first wins, and a warning
+ is issued. (We would like to have #pragma redefine_extname always
+ win, but it can appear either before or after the declaration, and
+ if it appears afterward, we have no way of knowing whether a modified
+ DECL_ASSEMBLER_NAME is due to #pragma extern_prefix.) */
+
+static GTY(()) tree pending_redefine_extname;
+
+static void handle_pragma_redefine_extname (cpp_reader *);
+
+/* #pragma redefine_extname oldname newname */
+static void
+handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy))
+{
+ tree oldname, newname, decl, x;
+ enum cpp_ttype t;
+
+ if (c_lex (&oldname) != CPP_NAME)
+ GCC_BAD ("malformed #pragma redefine_extname, ignored");
+ if (c_lex (&newname) != CPP_NAME)
+ GCC_BAD ("malformed #pragma redefine_extname, ignored");
+ t = c_lex (&x);
+ if (t != CPP_EOF)
+ warning ("junk at end of #pragma redefine_extname");
+
+ if (!flag_mudflap && !targetm.handle_pragma_redefine_extname)
+ {
+ if (warn_unknown_pragmas > in_system_header)
+ warning ("#pragma redefine_extname not supported on this target");
+ return;
+ }
+
+ decl = identifier_global_value (oldname);
+ if (decl
+ && (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl))
+ && (TREE_CODE (decl) == FUNCTION_DECL
+ || TREE_CODE (decl) == VAR_DECL)
+ && has_c_linkage (decl))
+ {
+ if (DECL_ASSEMBLER_NAME_SET_P (decl))