home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / armlinux / alpha / PARTITIONS / USR_GZ / usr / include / gnu-stab.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-14  |  4.1 KB  |  141 lines

  1. /* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. #ifndef    __GNU_STABS_H
  20.  
  21. #define    __GNU_STABS_H    1
  22.  
  23. /* We will figure it out later. H.J. */
  24. #if !defined(__PIC__) && !defined(__pic__)
  25. #ifndef    HAVE_GNU_LD
  26. #define HAVE_GNU_LD
  27. #endif
  28. #endif
  29.  
  30. #ifdef    HAVE_GNU_LD
  31.  
  32. /* Alias a function:
  33.        function_alias(creat, _creat, int, (file, mode),
  34.                DEFUN(creat, (file, mode),
  35.                      CONST char *file AND int mode))
  36.    Yes, this is very repetitive.  Nothing you can do about it, so shut up.  */
  37. #define    function_alias(name, _name, type, args, defun) \
  38.   symbol_alias (_name, name);
  39.  
  40. #define function_alias_void(name, _name, args, defun) \
  41.   symbol_alias (_name, name);
  42.  
  43. /* Make references to ALIAS refer to SYMBOL.  */
  44. #ifdef    __STDC__
  45. #ifdef __ELF__
  46. #define    symbol_alias(symbol, alias)    \
  47.   asm(".stabs \"" #alias "\",11,0,0,0\n"\
  48.       ".stabs \"" #symbol "\",1,0,0,0")
  49. #else
  50. #define    symbol_alias(symbol, alias)    \
  51.   asm(".stabs \"" "_" #alias "\",11,0,0,0\n"\
  52.       ".stabs \"" "_" #symbol "\",1,0,0,0")
  53. #endif
  54. #else
  55. /* Your assembler better grok this right!  */
  56. #ifdef __ELF__
  57. #define    symbol_alias(symbol, alias)    \
  58.   asm(".stabs \"_/**/alias\",11,0,0,0\n.stabs \"_/**/symbol\",1,0,0,0")
  59. #else
  60. #define    symbol_alias(symbol, alias)    \
  61.   asm(".stabs \"alias\",11,0,0,0\n.stabs \"symbol\",1,0,0,0")
  62. #endif
  63. #endif
  64.  
  65. /* Issue a warning message from the linker whenever SYMBOL is referenced.  */
  66. #ifdef    __STDC__
  67. #ifdef __ELF__
  68. #define    warn_references(symbol, msg)    \
  69.   asm(".stabs \"" msg "\",30,0,0,0\n"    \
  70.       ".stabs \"" #symbol "\",1,0,0,0")
  71. #else
  72. #define    warn_references(symbol, msg)    \
  73.   asm(".stabs \"" msg "\",30,0,0,0\n"    \
  74.       ".stabs \"_" #symbol "\",1,0,0,0")
  75. #endif
  76. #else
  77. #ifdef __ELF__
  78. #define    warn_references(symbol, msg)    \
  79.   asm(".stabs msg,30,0,0,0\n.stabs \"/**/symbol\",1,0,0,0")
  80. #else
  81. #define    warn_references(symbol, msg)    \
  82.   asm(".stabs msg,30,0,0,0\n.stabs \"_/**/symbol\",1,0,0,0")
  83. #endif
  84. #endif
  85.  
  86. #ifdef    __STDC__
  87. #define    stub_warning(name) \
  88.   warn_references(name, \
  89.           "warning: " #name " is not implemented and will always fail")
  90. #else
  91. #define    stub_warning(name) \
  92.   warn_references(name, \
  93.           "warning: name is not implemented and will always fail")
  94. #endif
  95.  
  96. #ifdef    __STDC__
  97. #ifdef __ELF__
  98. #define    text_set_element(set, symbol)    \
  99.   asm(".stabs \"" #set "\",23,0,0," #symbol)
  100. #define    data_set_element(set, symbol)    \
  101.   asm(".stabs \"" #set "\",25,0,0," #symbol)
  102. #else
  103. #define    text_set_element(set, symbol)    \
  104.   asm(".stabs \"_" #set "\",23,0,0,_" #symbol)
  105. #define    data_set_element(set, symbol)    \
  106.   asm(".stabs \"_" #set "\",25,0,0,_" #symbol)
  107. #endif
  108. #else
  109. #ifdef __ELF__
  110. #define    text_set_element(set, symbol)    \
  111.   asm(".stabs \"/**/set\",23,0,0,/**/symbol")
  112. #define    data_set_element(set, symbol)    \
  113.   asm(".stabs \"/**/set\",25,0,0,/**/symbol")
  114. #else
  115. #define    text_set_element(set, symbol)    \
  116.   asm(".stabs \"_/**/set\",23,0,0,_/**/symbol")
  117. #define    data_set_element(set, symbol)    \
  118.   asm(".stabs \"_/**/set\",25,0,0,_/**/symbol")
  119. #endif
  120. #endif
  121.  
  122. #else    /* No GNU stabs.  */
  123.  
  124. #define    function_alias(name, _name, type, args, defun) \
  125.   type defun { return _name args; }
  126.  
  127. #define function_alias_void(name, _name, args, defun) \
  128.   void defun { _name args; }
  129.  
  130. #endif    /* GNU stabs.  */
  131.  
  132. #ifdef __ELF__
  133. /* Alias macros for ELF */
  134. #define elf_alias(name1, name2) \
  135.   __asm__(".globl " #name2 "; " #name2 "=" #name1)
  136. #define weak_alias(name1, name2) \
  137.   __asm__(".weak " #name2 "; " #name2 "=" #name1)
  138. #endif
  139.  
  140. #endif    /* gnu-stabs.h  */
  141.