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 / coff-i960.c < prev    next >
C/C++ Source or Header  |  1996-09-28  |  20KB  |  684 lines

  1. /* BFD back-end for Intel 960 COFF files.
  2.    Copyright (C) 1990, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
  3.    Written by 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. #define I960 1
  22. #define BADMAG(x) I960BADMAG(x)
  23.  
  24. #include "bfd.h"
  25. #include "sysdep.h"
  26. #include "libbfd.h"
  27. #include "obstack.h"
  28. #include "coff/i960.h"
  29. #include "coff/internal.h"
  30. #include "libcoff.h"        /* to allow easier abstraction-breaking */
  31.  
  32. static bfd_reloc_status_type optcall_callback
  33.   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
  34. static bfd_reloc_status_type coff_i960_relocate
  35.   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
  36. static reloc_howto_type *coff_i960_reloc_type_lookup
  37.   PARAMS ((bfd *, bfd_reloc_code_real_type));
  38. static boolean coff_i960_start_final_link
  39.   PARAMS ((bfd *, struct bfd_link_info *));
  40. static boolean coff_i960_relocate_section
  41.   PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
  42.        struct internal_reloc *, struct internal_syment *, asection **));
  43. static boolean coff_i960_adjust_symndx
  44.   PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
  45.        struct internal_reloc *, boolean *));
  46.  
  47. #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
  48.  
  49. /* The i960 does not support an MMU, so COFF_PAGE_SIZE can be
  50.    arbitrarily small.  */
  51. #define COFF_PAGE_SIZE 1
  52.  
  53. #define COFF_LONG_FILENAMES
  54.  
  55. /* This is just like the usual CALC_ADDEND, but it includes the
  56.    section VMA for PC relative relocs.  */
  57. #ifndef CALC_ADDEND
  58. #define CALC_ADDEND(abfd, ptr, reloc, cache_ptr)                \
  59.   {                                                             \
  60.     coff_symbol_type *coffsym = (coff_symbol_type *) NULL;      \
  61.     if (ptr && bfd_asymbol_bfd (ptr) != abfd)                   \
  62.       coffsym = (obj_symbols (abfd)                             \
  63.                  + (cache_ptr->sym_ptr_ptr - symbols));         \
  64.     else if (ptr)                                               \
  65.       coffsym = coff_symbol_from (abfd, ptr);                   \
  66.     if (coffsym != (coff_symbol_type *) NULL                    \
  67.         && coffsym->native->u.syment.n_scnum == 0)              \
  68.       cache_ptr->addend = 0;                                    \
  69.     else if (ptr && bfd_asymbol_bfd (ptr) == abfd               \
  70.              && ptr->section != (asection *) NULL)              \
  71.       cache_ptr->addend = - (ptr->section->vma + ptr->value);   \
  72.     else                                                        \
  73.       cache_ptr->addend = 0;                                    \
  74.     if (ptr && (reloc.r_type == 25 || reloc.r_type == 27))    \
  75.       cache_ptr->addend += asect->vma;                \
  76.   }
  77. #endif
  78.  
  79. #define CALLS     0x66003800    /* Template for 'calls' instruction    */
  80. #define BAL     0x0b000000    /* Template for 'bal' instruction    */
  81. #define BAL_MASK 0x00ffffff
  82.  
  83. static bfd_reloc_status_type 
  84. optcall_callback (abfd, reloc_entry, symbol_in, data,
  85.           input_section, ignore_bfd, error_message)
  86.      bfd *abfd;
  87.      arelent *reloc_entry;
  88.      asymbol *symbol_in;
  89.      PTR data;
  90.      asection *input_section;
  91.      bfd *ignore_bfd;
  92.      char **error_message;
  93. {
  94.   /* This item has already been relocated correctly, but we may be
  95.    * able to patch in yet better code - done by digging out the
  96.    * correct info on this symbol */
  97.   bfd_reloc_status_type result;
  98.   coff_symbol_type *cs = coffsymbol(symbol_in);
  99.  
  100.   /* Don't do anything with symbols which aren't tied up yet,
  101.      except move the reloc. */
  102.   if (bfd_is_und_section (cs->symbol.section)) {
  103.     reloc_entry->address += input_section->output_offset;
  104.     return bfd_reloc_ok;
  105.   }
  106.     
  107.   /* So the target symbol has to be of coff type, and the symbol 
  108.      has to have the correct native information within it */
  109.   if ((bfd_asymbol_flavour(&cs->symbol) != bfd_target_coff_flavour)
  110.       || (cs->native == (combined_entry_type *)NULL))
  111.     {
  112.       /* This is interesting, consider the case where we're outputting coff
  113.      from a mix n match input, linking from coff to a symbol defined in a
  114.      bout file will cause this match to be true. Should I complain?  This
  115.      will only work if the bout symbol is non leaf.  */
  116.       *error_message =
  117.     (char *) "uncertain calling convention for non-COFF symbol";
  118.       result = bfd_reloc_dangerous;
  119.     }
  120.   else
  121.     {
  122.     switch (cs->native->u.syment.n_sclass) 
  123.       {
  124.       case C_LEAFSTAT:
  125.       case C_LEAFEXT:
  126.       /* This is a call to a leaf procedure, replace instruction with a bal
  127.        to the correct location.  */
  128.     {
  129.       union internal_auxent *aux = &((cs->native+2)->u.auxent);
  130.       int word = bfd_get_32(abfd, (bfd_byte *)data + reloc_entry->address);
  131.       int olf = (aux->x_bal.x_balntry - cs->native->u.syment.n_value);
  132.       BFD_ASSERT(cs->native->u.syment.n_numaux==2);
  133.  
  134.       /* We replace the original call instruction with a bal to
  135.          the bal entry point - the offset of which is described in
  136.          the 2nd auxent of the original symbol. We keep the native
  137.          sym and auxents untouched, so the delta between the two
  138.          is the offset of the bal entry point.  */
  139.       word = ((word +  olf)  & BAL_MASK) | BAL;
  140.         bfd_put_32(abfd, word, (bfd_byte *) data + reloc_entry->address);
  141.       }
  142.     result = bfd_reloc_ok;
  143.     break;
  144.       case C_SCALL:
  145.     /* This is a call to a system call, replace with a calls to # */
  146.     BFD_ASSERT(0);
  147.     result = bfd_reloc_ok;
  148.     break;
  149.       default:
  150.     result = bfd_reloc_ok;
  151.     break;
  152.       }
  153.   }
  154.   return result;
  155. }
  156.  
  157. /* i960 COFF is used by VxWorks 5.1.  However, VxWorks 5.1 does not
  158.    appear to correctly handle a reloc against a symbol defined in the
  159.    same object file.  It appears to simply discard such relocs, rather
  160.    than adding their values into the object file.  We handle this here
  161.    by converting all relocs against defined symbols into relocs
  162.    against the section symbol, when generating a relocateable output
  163.    file.
  164.  
  165.    Note that this function is only called if we are not using the COFF
  166.    specific backend linker.  It only does something when doing a
  167.    relocateable link, which will almost certainly fail when not
  168.    generating COFF i960 output, so this function is actually no longer
  169.    useful.  It was used before this target was converted to use the
  170.    COFF specific backend linker.  */
  171.  
  172. static bfd_reloc_status_type 
  173. coff_i960_relocate (abfd, reloc_entry, symbol, data, input_section,
  174.             output_bfd, error_message)
  175.      bfd *abfd;
  176.      arelent *reloc_entry;
  177.      asymbol *symbol;
  178.      PTR data;
  179.      asection *input_section;
  180.      bfd *output_bfd;
  181.      char **error_message;
  182. {
  183.   asection *osec;
  184.  
  185.   if (output_bfd == NULL)
  186.     {
  187.       /* Not generating relocateable output file.  */
  188.       return bfd_reloc_continue;
  189.     }
  190.  
  191.   if (bfd_is_und_section (bfd_get_section (symbol)))
  192.     {
  193.       /* Symbol is not defined, so no need to worry about it.  */
  194.       return bfd_reloc_continue;
  195.     }
  196.  
  197.   if (bfd_is_com_section (bfd_get_section (symbol)))
  198.     {
  199.       /* I don't really know what the right action is for a common
  200.          symbol.  */
  201.       return bfd_reloc_continue;
  202.     }
  203.  
  204.   /* Convert the reloc to use the section symbol.  FIXME: This method
  205.      is ridiculous.  */
  206.   osec = bfd_get_section (symbol)->output_section;
  207.   if (coff_section_data (output_bfd, osec) != NULL
  208.       && coff_section_data (output_bfd, osec)->tdata != NULL)
  209.     reloc_entry->sym_ptr_ptr =
  210.       (asymbol **) coff_section_data (output_bfd, osec)->tdata;
  211.   else
  212.     {
  213.       const char *sec_name;
  214.       asymbol **syms, **sym_end;
  215.  
  216.       sec_name = bfd_get_section_name (output_bfd, osec);
  217.       syms = bfd_get_outsymbols (output_bfd);
  218.       sym_end = syms + bfd_get_symcount (output_bfd);
  219.       for (; syms < sym_end; syms++)
  220.     {
  221.       if (bfd_asymbol_name (*syms) != NULL
  222.           && (*syms)->value == 0
  223.           && strcmp ((*syms)->section->output_section->name,
  224.              sec_name) == 0)
  225.         break;
  226.     }
  227.  
  228.       if (syms >= sym_end)
  229.     abort ();
  230.  
  231.       reloc_entry->sym_ptr_ptr = syms;
  232.  
  233.       if (coff_section_data (output_bfd, osec) == NULL)
  234.     {
  235.       osec->used_by_bfd =
  236.         ((PTR) bfd_zalloc (abfd,
  237.                    sizeof (struct coff_section_tdata)));
  238.       if (osec->used_by_bfd == NULL)
  239.         return bfd_reloc_overflow;
  240.     }
  241.       coff_section_data (output_bfd, osec)->tdata = (PTR) syms;
  242.     }
  243.  
  244.   /* Let bfd_perform_relocation do its thing, which will include
  245.      stuffing the symbol addend into the object file.  */
  246.   return bfd_reloc_continue;
  247. }
  248.  
  249. static reloc_howto_type howto_rellong =
  250.   HOWTO ((unsigned int) R_RELLONG, 0, 2, 32,false, 0,
  251.      complain_overflow_bitfield, coff_i960_relocate,"rellong", true,
  252.      0xffffffff, 0xffffffff, 0);
  253. static reloc_howto_type howto_iprmed =
  254.   HOWTO (R_IPRMED, 0, 2, 24,true,0, complain_overflow_signed,
  255.      coff_i960_relocate, "iprmed ", true, 0x00ffffff, 0x00ffffff, 0);
  256. static reloc_howto_type howto_optcall =
  257.   HOWTO (R_OPTCALL, 0,2,24,true,0, complain_overflow_signed,
  258.      optcall_callback, "optcall", true, 0x00ffffff, 0x00ffffff, 0);
  259.  
  260. static reloc_howto_type *
  261. coff_i960_reloc_type_lookup (abfd, code)
  262.      bfd *abfd;
  263.      bfd_reloc_code_real_type code;
  264. {
  265.   switch (code)
  266.     {
  267.     default:
  268.       return 0;
  269.     case BFD_RELOC_I960_CALLJ:
  270.       return &howto_optcall;
  271.     case BFD_RELOC_32:
  272.     case BFD_RELOC_CTOR:
  273.       return &howto_rellong;
  274.     case BFD_RELOC_24_PCREL:
  275.       return &howto_iprmed;
  276.     }
  277. }
  278.  
  279. /* The real code is in coffcode.h */
  280.  
  281. #define RTYPE2HOWTO(cache_ptr, dst) \
  282. {                            \
  283.    reloc_howto_type *howto_ptr;                \
  284.    switch ((dst)->r_type) {                \
  285.      case 17: howto_ptr = &howto_rellong; break;    \
  286.      case 25: howto_ptr = &howto_iprmed; break;        \
  287.      case 27: howto_ptr = &howto_optcall; break;    \
  288.      default: howto_ptr = 0; break;            \
  289.      }                            \
  290.    (cache_ptr)->howto = howto_ptr;            \
  291.  }
  292.  
  293. /* i960 COFF is used by VxWorks 5.1.  However, VxWorks 5.1 does not
  294.    appear to correctly handle a reloc against a symbol defined in the
  295.    same object file.  It appears to simply discard such relocs, rather
  296.    than adding their values into the object file.  We handle this by
  297.    converting all relocs against global symbols into relocs against
  298.    internal symbols at the start of the section.  This routine is
  299.    called at the start of the linking process, and it creates the
  300.    necessary symbols.  */
  301.  
  302. static boolean
  303. coff_i960_start_final_link (abfd, info)
  304.      bfd *abfd;
  305.      struct bfd_link_info *info;
  306. {
  307.   bfd_size_type symesz = bfd_coff_symesz (abfd);
  308.   asection *o;
  309.   bfd_byte *esym;
  310.  
  311.   if (! info->relocateable)
  312.     return true;
  313.  
  314.   esym = (bfd_byte *) bfd_malloc (symesz);
  315.   if (esym == NULL)
  316.     return false;
  317.  
  318.   if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0)
  319.     return false;
  320.  
  321.   for (o = abfd->sections; o != NULL; o = o->next)
  322.     {
  323.       struct internal_syment isym;
  324.  
  325.       strncpy (isym._n._n_name, o->name, SYMNMLEN);
  326.       isym.n_value = 0;
  327.       isym.n_scnum = o->target_index;
  328.       isym.n_type = T_NULL;
  329.       isym.n_sclass = C_STAT;
  330.       isym.n_numaux = 0;
  331.  
  332.       bfd_coff_swap_sym_out (abfd, (PTR) &isym, (PTR) esym);
  333.  
  334.       if (bfd_write (esym, symesz, 1, abfd) != symesz)
  335.     {
  336.       free (esym);
  337.       return false;
  338.     }
  339.  
  340.       obj_raw_syment_count (abfd) += 1;
  341.     }
  342.  
  343.   free (esym);
  344.  
  345.   return true;
  346. }
  347.  
  348. /* The reloc processing routine for the optimized COFF linker.  */
  349.  
  350. static boolean
  351. coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
  352.                 contents, relocs, syms, sections)
  353.      bfd *output_bfd;
  354.      struct bfd_link_info *info;
  355.      bfd *input_bfd;
  356.      asection *input_section;
  357.      bfd_byte *contents;
  358.      struct internal_reloc *relocs;
  359.      struct internal_syment *syms;
  360.      asection **sections;
  361. {
  362.   struct internal_reloc *rel;
  363.   struct internal_reloc *relend;
  364.  
  365.   rel = relocs;
  366.   relend = rel + input_section->reloc_count;
  367.   for (; rel < relend; rel++)
  368.     {
  369.       long symndx;
  370.       struct coff_link_hash_entry *h;
  371.       struct internal_syment *sym;
  372.       bfd_vma addend;
  373.       bfd_vma val;
  374.       reloc_howto_type *howto;
  375.       bfd_reloc_status_type rstat = bfd_reloc_ok;
  376.       boolean done;
  377.  
  378.       symndx = rel->r_symndx;
  379.  
  380.       if (symndx == -1)
  381.     {
  382.       h = NULL;
  383.       sym = NULL;
  384.     }
  385.       else
  386.     {    
  387.       h = obj_coff_sym_hashes (input_bfd)[symndx];
  388.       sym = syms + symndx;
  389.     }
  390.  
  391.       if (sym != NULL && sym->n_scnum != 0)
  392.     addend = - sym->n_value;
  393.       else
  394.     addend = 0;
  395.  
  396.       switch (rel->r_type)
  397.     {
  398.     case 17: howto = &howto_rellong; break;
  399.     case 25: howto = &howto_iprmed; break;
  400.     case 27: howto = &howto_optcall; break;
  401.     default:
  402.       bfd_set_error (bfd_error_bad_value);
  403.       return false;
  404.     }
  405.  
  406.       val = 0;
  407.  
  408.       if (h == NULL)
  409.     {
  410.       asection *sec;
  411.  
  412.       if (symndx == -1)
  413.         {
  414.           sec = bfd_abs_section_ptr;
  415.           val = 0;
  416.         }
  417.       else
  418.         {
  419.           sec = sections[symndx];
  420.               val = (sec->output_section->vma
  421.              + sec->output_offset
  422.              + sym->n_value
  423.              - sec->vma);
  424.         }
  425.     }
  426.       else
  427.     {
  428.       if (h->root.type == bfd_link_hash_defined
  429.           || h->root.type == bfd_link_hash_defweak)
  430.         {
  431.           asection *sec;
  432.  
  433.           sec = h->root.u.def.section;
  434.           val = (h->root.u.def.value
  435.              + sec->output_section->vma
  436.              + sec->output_offset);
  437.         }
  438.       else if (! info->relocateable)
  439.         {
  440.           if (! ((*info->callbacks->undefined_symbol)
  441.              (info, h->root.root.string, input_bfd, input_section,
  442.               rel->r_vaddr - input_section->vma)))
  443.         return false;
  444.         }
  445.     }
  446.  
  447.       done = false;
  448.  
  449.       if (howto->type == R_OPTCALL && ! info->relocateable && symndx != -1)
  450.     {
  451.       int class;
  452.  
  453.       if (h != NULL)
  454.         class = h->class;
  455.       else
  456.         class = sym->n_sclass;
  457.  
  458.       switch (class)
  459.         {
  460.         case C_NULL:
  461.           /* This symbol is apparently not from a COFF input file.
  462.                  We warn, and then assume that it is not a leaf
  463.                  function.  */
  464.           if (! ((*info->callbacks->reloc_dangerous)
  465.              (info,
  466.               "uncertain calling convention for non-COFF symbol",
  467.               input_bfd, input_section,
  468.               rel->r_vaddr - input_section->vma)))
  469.         return false;
  470.           break;
  471.         case C_LEAFSTAT:
  472.         case C_LEAFEXT:
  473.           /* This is a call to a leaf procedure; use the bal
  474.                  instruction.  */
  475.           {
  476.         long olf;
  477.         unsigned long word;
  478.  
  479.         if (h != NULL)
  480.           {
  481.             BFD_ASSERT (h->numaux == 2);
  482.             olf = h->aux[1].x_bal.x_balntry;
  483.           }
  484.         else
  485.           {
  486.             bfd_byte *esyms;
  487.             union internal_auxent aux;
  488.  
  489.             BFD_ASSERT (sym->n_numaux == 2);
  490.             esyms = (bfd_byte *) obj_coff_external_syms (input_bfd);
  491.             esyms += (symndx + 2) * bfd_coff_symesz (input_bfd);
  492.             bfd_coff_swap_aux_in (input_bfd, (PTR) esyms, sym->n_type,
  493.                       sym->n_sclass, 1, sym->n_numaux,
  494.                       (PTR) &aux);
  495.             olf = aux.x_bal.x_balntry;
  496.           }
  497.  
  498.         word = bfd_get_32 (input_bfd,
  499.                    (contents
  500.                     + (rel->r_vaddr - input_section->vma)));
  501.         word = ((word + olf - val) & BAL_MASK) | BAL;
  502.         bfd_put_32 (input_bfd,
  503.                 word,
  504.                 (contents
  505.                  + (rel->r_vaddr - input_section->vma)));
  506.         done = true;
  507.           }
  508.           break;
  509.         case C_SCALL:
  510.           BFD_ASSERT (0);
  511.           break;
  512.         }
  513.     }
  514.  
  515.       if (! done)
  516.     {
  517.       if (howto->pc_relative)
  518.         addend += input_section->vma;
  519.       rstat = _bfd_final_link_relocate (howto, input_bfd, input_section,
  520.                         contents,
  521.                         rel->r_vaddr - input_section->vma,
  522.                         val, addend);
  523.     }
  524.  
  525.       switch (rstat)
  526.     {
  527.     default:
  528.       abort ();
  529.     case bfd_reloc_ok:
  530.       break;
  531.     case bfd_reloc_overflow:
  532.       {
  533.         const char *name;
  534.         char buf[SYMNMLEN + 1];
  535.  
  536.         if (symndx == -1)
  537.           name = "*ABS*";
  538.         else if (h != NULL)
  539.           name = h->root.root.string;
  540.         else
  541.           {
  542.         name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
  543.         if (name == NULL)
  544.           return false;
  545.           }
  546.  
  547.         if (! ((*info->callbacks->reloc_overflow)
  548.            (info, name, howto->name, (bfd_vma) 0, input_bfd,
  549.             input_section, rel->r_vaddr - input_section->vma)))
  550.           return false;
  551.       }
  552.     }
  553.     }
  554.  
  555.   return true;
  556. }
  557.  
  558. /* Adjust the symbol index of any reloc against a global symbol to
  559.    instead be a reloc against the internal symbol we created specially
  560.    for the section.  */
  561.  
  562. /*ARGSUSED*/
  563. static boolean
  564. coff_i960_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
  565.      bfd *obfd;
  566.      struct bfd_link_info *info;
  567.      bfd *ibfd;
  568.      asection *sec;
  569.      struct internal_reloc *irel;
  570.      boolean *adjustedp;
  571. {
  572.   struct coff_link_hash_entry *h;
  573.  
  574.   *adjustedp = false;
  575.  
  576.   h = obj_coff_sym_hashes (ibfd)[irel->r_symndx];
  577.   if (h == NULL
  578.       || (h->root.type != bfd_link_hash_defined
  579.       && h->root.type != bfd_link_hash_defweak))
  580.     return true;
  581.  
  582.   irel->r_symndx = h->root.u.def.section->output_section->target_index - 1;
  583.   *adjustedp = true;
  584.  
  585.   return true;
  586. }
  587.  
  588. #define coff_start_final_link coff_i960_start_final_link
  589.  
  590. #define coff_relocate_section coff_i960_relocate_section
  591.  
  592. #define coff_adjust_symndx coff_i960_adjust_symndx
  593.  
  594. #define coff_bfd_reloc_type_lookup coff_i960_reloc_type_lookup
  595.  
  596. #include "coffcode.h"
  597.  
  598. const bfd_target icoff_little_vec =
  599. {
  600.   "coff-Intel-little",        /* name */
  601.   bfd_target_coff_flavour,
  602.   BFD_ENDIAN_LITTLE,        /* data byte order is little */
  603.   BFD_ENDIAN_LITTLE,        /* header byte order is little */
  604.  
  605.   (HAS_RELOC | EXEC_P |        /* object flags */
  606.    HAS_LINENO | HAS_DEBUG |
  607.    HAS_SYMS | HAS_LOCALS | WP_TEXT),
  608.  
  609.   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
  610.   '_',                /* leading underscore */
  611.   '/',                /* ar_pad_char */
  612.   15,                /* ar_max_namelen */
  613.  
  614.   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
  615.      bfd_getl32, bfd_getl_signed_32, bfd_putl32,
  616.      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
  617.   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
  618.      bfd_getl32, bfd_getl_signed_32, bfd_putl32,
  619.      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
  620.  
  621.  {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
  622.    bfd_generic_archive_p, _bfd_dummy_target},
  623.  {bfd_false, coff_mkobject,    /* bfd_set_format */
  624.    _bfd_generic_mkarchive, bfd_false},
  625.  {bfd_false, coff_write_object_contents, /* bfd_write_contents */
  626.    _bfd_write_archive_contents, bfd_false},
  627.  
  628.      BFD_JUMP_TABLE_GENERIC (coff),
  629.      BFD_JUMP_TABLE_COPY (coff),
  630.      BFD_JUMP_TABLE_CORE (_bfd_nocore),
  631.      BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
  632.      BFD_JUMP_TABLE_SYMBOLS (coff),
  633.      BFD_JUMP_TABLE_RELOCS (coff),
  634.      BFD_JUMP_TABLE_WRITE (coff),
  635.      BFD_JUMP_TABLE_LINK (coff),
  636.      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
  637.  
  638.   COFF_SWAP_TABLE,
  639. };
  640.  
  641.  
  642. const bfd_target icoff_big_vec =
  643. {
  644.   "coff-Intel-big",        /* name */
  645.   bfd_target_coff_flavour,
  646.   BFD_ENDIAN_LITTLE,        /* data byte order is little */
  647.   BFD_ENDIAN_BIG,        /* header byte order is big */
  648.  
  649.   (HAS_RELOC | EXEC_P |        /* object flags */
  650.    HAS_LINENO | HAS_DEBUG |
  651.    HAS_SYMS | HAS_LOCALS | WP_TEXT),
  652.  
  653.   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
  654.   '_',                /* leading underscore */
  655.   '/',                /* ar_pad_char */
  656.   15,                /* ar_max_namelen */
  657.  
  658. bfd_getl64, bfd_getl_signed_64, bfd_putl64,
  659.      bfd_getl32, bfd_getl_signed_32, bfd_putl32,
  660.      bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
  661. bfd_getb64, bfd_getb_signed_64, bfd_putb64,
  662.      bfd_getb32, bfd_getb_signed_32, bfd_putb32,
  663.      bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
  664.  
  665.   {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
  666.      bfd_generic_archive_p, _bfd_dummy_target},
  667.   {bfd_false, coff_mkobject,    /* bfd_set_format */
  668.      _bfd_generic_mkarchive, bfd_false},
  669.   {bfd_false, coff_write_object_contents,    /* bfd_write_contents */
  670.      _bfd_write_archive_contents, bfd_false},
  671.  
  672.      BFD_JUMP_TABLE_GENERIC (coff),
  673.      BFD_JUMP_TABLE_COPY (coff),
  674.      BFD_JUMP_TABLE_CORE (_bfd_nocore),
  675.      BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
  676.      BFD_JUMP_TABLE_SYMBOLS (coff),
  677.      BFD_JUMP_TABLE_RELOCS (coff),
  678.      BFD_JUMP_TABLE_WRITE (coff),
  679.      BFD_JUMP_TABLE_LINK (coff),
  680.      BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
  681.  
  682.   COFF_SWAP_TABLE,
  683. };
  684.