gcc: Symbol-Renaming Pragmas

1 
1 6.61.9 Symbol-Renaming Pragmas
1 ------------------------------
1 
1 GCC supports a '#pragma' directive that changes the name used in
1 assembly for a given declaration.  While this pragma is supported on all
1 platforms, it is intended primarily to provide compatibility with the
1 Solaris system headers.  This effect can also be achieved using the asm
1 labels extension (⇒Asm Labels).
1 
1 'redefine_extname OLDNAME NEWNAME'
1 
1      This pragma gives the C function OLDNAME the assembly symbol
1      NEWNAME.  The preprocessor macro '__PRAGMA_REDEFINE_EXTNAME' is
1      defined if this pragma is available (currently on all platforms).
1 
1  This pragma and the asm labels extension interact in a complicated
1 manner.  Here are some corner cases you may want to be aware of:
1 
1   1. This pragma silently applies only to declarations with external
1      linkage.  Asm labels do not have this restriction.
1 
1   2. In C++, this pragma silently applies only to declarations with "C"
1      linkage.  Again, asm labels do not have this restriction.
1 
1   3. If either of the ways of changing the assembly name of a
1      declaration are applied to a declaration whose assembly name has
1      already been determined (either by a previous use of one of these
1      features, or because the compiler needed the assembly name in order
1      to generate code), and the new name is different, a warning issues
1      and the name does not change.
1 
1   4. The OLDNAME used by '#pragma redefine_extname' is always the
1      C-language name.
1