home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / binutils-2.7-src.tgz / tar.out / fsf / binutils / bfd / archures.c < prev    next >
C/C++ Source or Header  |  1996-09-28  |  17KB  |  724 lines

  1. /* BFD library support routines for architectures.
  2.    Copyright (C) 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
  3.    Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
  4.  
  5. This file is part of BFD, the Binary File Descriptor library.
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  20.  
  21. #include "bfd.h"
  22. #include "sysdep.h"
  23. #include "libbfd.h"
  24. #include <ctype.h>
  25.  
  26. /*
  27.  
  28. SECTION
  29.     Architectures
  30.  
  31.     BFD keeps one atom in a BFD describing the
  32.     architecture of the data attached to the BFD: a pointer to a
  33.     <<bfd_arch_info_type>>.  
  34.  
  35.     Pointers to structures can be requested independently of a BFD
  36.     so that an architecture's information can be interrogated
  37.     without access to an open BFD.
  38.  
  39.     The architecture information is provided by each architecture package.
  40.     The set of default architectures is selected by the macro
  41.     <<SELECT_ARCHITECTURES>>.  This is normally set up in the
  42.     @file{config/@var{target}.mt} file of your choice.  If the name is not
  43.     defined, then all the architectures supported are included. 
  44.  
  45.     When BFD starts up, all the architectures are called with an
  46.     initialize method.  It is up to the architecture back end to
  47.     insert as many items into the list of architectures as it wants to;
  48.     generally this would be one for each machine and one for the
  49.     default case (an item with a machine field of 0). 
  50.  
  51.     BFD's idea of an architecture is implemented in    @file{archures.c}.
  52. */
  53.  
  54. /*
  55.  
  56. SUBSECTION
  57.     bfd_architecture
  58.  
  59. DESCRIPTION
  60.     This enum gives the object file's CPU architecture, in a
  61.     global sense---i.e., what processor family does it belong to?
  62.     Another field indicates which processor within
  63.     the family is in use.  The machine gives a number which
  64.     distinguishes different versions of the architecture,
  65.     containing, for example, 2 and 3 for Intel i960 KA and i960 KB,
  66.     and 68020 and 68030 for Motorola 68020 and 68030. 
  67.  
  68. .enum bfd_architecture 
  69. .{
  70. .  bfd_arch_unknown,   {* File arch not known *}
  71. .  bfd_arch_obscure,   {* Arch known, not one of these *}
  72. .  bfd_arch_m68k,      {* Motorola 68xxx *}
  73. .  bfd_arch_vax,       {* DEC Vax *}   
  74. .  bfd_arch_i960,      {* Intel 960 *}
  75. .    {* The order of the following is important.
  76. .       lower number indicates a machine type that 
  77. .       only accepts a subset of the instructions
  78. .       available to machines with higher numbers.
  79. .       The exception is the "ca", which is
  80. .       incompatible with all other machines except 
  81. .       "core". *}
  82. .
  83. .#define bfd_mach_i960_core      1
  84. .#define bfd_mach_i960_ka_sa     2
  85. .#define bfd_mach_i960_kb_sb     3
  86. .#define bfd_mach_i960_mc        4
  87. .#define bfd_mach_i960_xa        5
  88. .#define bfd_mach_i960_ca        6
  89. .#define bfd_mach_i960_jx     7
  90. .#define bfd_mach_i960_hx        8
  91. .
  92. .  bfd_arch_a29k,      {* AMD 29000 *}
  93. .  bfd_arch_sparc,     {* SPARC *}
  94. .#define bfd_mach_sparc            1
  95. .{* The difference between v8plus and v9 is that v9 is a true 64 bit env.  *}
  96. .#define bfd_mach_sparc_sparclet    2
  97. .#define bfd_mach_sparc_sparclite    3
  98. .#define bfd_mach_sparc_v8plus        4
  99. .#define bfd_mach_sparc_v8plusa        5 {* with ultrasparc add'ns *}
  100. .#define bfd_mach_sparc_v9        6
  101. .#define bfd_mach_sparc_v9a        7 {* with ultrasparc add'ns *}
  102. .{* Nonzero if MACH has the v9 instruction set.  *}
  103. .#define bfd_mach_sparc_v9_p(mach) \
  104. .  ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a)
  105. .  bfd_arch_mips,      {* MIPS Rxxxx *}
  106. .  bfd_arch_i386,      {* Intel 386 *}
  107. .  bfd_arch_we32k,     {* AT&T WE32xxx *}
  108. .  bfd_arch_tahoe,     {* CCI/Harris Tahoe *}
  109. .  bfd_arch_i860,      {* Intel 860 *}
  110. .  bfd_arch_romp,      {* IBM ROMP PC/RT *}
  111. .  bfd_arch_alliant,   {* Alliant *}
  112. .  bfd_arch_convex,    {* Convex *}
  113. .  bfd_arch_m88k,      {* Motorola 88xxx *}
  114. .  bfd_arch_pyramid,   {* Pyramid Technology *}
  115. .  bfd_arch_h8300,     {* Hitachi H8/300 *}
  116. .#define bfd_mach_h8300   1
  117. .#define bfd_mach_h8300h  2
  118. .  bfd_arch_powerpc,   {* PowerPC *}
  119. .  bfd_arch_rs6000,    {* IBM RS/6000 *}
  120. .  bfd_arch_hppa,      {* HP PA RISC *}
  121. .  bfd_arch_z8k,       {* Zilog Z8000 *}
  122. .#define bfd_mach_z8001        1
  123. .#define bfd_mach_z8002        2
  124. .  bfd_arch_h8500,     {* Hitachi H8/500 *}
  125. .  bfd_arch_sh,        {* Hitachi SH *}
  126. .  bfd_arch_alpha,     {* Dec Alpha *}
  127. .  bfd_arch_arm,       {* Advanced Risc Machines ARM *}
  128. .  bfd_arch_ns32k,     {* National Semiconductors ns32000 *}
  129. .  bfd_arch_w65,       {* WDC 65816 *}
  130. .  bfd_arch_last
  131. .  };
  132.  
  133.  
  134. */
  135.  
  136. /*
  137.  
  138. SUBSECTION
  139.     bfd_arch_info
  140.  
  141. DESCRIPTION
  142.     This structure contains information on architectures for use
  143.     within BFD.
  144.  
  145. .
  146. .typedef struct bfd_arch_info 
  147. .{
  148. .  int bits_per_word;
  149. .  int bits_per_address;
  150. .  int bits_per_byte;
  151. .  enum bfd_architecture arch;
  152. .  unsigned long mach;
  153. .  const char *arch_name;
  154. .  const char *printable_name;
  155. .  unsigned int section_align_power;
  156. . {* true if this is the default machine for the architecture *}
  157. .  boolean the_default;    
  158. .  const struct bfd_arch_info * (*compatible)
  159. .    PARAMS ((const struct bfd_arch_info *a,
  160. .             const struct bfd_arch_info *b));
  161. .
  162. .  boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
  163. .
  164. .  const struct bfd_arch_info *next;
  165. .} bfd_arch_info_type;
  166. */
  167.  
  168. extern const bfd_arch_info_type bfd_a29k_arch;
  169. extern const bfd_arch_info_type bfd_alpha_arch;
  170. extern const bfd_arch_info_type bfd_arm_arch;
  171. extern const bfd_arch_info_type bfd_h8300_arch;
  172. extern const bfd_arch_info_type bfd_h8500_arch;
  173. extern const bfd_arch_info_type bfd_hppa_arch;
  174. extern const bfd_arch_info_type bfd_i386_arch;
  175. extern const bfd_arch_info_type bfd_i860_arch;
  176. extern const bfd_arch_info_type bfd_i960_arch;
  177. extern const bfd_arch_info_type bfd_m68k_arch;
  178. extern const bfd_arch_info_type bfd_m88k_arch;
  179. extern const bfd_arch_info_type bfd_mips_arch;
  180. extern const bfd_arch_info_type bfd_powerpc_arch;
  181. extern const bfd_arch_info_type bfd_rs6000_arch;
  182. extern const bfd_arch_info_type bfd_sh_arch;
  183. extern const bfd_arch_info_type bfd_sparc_arch;
  184. extern const bfd_arch_info_type bfd_vax_arch;
  185. extern const bfd_arch_info_type bfd_we32k_arch;
  186. extern const bfd_arch_info_type bfd_z8k_arch;
  187. extern const bfd_arch_info_type bfd_ns32k_arch;
  188. extern const bfd_arch_info_type bfd_w65_arch;
  189.  
  190. static const bfd_arch_info_type * const bfd_archures_list[] =
  191. {
  192. #ifdef SELECT_ARCHITECTURES
  193.   SELECT_ARCHITECTURES,
  194. #else
  195.   &bfd_a29k_arch,
  196.   &bfd_alpha_arch,
  197.   &bfd_arm_arch,
  198.   &bfd_h8300_arch,
  199.   &bfd_h8500_arch,
  200.   &bfd_hppa_arch,
  201.   &bfd_i386_arch,
  202.   &bfd_i860_arch,
  203.   &bfd_i960_arch,
  204.   &bfd_m68k_arch,
  205.   &bfd_m88k_arch,
  206.   &bfd_mips_arch,
  207.   &bfd_powerpc_arch,
  208.   &bfd_rs6000_arch,
  209.   &bfd_sh_arch,
  210.   &bfd_sparc_arch,
  211.   &bfd_vax_arch,
  212.   &bfd_we32k_arch,
  213.   &bfd_z8k_arch,
  214.   &bfd_ns32k_arch,
  215.   &bfd_w65_arch,
  216. #endif
  217.   0
  218. };
  219.  
  220. /*
  221. FUNCTION
  222.     bfd_printable_name
  223.  
  224. SYNOPSIS
  225.     const char *bfd_printable_name(bfd *abfd);
  226.  
  227. DESCRIPTION
  228.     Return a printable string representing the architecture and machine
  229.     from the pointer to the architecture info structure.
  230.  
  231. */
  232.  
  233. const char *
  234. bfd_printable_name (abfd)
  235.      bfd *abfd;
  236. {
  237.   return abfd->arch_info->printable_name;
  238. }
  239.  
  240.  
  241.  
  242. /*
  243. FUNCTION
  244.     bfd_scan_arch
  245.  
  246. SYNOPSIS
  247.     const bfd_arch_info_type *bfd_scan_arch(const char *string);
  248.  
  249. DESCRIPTION
  250.     Figure out if BFD supports any cpu which could be described with
  251.     the name @var{string}.  Return a pointer to an <<arch_info>>
  252.     structure if a machine is found, otherwise NULL.
  253.  
  254. */
  255.  
  256. const bfd_arch_info_type *
  257. bfd_scan_arch (string)
  258.      const char *string;
  259. {
  260.   const bfd_arch_info_type * const *app, *ap;
  261.  
  262.   /* Look through all the installed architectures */
  263.   for (app = bfd_archures_list; *app != NULL; app++)
  264.     {
  265.       for (ap = *app; ap != NULL; ap = ap->next)
  266.     {
  267.       if (ap->scan (ap, string))
  268.         return ap;
  269.     }
  270.     }
  271.  
  272.   return NULL;
  273. }
  274.  
  275.  
  276.  
  277. /*
  278. FUNCTION
  279.     bfd_arch_get_compatible
  280.  
  281. SYNOPSIS
  282.     const bfd_arch_info_type *bfd_arch_get_compatible(
  283.         const bfd *abfd,
  284.             const bfd *bbfd);
  285.  
  286. DESCRIPTION
  287.     Determine whether two BFDs'
  288.     architectures and machine types are compatible.  Calculates
  289.     the lowest common denominator between the two architectures
  290.     and machine types implied by the BFDs and returns a pointer to
  291.     an <<arch_info>> structure describing the compatible machine.
  292. */
  293.  
  294. const bfd_arch_info_type *
  295. bfd_arch_get_compatible (abfd, bbfd)
  296.      const bfd *abfd;
  297.      const bfd *bbfd;
  298. {
  299.   /* If either architecture is unknown, then all we can do is assume
  300.      the user knows what he's doing.  */
  301.   if (abfd->arch_info->arch == bfd_arch_unknown)
  302.       return bbfd->arch_info;
  303.   if (bbfd->arch_info->arch == bfd_arch_unknown)
  304.       return abfd->arch_info;
  305.  
  306.   /* Otherwise architecture-specific code has to decide.  */
  307.   return abfd->arch_info->compatible (abfd->arch_info, bbfd->arch_info);
  308. }
  309.  
  310.  
  311. /*
  312. INTERNAL_DEFINITION
  313.     bfd_default_arch_struct
  314.  
  315. DESCRIPTION
  316.     The <<bfd_default_arch_struct>> is an item of
  317.     <<bfd_arch_info_type>> which has been initialized to a fairly
  318.     generic state.  A BFD starts life by pointing to this
  319.     structure, until the correct back end has determined the real
  320.     architecture of the file.
  321.  
  322. .extern const bfd_arch_info_type bfd_default_arch_struct;
  323.  
  324. */
  325.  
  326. const bfd_arch_info_type bfd_default_arch_struct =
  327. {
  328.     32,32,8,bfd_arch_unknown,0,"unknown","unknown",2,true,
  329.     bfd_default_compatible,
  330.     bfd_default_scan, 
  331.     0,
  332. };
  333.  
  334. /*
  335. FUNCTION
  336.     bfd_set_arch_info
  337.  
  338. SYNOPSIS
  339.     void bfd_set_arch_info(bfd *abfd, const bfd_arch_info_type *arg);
  340.  
  341. DESCRIPTION
  342.     Set the architecture info of @var{abfd} to @var{arg}.
  343. */
  344.  
  345. void
  346. bfd_set_arch_info (abfd, arg)
  347.      bfd *abfd;
  348.      const bfd_arch_info_type *arg;
  349. {
  350.   abfd->arch_info = arg;
  351. }
  352.  
  353. /*
  354. INTERNAL_FUNCTION
  355.     bfd_default_set_arch_mach
  356.  
  357. SYNOPSIS
  358.     boolean bfd_default_set_arch_mach(bfd *abfd,
  359.         enum bfd_architecture arch,
  360.         unsigned long mach);
  361.  
  362. DESCRIPTION
  363.     Set the architecture and machine type in BFD @var{abfd}
  364.     to @var{arch} and @var{mach}.  Find the correct
  365.     pointer to a structure and insert it into the <<arch_info>>
  366.     pointer. 
  367. */
  368.  
  369. boolean
  370. bfd_default_set_arch_mach (abfd, arch, mach)
  371.      bfd *abfd;
  372.      enum bfd_architecture arch;
  373.      unsigned long mach;
  374. {
  375.   const bfd_arch_info_type * const *app, *ap;
  376.  
  377.   for (app = bfd_archures_list; *app != NULL; app++)
  378.     {
  379.       for (ap = *app; ap != NULL; ap = ap->next)
  380.     {
  381.       if (ap->arch == arch
  382.           && (ap->mach == mach
  383.           || (mach == 0 && ap->the_default)))
  384.         {
  385.           abfd->arch_info = ap;
  386.           return true;
  387.         }
  388.     }
  389.     }
  390.  
  391.   abfd->arch_info = &bfd_default_arch_struct;
  392.   bfd_set_error (bfd_error_bad_value);
  393.   return false;
  394. }
  395.  
  396.  
  397. /*
  398. FUNCTION
  399.     bfd_get_arch
  400.  
  401. SYNOPSIS
  402.     enum bfd_architecture bfd_get_arch(bfd *abfd);
  403.  
  404. DESCRIPTION
  405.     Return the enumerated type which describes the BFD @var{abfd}'s
  406.     architecture.
  407.  
  408. */
  409.  
  410. enum bfd_architecture
  411. bfd_get_arch (abfd)
  412.      bfd *abfd;
  413. {
  414.     return abfd->arch_info->arch;
  415. }
  416.  
  417. /*
  418. FUNCTION
  419.     bfd_get_mach
  420.  
  421. SYNOPSIS
  422.     unsigned long bfd_get_mach(bfd *abfd);
  423.  
  424. DESCRIPTION
  425.     Return the long type which describes the BFD @var{abfd}'s
  426.     machine.
  427. */
  428.  
  429. unsigned long  
  430. bfd_get_mach (abfd)
  431.      bfd *abfd;
  432. {
  433.     return abfd->arch_info->mach;
  434. }
  435.  
  436. /*
  437. FUNCTION
  438.     bfd_arch_bits_per_byte
  439.  
  440. SYNOPSIS
  441.     unsigned int bfd_arch_bits_per_byte(bfd *abfd);
  442.  
  443. DESCRIPTION
  444.     Return the number of bits in one of the BFD @var{abfd}'s
  445.     architecture's bytes.
  446.  
  447. */
  448.  
  449. unsigned int
  450. bfd_arch_bits_per_byte (abfd)
  451.      bfd *abfd;
  452. {
  453.   return abfd->arch_info->bits_per_byte;
  454. }
  455.  
  456. /*
  457. FUNCTION
  458.     bfd_arch_bits_per_address
  459.  
  460. SYNOPSIS
  461.     unsigned int bfd_arch_bits_per_address(bfd *abfd);
  462.  
  463. DESCRIPTION
  464.     Return the number of bits in one of the BFD @var{abfd}'s
  465.     architecture's addresses.
  466. */
  467.  
  468. unsigned int
  469. bfd_arch_bits_per_address (abfd)
  470.      bfd *abfd;
  471. {
  472.   return abfd->arch_info->bits_per_address;
  473. }
  474.  
  475.  
  476. /*
  477. INTERNAL_FUNCTION 
  478.     bfd_default_compatible
  479.  
  480. SYNOPSIS
  481.     const bfd_arch_info_type *bfd_default_compatible
  482.     (const bfd_arch_info_type *a,
  483.     const bfd_arch_info_type *b);
  484.  
  485. DESCRIPTION
  486.     The default function for testing for compatibility.
  487. */
  488.  
  489. const bfd_arch_info_type *
  490. bfd_default_compatible (a,b)
  491.      const bfd_arch_info_type *a;
  492.      const bfd_arch_info_type *b;
  493. {
  494.   if (a->arch != b->arch)
  495.     return NULL;
  496.  
  497.   if (a->mach > b->mach)
  498.     return a;
  499.  
  500.   if (b->mach > a->mach)
  501.     return b;
  502.  
  503.   return a;
  504. }
  505.  
  506.  
  507. /*
  508. INTERNAL_FUNCTION
  509.     bfd_default_scan
  510.  
  511. SYNOPSIS
  512.     boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string);
  513.  
  514. DESCRIPTION
  515.     The default function for working out whether this is an
  516.     architecture hit and a machine hit.
  517. */
  518.  
  519. boolean 
  520. bfd_default_scan (info, string)
  521.      const struct bfd_arch_info *info;
  522.      const char *string;
  523. {
  524.   const char *ptr_src;
  525.   const char *ptr_tst;
  526.   unsigned long number;
  527.   enum bfd_architecture arch;
  528.  
  529.   /* First test for an exact match */
  530.   if (strcmp (string, info->printable_name) == 0)
  531.     return true;
  532.  
  533.   /* See how much of the supplied string matches with the
  534.      architecture, eg the string m68k:68020 would match the 68k entry
  535.      up to the :, then we get left with the machine number */
  536.  
  537.   for (ptr_src = string, ptr_tst = info->arch_name; 
  538.        *ptr_src && *ptr_tst;
  539.        ptr_src++, ptr_tst++) 
  540.     {
  541.       if (*ptr_src != *ptr_tst) break;
  542.     }
  543.  
  544.   /* Chewed up as much of the architecture as will match, skip any
  545.      colons */
  546.   if (*ptr_src == ':')
  547.     ptr_src++;
  548.   
  549.   if (*ptr_src == 0)
  550.     {
  551.       /* nothing more, then only keep this one if it is the default
  552.      machine for this architecture */
  553.       return info->the_default;
  554.     }
  555.  
  556.   number = 0;
  557.   while (isdigit(*ptr_src))
  558.     {
  559.       number = number * 10 + *ptr_src  - '0';
  560.       ptr_src++;
  561.     }
  562.  
  563.   switch (number) 
  564.     {
  565.     case 65:
  566.       arch = bfd_arch_w65;
  567.       break;
  568.  
  569.     case 300:
  570.       arch = bfd_arch_h8300;
  571.       break;
  572.  
  573.     case 500:
  574.       arch = bfd_arch_h8500;
  575.       break;
  576.  
  577.     case 68010:
  578.     case 68020:
  579.     case 68030:
  580.     case 68040:
  581.     case 68332:
  582.     case 68050:        
  583.     case 68000: 
  584.       arch = bfd_arch_m68k; 
  585.       break;
  586.  
  587.     case 386: 
  588.     case 80386:
  589.     case 486:
  590.     case 80486:
  591.       arch = bfd_arch_i386;
  592.       break;
  593.  
  594.     case 29000: 
  595.       arch = bfd_arch_a29k;
  596.       break;
  597.  
  598.     case 8000:
  599.       arch = bfd_arch_z8k;
  600.       break;
  601.  
  602.     case 32000:
  603.       arch = bfd_arch_we32k;
  604.       break;
  605.  
  606.     case 860:
  607.     case 80860: 
  608.       arch = bfd_arch_i860; 
  609.       break;
  610.     case 960:
  611.     case 80960:
  612.       arch = bfd_arch_i960;
  613.       break;
  614.  
  615.     case 2000:
  616.     case 3000:
  617.     case 4000:
  618.     case 4400:
  619.       arch = bfd_arch_mips;
  620.       break;
  621.  
  622.     case 6000:
  623.       arch = bfd_arch_rs6000;
  624.       break;
  625.  
  626.     default:  
  627.       return false;
  628.     }
  629.  
  630.   if (arch != info->arch) 
  631.     return false;
  632.  
  633.   if (number != info->mach)
  634.     return false;
  635.  
  636.   return true;
  637. }
  638.  
  639.  
  640. /*
  641. FUNCTION
  642.     bfd_get_arch_info
  643.  
  644. SYNOPSIS
  645.     const bfd_arch_info_type * bfd_get_arch_info(bfd *abfd);
  646.  
  647. DESCRIPTION
  648.     Return the architecture info struct in @var{abfd}.
  649. */
  650.  
  651. const bfd_arch_info_type *
  652. bfd_get_arch_info (abfd)
  653.      bfd *abfd;
  654. {
  655.   return abfd->arch_info;
  656. }
  657.  
  658.  
  659. /*
  660. FUNCTION
  661.     bfd_lookup_arch
  662.  
  663. SYNOPSIS
  664.     const bfd_arch_info_type *bfd_lookup_arch
  665.         (enum bfd_architecture
  666.         arch,
  667.         unsigned long machine);
  668.  
  669. DESCRIPTION
  670.     Look for the architecure info structure which matches the
  671.     arguments @var{arch} and @var{machine}. A machine of 0 matches the
  672.     machine/architecture structure which marks itself as the
  673.     default.
  674. */
  675.  
  676. const bfd_arch_info_type * 
  677. bfd_lookup_arch (arch, machine)
  678.      enum bfd_architecture arch;
  679.      unsigned long machine;
  680. {
  681.   const bfd_arch_info_type * const *app, *ap;
  682.  
  683.   for (app = bfd_archures_list; *app != NULL; app++)
  684.     {
  685.       for (ap = *app; ap != NULL; ap = ap->next)
  686.     {
  687.       if (ap->arch == arch
  688.           && (ap->mach == machine
  689.           || (machine == 0 && ap->the_default)))
  690.         return ap;
  691.     }
  692.     }
  693.  
  694.   return NULL;
  695. }
  696.  
  697.  
  698. /*
  699. FUNCTION
  700.     bfd_printable_arch_mach
  701.  
  702. SYNOPSIS
  703.     const char *bfd_printable_arch_mach
  704.         (enum bfd_architecture arch, unsigned long machine);
  705.  
  706. DESCRIPTION
  707.     Return a printable string representing the architecture and
  708.     machine type. 
  709.  
  710.     This routine is depreciated.
  711. */
  712.  
  713. const char *
  714. bfd_printable_arch_mach (arch, machine)
  715.      enum bfd_architecture arch;
  716.      unsigned long machine;
  717. {
  718.     const bfd_arch_info_type *ap = bfd_lookup_arch (arch, machine);
  719.  
  720.     if (ap)
  721.       return ap->printable_name;
  722.     return "UNKNOWN!";
  723. }
  724.