home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / bfd / hppa.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-12  |  19.4 KB  |  713 lines

  1. /* bfd back-end for HP PA-RISC SOM objects.
  2.    Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
  3.  
  4.    Contributed by the Center for Software Science at the
  5.    University of Utah (pa-gdb-bugs@cs.utah.edu).
  6.  
  7. This file is part of BFD, the Binary File Descriptor library.
  8.  
  9. This program is free software; you can redistribute it and/or modify
  10. it under the terms of the GNU General Public License as published by
  11. the Free Software Foundation; either version 2 of the License, or
  12. (at your option) any later version.
  13.  
  14. This program is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. GNU General Public License for more details.
  18.  
  19. You should have received a copy of the GNU General Public License
  20. along with this program; if not, write to the Free Software
  21. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  22.  
  23. #include "bfd.h"
  24. #include "sysdep.h"
  25.  
  26. #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD)
  27.  
  28. #include "libbfd.h"
  29. #include "libhppa.h"
  30.  
  31. #include <stdio.h>
  32. #include <sys/types.h>
  33. #include <sys/param.h>
  34. #include <sys/dir.h>
  35. #include <signal.h>
  36. #include <machine/reg.h>
  37. #include <sys/user.h>           /* After a.out.h  */
  38. #include <sys/file.h>
  39. #include <errno.h>
  40.  
  41. /* Magic not defined in standard HP-UX header files until 8.0 */
  42.  
  43. #ifndef CPU_PA_RISC1_0
  44. #define CPU_PA_RISC1_0 0x20B
  45. #endif /* CPU_PA_RISC1_0 */
  46.  
  47. #ifndef CPU_PA_RISC1_1
  48. #define CPU_PA_RISC1_1 0x210
  49. #endif /* CPU_PA_RISC1_1 */
  50.  
  51. #ifndef _PA_RISC1_0_ID
  52. #define _PA_RISC1_0_ID CPU_PA_RISC1_0
  53. #endif /* _PA_RISC1_0_ID */
  54.  
  55. #ifndef _PA_RISC1_1_ID
  56. #define _PA_RISC1_1_ID CPU_PA_RISC1_1
  57. #endif /* _PA_RISC1_1_ID */
  58.  
  59. #ifndef _PA_RISC_MAXID
  60. #define _PA_RISC_MAXID    0x2FF
  61. #endif /* _PA_RISC_MAXID */
  62.  
  63. #ifndef _PA_RISC_ID
  64. #define _PA_RISC_ID(__m_num)        \
  65.     (((__m_num) == _PA_RISC1_0_ID) ||    \
  66.      ((__m_num) >= _PA_RISC1_1_ID && (__m_num) <= _PA_RISC_MAXID))
  67. #endif /* _PA_RISC_ID */
  68.  
  69. struct container {
  70.   struct header f;
  71.   struct som_exec_auxhdr e;
  72. };
  73.  
  74. static bfd_target *
  75. hppa_object_setup (abfd, file_hdrp, aux_hdrp)
  76.      bfd *abfd;
  77.      struct header *file_hdrp;
  78.      struct som_exec_auxhdr *aux_hdrp;
  79. {
  80.   struct container *rawptr;
  81.   struct header *f;
  82.   struct hppa_data_struct *rawptr1;
  83.   asection *text, *data, *bss;
  84.  
  85.   rawptr = (struct container *) bfd_zalloc (abfd, sizeof (struct container));
  86.   if (rawptr == NULL) {
  87.     bfd_error = no_memory;
  88.     return 0;
  89.   }
  90.  
  91.   rawptr1 = (struct hppa_data_struct *) bfd_zalloc (abfd, sizeof (struct hppa_data_struct));
  92.   if (rawptr1 == NULL) {
  93.     bfd_error = no_memory;
  94.     return 0;
  95.   }
  96.   
  97.   abfd->tdata.hppa_data = rawptr1;
  98.   obj_file_hdr (abfd) = &rawptr->f;
  99.   obj_aux_hdr (abfd) = &rawptr->e;
  100.   *obj_file_hdr (abfd) = *file_hdrp;
  101.   *obj_aux_hdr (abfd) = *aux_hdrp;
  102.  
  103.   /* Set the file flags */
  104.   abfd->flags = NO_FLAGS;
  105.   if (file_hdrp->entry_offset)
  106.     abfd->flags |= HAS_RELOC;
  107.   if (file_hdrp->symbol_total)
  108.     abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
  109.  
  110.   bfd_get_start_address (abfd) = aux_hdrp->exec_entry;
  111.  
  112.   obj_pa_symbols (abfd) = (hppa_symbol_type *)NULL;
  113.   bfd_get_symcount (abfd) = file_hdrp->symbol_total;
  114.  
  115.   bfd_default_set_arch_mach(abfd, bfd_arch_hppa, 0);
  116.  
  117.   /* create the sections.  This is raunchy, but bfd_close wants to reclaim
  118.      them */
  119.  
  120.   text = bfd_make_section(abfd, ".text");
  121.   data = bfd_make_section(abfd, ".data");
  122.   bss = bfd_make_section(abfd, ".bss");
  123.  
  124.   text->_raw_size = aux_hdrp->exec_tsize;
  125.   data->_raw_size = aux_hdrp->exec_dsize;
  126.   bss->_raw_size = aux_hdrp->exec_bsize;
  127.  
  128.   text->flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS);
  129.   data->flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS);
  130.   bss->flags = SEC_ALLOC;
  131.  
  132.   /* The virtual memory addresses of the sections */                    
  133.   text->vma = aux_hdrp->exec_tmem;                          
  134.   data->vma = aux_hdrp->exec_dmem;                          
  135.   bss->vma = aux_hdrp->exec_bfill;                           
  136.                                                                         
  137.   /* The file offsets of the sections */                                
  138.   text->filepos = aux_hdrp->exec_tfile;                      
  139.   data->filepos = aux_hdrp->exec_dfile;                      
  140.                                                                        
  141.   /* The file offsets of the relocation info */                         
  142.   text->rel_filepos = 0;                  
  143.   data->rel_filepos = 0;                  
  144.                                                                         
  145.   /* The file offsets of the string table and symbol table.  */         
  146.   obj_sym_filepos (abfd) = file_hdrp->symbol_location;                  
  147.   bfd_get_symcount (abfd) = file_hdrp->symbol_total;
  148.   obj_str_filepos (abfd) = file_hdrp->symbol_strings_location;           
  149.   obj_stringtab_size (abfd) = file_hdrp->symbol_strings_size;
  150.  
  151.   return abfd->xvec;
  152. }
  153.  
  154. /* Create a new BFD section for NAME.  If NAME already exists, then create a
  155.    new unique name, with NAME as the prefix.  This exists because SOM .o files
  156.    created by the native compiler can have a $CODE$ section for each
  157.    subroutine.
  158.  */
  159.  
  160. static asection *
  161. make_unique_section (abfd, name, num)
  162.      bfd *abfd;
  163.      CONST char *name;
  164.      int num;
  165. {
  166.   asection *sect;
  167.   char *newname;
  168.   char altname[100];
  169.  
  170.   sect = bfd_make_section (abfd, name);
  171.   while (!sect)
  172.     {
  173.       sprintf(altname, "%s-%d", name, num++);
  174.       sect = bfd_make_section (abfd, altname);
  175.     }
  176.  
  177.   newname = bfd_alloc (abfd, strlen(sect->name) + 1);
  178.   strcpy (newname, sect->name);
  179.  
  180.   sect->name = newname;
  181.   return sect;
  182. }
  183.  
  184. /* Convert all of the space and subspace info into BFD sections.  Each space
  185.    contains a number of subspaces, which in turn describe the mapping between
  186.    regions of the exec file, and the address space that the program runs in.
  187.    BFD sections which correspond to spaces will overlap the sections for the
  188.    associated subspaces.  */
  189.  
  190. static int
  191. setup_sections (abfd, file_hdr)
  192.      bfd *abfd;
  193.      struct header *file_hdr;
  194. {
  195.   char *space_strings;
  196.   int space_index;
  197.  
  198. /* First, read in space names */
  199.  
  200.   space_strings = alloca (file_hdr->space_strings_size);
  201.   if (!space_strings)
  202.     return 0;
  203.  
  204.   if (bfd_seek (abfd, file_hdr->space_strings_location, SEEK_SET) < 0)
  205.     return 0;
  206.   if (bfd_read (space_strings, 1, file_hdr->space_strings_size, abfd)
  207.       != file_hdr->space_strings_size)
  208.     return 0;
  209.  
  210.   /* Loop over all of the space dictionaries, building up sections */
  211.  
  212.   for (space_index = 0; space_index < file_hdr->space_total; space_index++)
  213.     {
  214.       struct space_dictionary_record space;
  215.       struct subspace_dictionary_record subspace;
  216.       int subspace_index, tmp;
  217.       asection *space_asect;
  218.  
  219.       /* Read the space dictionary element */
  220.       if (bfd_seek (abfd, file_hdr->space_location
  221.                    + space_index * sizeof space, SEEK_SET) < 0)
  222.     return 0;
  223.       if (bfd_read (&space, 1, sizeof space, abfd) != sizeof space)
  224.     return 0;
  225.  
  226.       /* Setup the space name string */
  227.       space.name.n_name = space.name.n_strx + space_strings;
  228.  
  229.       /* Make a section out of it */
  230.       space_asect = make_unique_section (abfd, space.name.n_name, space_index);
  231.       if (!space_asect)
  232.     return 0;
  233.  
  234.       /* Now, read in the first subspace for this space */
  235.       if (bfd_seek (abfd, file_hdr->subspace_location
  236.                + space.subspace_index * sizeof subspace,
  237.         SEEK_SET) < 0)
  238.     return 0;
  239.       if (bfd_read (&subspace, 1, sizeof subspace, abfd) != sizeof subspace)
  240.     return 0;
  241.       /* Seek back to the start of the subspaces for loop below */
  242.       if (bfd_seek (abfd, file_hdr->subspace_location
  243.                + space.subspace_index * sizeof subspace,
  244.         SEEK_SET) < 0)
  245.     return 0;
  246.  
  247.       /* Setup the section flags as appropriate (this is somewhat bogus, as
  248.      there isn't a clear mapping between what's in the space record, and
  249.      what BFD can describe here). */
  250.       if (space.is_loadable)
  251.     space_asect->flags |= SEC_ALLOC;
  252.       if (space.is_defined)
  253.     space_asect->flags |= SEC_LOAD;
  254.  
  255.       /* Setup the start address and file loc from the first subspace record */
  256.       space_asect->vma = subspace.subspace_start;
  257.       space_asect->filepos = subspace.file_loc_init_value;
  258.       space_asect->alignment_power = subspace.alignment;
  259.  
  260.       /* Loop over the rest of the subspaces, building up more sections */
  261.       for (subspace_index = 0; subspace_index < space.subspace_quantity;
  262.        subspace_index++)
  263.     {
  264.       asection *subspace_asect;
  265.  
  266.       /* Read in the next subspace */
  267.       if (bfd_read (&subspace, 1, sizeof subspace, abfd)
  268.           != sizeof subspace)
  269.         return 0;
  270.  
  271.       /* Setup the subspace name string */
  272.       subspace.name.n_name = subspace.name.n_strx + space_strings;
  273.  
  274.       /* Make a section out of this subspace */
  275.       subspace_asect = make_unique_section (abfd, subspace.name.n_name,
  276.                         space.subspace_index + subspace_index);
  277.  
  278.       if (!subspace_asect)
  279.         return 0;
  280.  
  281.       if (subspace.is_loadable)
  282.         subspace_asect->flags |= SEC_ALLOC | SEC_LOAD;
  283.       if (subspace.code_only)
  284.         subspace_asect->flags |= SEC_CODE;
  285.  
  286.       subspace_asect->vma = subspace.subspace_start;
  287.       subspace_asect->_cooked_size = subspace.subspace_length;
  288.       subspace_asect->_raw_size = subspace.initialization_length;
  289.       subspace_asect->alignment_power = subspace.alignment;
  290.       subspace_asect->filepos = subspace.file_loc_init_value;
  291.  
  292.     }
  293.       /* Setup the sizes for the space section based upon the info in the
  294.      last subspace of the space. */
  295.       space_asect->_cooked_size = (subspace.subspace_start - space_asect->vma)
  296.                   + subspace.subspace_length;
  297.       space_asect->_raw_size = (subspace.file_loc_init_value
  298.                 - space_asect->filepos)
  299.                    + subspace.initialization_length;
  300.     }
  301. }
  302.  
  303. static bfd_target *
  304. hppa_object_p (abfd)
  305.      bfd *abfd;
  306. {
  307.   struct header file_hdr;
  308.   struct som_exec_auxhdr aux_hdr;
  309.  
  310.   if (bfd_read ((PTR) &file_hdr, 1, FILE_HDR_SIZE, abfd) != FILE_HDR_SIZE)
  311.     return 0;
  312.  
  313.   if (!_PA_RISC_ID (file_hdr.system_id))
  314.     {
  315.       bfd_error = wrong_format;
  316.       return 0;
  317.     }
  318.  
  319.   switch (file_hdr.a_magic)
  320.     {
  321.     case RELOC_MAGIC:    /* I'm not really sure about all of these types... */
  322.     case EXEC_MAGIC:
  323.     case SHARE_MAGIC:
  324.     case DEMAND_MAGIC:
  325. #ifdef DL_MAGIC
  326.     case DL_MAGIC:
  327. #endif
  328. #ifdef SHL_MAGIC
  329.     case SHL_MAGIC:
  330. #endif
  331.       break;
  332.     default:
  333.       bfd_error = wrong_format;
  334.       return 0;
  335.     }
  336.  
  337.   if (file_hdr.version_id != VERSION_ID
  338.       && file_hdr.version_id != NEW_VERSION_ID)
  339.     {
  340.       bfd_error = wrong_format;
  341.       return 0;
  342.     }
  343.  
  344.   if (bfd_read ((PTR) &aux_hdr, 1, AUX_HDR_SIZE, abfd) != AUX_HDR_SIZE)
  345.     bfd_error = wrong_format;
  346.  
  347.   if (!setup_sections (abfd, &file_hdr))
  348.     return 0;
  349.  
  350.   return hppa_object_setup(abfd, &file_hdr, &aux_hdr);
  351. }
  352.  
  353. static boolean
  354. DEFUN(hppa_mkobject,(abfd),
  355.       bfd *abfd)
  356.   fprintf (stderr, "hppa_mkobject unimplemented\n");
  357.   fflush (stderr);
  358.   abort ();
  359.   return (false);
  360. }
  361.  
  362. boolean
  363. DEFUN(hppa_write_object_contents,(abfd),
  364.       bfd *abfd)
  365. {
  366.   fprintf (stderr, "hppa_write_object_contents unimplemented\n");
  367.   fflush (stderr);
  368.   abort ();
  369.   return (false);
  370. }
  371.  
  372. static unsigned int
  373. hppa_get_symtab_upper_bound (abfd)
  374.      bfd *abfd;
  375. {
  376.   fprintf (stderr, "hppa_get_symtab_upper_bound unimplemented\n");
  377.   fflush (stderr);
  378.   abort ();
  379.   return (0);
  380. }
  381.  
  382. static unsigned int
  383. hppa_get_reloc_upper_bound (abfd, asect)
  384.      bfd *abfd;
  385.      sec_ptr asect;
  386. {
  387.   fprintf (stderr, "hppa_get_reloc_upper_bound unimplemented\n");
  388.   fflush (stderr);
  389.   abort ();
  390.   return (0);
  391. }
  392.  
  393. static unsigned int
  394. hppa_canonicalize_reloc (abfd, section, relptr, symbols)
  395.      bfd *abfd;
  396.      sec_ptr section;
  397.      arelent **relptr;
  398.      asymbol **symbols;
  399. {
  400.   fprintf (stderr, "hppa_canonicalize_reloc unimplemented\n");
  401.   fflush (stderr);
  402.   abort ();
  403. }
  404.  
  405. extern bfd_target hppa_vec;
  406.  
  407. static unsigned int
  408. hppa_get_symtab (abfd, location)
  409.      bfd *abfd;
  410.      asymbol **location;
  411. {
  412.   fprintf (stderr, "hppa_get_symtab unimplemented\n");
  413.   fflush (stderr);
  414.   abort ();
  415.   return (0);
  416. }
  417.  
  418. static asymbol *
  419. hppa_make_empty_symbol (abfd)
  420.      bfd *abfd;
  421. {
  422.   hppa_symbol_type  *new =
  423.     (hppa_symbol_type *)bfd_zalloc (abfd, sizeof (hppa_symbol_type));
  424.   new->symbol.the_bfd = abfd;
  425.  
  426.   return &new->symbol;
  427. }
  428.  
  429. static void 
  430. hppa_print_symbol (ignore_abfd, afile,  symbol, how)
  431.      bfd *ignore_abfd;
  432.      PTR afile;
  433.      asymbol *symbol;
  434.      bfd_print_symbol_type how;
  435. {
  436.   fprintf (stderr, "hppa_print_symbol unimplemented\n");
  437.   fflush (stderr);
  438.   abort ();
  439. }
  440.  
  441. static boolean
  442. hppa_new_section_hook (abfd, newsect)
  443.      bfd *abfd;
  444.      asection *newsect;
  445. {
  446.   newsect->alignment_power = 3;
  447.  
  448.   /* We allow more than three sections internally */
  449.   return true;
  450. }
  451.  
  452. static boolean
  453. hppa_set_section_contents (abfd, section, location, offset, count)
  454.      bfd *abfd;
  455.      sec_ptr section;
  456.      PTR location;
  457.      file_ptr offset;
  458.      bfd_size_type count;
  459. {
  460.   fprintf (stderr, "hppa_set_section_contents unimplimented\n");
  461.   fflush (stderr);
  462.   abort();
  463.   return false;
  464. }
  465.  
  466. static boolean
  467. hppa_set_arch_mach (abfd, arch, machine)
  468.      bfd *abfd;
  469.      enum bfd_architecture arch;
  470.      unsigned long machine;
  471. {
  472.   fprintf (stderr, "hppa_set_arch_mach unimplemented\n");
  473.   fflush (stderr);
  474.   /* Allow any architecture to be supported by the hppa backend */
  475.   return  bfd_default_set_arch_mach(abfd, arch, machine);
  476. }
  477.  
  478. static boolean
  479. hppa_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
  480.             functionname_ptr, line_ptr)
  481.      bfd *abfd;
  482.      asection *section;
  483.      asymbol **symbols;
  484.      bfd_vma offset;
  485.      CONST char **filename_ptr;
  486.      CONST char **functionname_ptr;
  487.      unsigned int *line_ptr;
  488. {
  489.   fprintf (stderr, "hppa_find_nearest_line unimplemented\n");
  490.   fflush (stderr);
  491.   abort ();
  492.   return (false);
  493. }
  494.  
  495. static int
  496. hppa_sizeof_headers (abfd, reloc)
  497.       bfd *abfd;
  498.       boolean reloc;
  499. {
  500.   fprintf (stderr, "hppa_sizeof_headers unimplemented\n");
  501.   fflush (stderr);
  502.   abort ();
  503.   return (0);
  504. }
  505.  
  506. static asection *
  507. make_bfd_asection (abfd, name, flags, _raw_size, vma, alignment_power)
  508.      bfd *abfd;
  509.      CONST char *name;
  510.      flagword flags;
  511.      bfd_size_type _raw_size;
  512.      bfd_vma vma;
  513.      unsigned int alignment_power;
  514. {
  515.   asection *asect;
  516.  
  517.   asect = bfd_make_section (abfd, name);
  518.   if (!asect)
  519.     return NULL;
  520.  
  521.   asect->flags = flags;
  522.   asect->_raw_size = _raw_size;
  523.   asect->vma = vma;
  524.   asect->filepos = bfd_tell (abfd);
  525.   asect->alignment_power = alignment_power;
  526.  
  527.   return asect;
  528. }
  529.  
  530. #ifdef HOST_HPPAHPUX
  531. static bfd_target *
  532. hppa_core_file_p (abfd)
  533.      bfd *abfd;
  534. {
  535.   core_hdr (abfd) = bfd_zalloc (abfd, sizeof (struct hppa_core_struct));
  536.   if (!core_hdr (abfd))
  537.     return NULL;
  538.  
  539.   while (1)
  540.     {
  541.       int val;
  542.       struct corehead core_header;
  543.  
  544.       val = bfd_read ((void *)&core_header, 1, sizeof core_header, abfd);
  545.       if (val <= 0)
  546.     break;
  547.       switch (core_header.type)
  548.     {
  549.     case CORE_KERNEL:
  550.     case CORE_FORMAT:
  551.       bfd_seek (abfd, core_header.len, SEEK_CUR); /* Just skip this */
  552.       break;
  553.     case CORE_EXEC:
  554.       {
  555.         struct proc_exec proc_exec;
  556.         bfd_read ((void *)&proc_exec, 1, core_header.len, abfd);
  557.         strncpy (core_command (abfd), proc_exec.cmd, MAXCOMLEN + 1);
  558.       }
  559.       break;
  560.     case CORE_PROC:
  561.       {
  562.         struct proc_info proc_info;
  563.         core_regsec (abfd) = make_bfd_asection (abfd, ".reg",
  564.                             SEC_ALLOC+SEC_HAS_CONTENTS,
  565.                             core_header.len,
  566.                             (int)&proc_info - (int)&proc_info.hw_regs,
  567.                             2);
  568.         bfd_read (&proc_info, 1, core_header.len, abfd);
  569.         core_signal (abfd) = proc_info.sig;
  570.       }
  571.       if (!core_regsec (abfd))
  572.         return NULL;
  573.       break;
  574.     case CORE_DATA:
  575.       core_datasec (abfd) = make_bfd_asection (abfd, ".data",
  576.                            SEC_ALLOC+SEC_LOAD+SEC_HAS_CONTENTS,
  577.                            core_header.len,
  578.                            core_header.addr,
  579.                            2);
  580.       if (!core_datasec (abfd))
  581.         return NULL;
  582.       bfd_seek (abfd, core_header.len, SEEK_CUR);
  583.       break;
  584.     case CORE_STACK:
  585.       core_stacksec (abfd) = make_bfd_asection (abfd, ".stack",
  586.                             SEC_ALLOC+SEC_LOAD+SEC_HAS_CONTENTS,
  587.                             core_header.len,
  588.                             core_header.addr,
  589.                             2);
  590.       if (!core_stacksec (abfd))
  591.         return NULL;
  592.       bfd_seek (abfd, core_header.len, SEEK_CUR);
  593.       break;
  594.     default:
  595.       fprintf (stderr, "Unknown HPPA/HPUX core file section type %d\n",
  596.            core_header.type);
  597.       bfd_seek (abfd, core_header.len, SEEK_CUR);
  598.       break;
  599.     }
  600.     }
  601.  
  602.   /* OK, we believe you.  You're a core file (sure, sure).  */
  603.  
  604.   return abfd->xvec;
  605. }
  606.  
  607. static char *
  608. hppa_core_file_failing_command (abfd)
  609.      bfd *abfd;
  610. {
  611.   return core_command (abfd);
  612. }
  613.  
  614. /* ARGSUSED */
  615. static int
  616. hppa_core_file_failing_signal (abfd)
  617.      bfd *abfd;
  618. {
  619.   return core_signal (abfd);
  620. }
  621.  
  622. /* ARGSUSED */
  623. static boolean
  624. hppa_core_file_matches_executable_p  (core_bfd, exec_bfd)
  625.      bfd *core_bfd, *exec_bfd;
  626. {
  627.   return true;          /* FIXME, We have no way of telling at this point */
  628. }
  629. #endif /* HOST_HPPAHPUX */
  630.  
  631. #ifdef HOST_HPPABSD
  632.   /* All the core file code for BSD needs to be rewritten cleanly.  For
  633.      now we do not support core files under BSD.  */
  634.  
  635. #define hppa_core_file_p _bfd_dummy_target
  636. #define hppa_core_file_failing_command _bfd_dummy_core_file_failing_command
  637. #define hppa_core_file_failing_signal _bfd_dummy_core_file_failing_signal
  638. #define hppa_core_file_matches_executable_p _bfd_dummy_core_file_matches_executable_p
  639. #endif /* HOST_HPPABSD */
  640.  
  641. #define hppa_bfd_debug_info_start        bfd_void
  642. #define hppa_bfd_debug_info_end          bfd_void
  643. #define hppa_bfd_debug_info_accumulate   (PROTO(void,(*),(bfd*, struct sec *))) bfd_void
  644.  
  645. #define hppa_openr_next_archived_file    bfd_generic_openr_next_archived_file
  646. #define hppa_generic_stat_arch_elt       bfd_generic_stat_arch_elt
  647. #define hppa_slurp_armap                  bfd_false
  648. #define hppa_slurp_extended_name_table    _bfd_slurp_extended_name_table
  649. #define hppa_truncate_arname              (void (*)())bfd_nullvoidptr
  650. #define hppa_write_armap                  0
  651.  
  652. #define hppa_get_lineno                   (struct lineno_cache_entry *(*)())bfd_nullvoidptr
  653. #define    hppa_close_and_cleanup               bfd_generic_close_and_cleanup
  654. #define hppa_get_section_contents          bfd_generic_get_section_contents
  655.  
  656. #define hppa_bfd_get_relocated_section_contents \
  657.  bfd_generic_get_relocated_section_contents
  658. #define hppa_bfd_relax_section bfd_generic_relax_section
  659. #define hppa_bfd_seclet_link bfd_generic_seclet_link
  660. #define hppa_bfd_reloc_type_lookup \
  661.   ((CONST struct reloc_howto_struct *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) bfd_nullvoidptr)
  662. #define hppa_bfd_make_debug_symbol \
  663.   ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr)
  664.  
  665. bfd_target hppa_vec =
  666. {
  667.   "hppa",            /* name */
  668.   bfd_target_hppa_flavour,
  669.   true,                /* target byte order */
  670.   true,                /* target headers byte order */
  671.   (HAS_RELOC | EXEC_P |        /* object flags */
  672.    HAS_LINENO | HAS_DEBUG |
  673.    HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
  674.   (SEC_CODE|SEC_DATA|SEC_ROM|SEC_HAS_CONTENTS
  675.    |SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
  676.  
  677.    /* leading_symbol_char: is the first char of a user symbol
  678.       predictable, and if so what is it */
  679.    0,
  680.   ' ',                /* ar_pad_char */
  681.   16,                /* ar_max_namelen */
  682.     3,                /* minimum alignment */
  683. _do_getb64, _do_getb_signed_64, _do_putb64,
  684.     _do_getb32, _do_getb_signed_32, _do_putb32,
  685.     _do_getb16, _do_getb_signed_16, _do_putb16, /* data */
  686. _do_getb64, _do_getb_signed_64, _do_putb64,
  687.     _do_getb32, _do_getb_signed_32, _do_putb32,
  688.     _do_getb16, _do_getb_signed_16, _do_putb16, /* hdrs */
  689.   { _bfd_dummy_target,
  690.      hppa_object_p,        /* bfd_check_format */
  691.      bfd_generic_archive_p,
  692.      hppa_core_file_p,
  693.      },
  694.   {
  695.     bfd_false,
  696.     hppa_mkobject, 
  697.     _bfd_generic_mkarchive,
  698.     bfd_false
  699.     },
  700.   {
  701.     bfd_false,
  702.     hppa_write_object_contents,
  703.     _bfd_write_archive_contents,
  704.     bfd_false,
  705.   },
  706. #undef hppa
  707.   JUMP_TABLE(hppa),
  708.   (PTR) 0
  709. };
  710.  
  711. #endif /* HOST_HPPAHPUX || HOST_HPPABSD */
  712.