gdb/solib-pa64.c - gdb

Global variables defined

Data types defined

Functions defined

Macros defined

Source code

  1. /* Handle PA64 shared libraries for GDB, the GNU Debugger.

  2.    Copyright (C) 2004-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. /* HP in their infinite stupidity choose not to use standard ELF dynamic
  15.    linker interfaces.  They also choose not to make their ELF dymamic
  16.    linker interfaces compatible with the SOM dynamic linker.  The
  17.    net result is we can not use either of the existing somsolib.c or
  18.    solib.c.  What a crock.

  19.    Even more disgusting.  This file depends on functions provided only
  20.    in certain PA64 libraries.  Thus this file is supposed to only be
  21.    used native.  When will HP ever learn that they need to provide the
  22.    same functionality in all their libraries!  */

  23. #include "defs.h"
  24. #include "symtab.h"
  25. #include "bfd.h"
  26. #include "symfile.h"
  27. #include "objfiles.h"
  28. #include "gdbcore.h"
  29. #include "target.h"
  30. #include "inferior.h"
  31. #include "regcache.h"
  32. #include "gdb_bfd.h"

  33. #include "hppa-tdep.h"
  34. #include "solist.h"
  35. #include "solib.h"
  36. #include "solib-pa64.h"

  37. #undef SOLIB_PA64_DBG

  38. /* We can build this file only when running natively on 64-bit HP/UX.
  39.    We check for that by checking for the elf_hp.h header file.  */
  40. #if defined(HAVE_ELF_HP_H) && defined(__LP64__)

  41. /* FIXME: kettenis/20041213: These includes should be eliminated.  */
  42. #include <dlfcn.h>
  43. #include <elf.h>
  44. #include <elf_hp.h>

  45. struct lm_info {
  46.   struct load_module_desc desc;
  47.   CORE_ADDR desc_addr;
  48. };

  49. /* When adding fields, be sure to clear them in _initialize_pa64_solib.  */
  50. typedef struct
  51.   {
  52.     CORE_ADDR dld_flags_addr;
  53.     LONGEST dld_flags;
  54.     struct bfd_section *dyninfo_sect;
  55.     int have_read_dld_descriptor;
  56.     int is_valid;
  57.     CORE_ADDR load_map;
  58.     CORE_ADDR load_map_addr;
  59.     struct load_module_desc dld_desc;
  60.   }
  61. dld_cache_t;

  62. static dld_cache_t dld_cache;

  63. static int read_dynamic_info (asection *dyninfo_sect,
  64.                               dld_cache_t *dld_cache_p);

  65. static void
  66. pa64_relocate_section_addresses (struct so_list *so,
  67.                                  struct target_section *sec)
  68. {
  69.   asection *asec = sec->the_bfd_section;
  70.   CORE_ADDR load_offset;

  71.   /* Relocate all the sections based on where they got loaded.  */

  72.   load_offset = bfd_section_vma (so->abfd, asec) - asec->filepos;

  73.   if (asec->flags & SEC_CODE)
  74.     {
  75.       sec->addr += so->lm_info->desc.text_base - load_offset;
  76.       sec->endaddr += so->lm_info->desc.text_base - load_offset;
  77.     }
  78.   else if (asec->flags & SEC_DATA)
  79.     {
  80.       sec->addr += so->lm_info->desc.data_base - load_offset;
  81.       sec->endaddr += so->lm_info->desc.data_base - load_offset;
  82.     }
  83. }

  84. static void
  85. pa64_free_so (struct so_list *so)
  86. {
  87.   xfree (so->lm_info);
  88. }

  89. static void
  90. pa64_clear_solib (void)
  91. {
  92. }

  93. /* Wrapper for target_read_memory for dlgetmodinfo.  */

  94. static void *
  95. pa64_target_read_memory (void *buffer, CORE_ADDR ptr, size_t bufsiz, int ident)
  96. {
  97.   if (target_read_memory (ptr, buffer, bufsiz) != 0)
  98.     return 0;
  99.   return buffer;
  100. }

  101. /* Read the dynamic linker's internal shared library descriptor.

  102.    This must happen after dld starts running, so we can't do it in
  103.    read_dynamic_info.  Record the fact that we have loaded the
  104.    descriptor.  If the library is archive bound or the load map
  105.    hasn't been setup, then return zero; else return nonzero.  */

  106. static int
  107. read_dld_descriptor (void)
  108. {
  109.   char *dll_path;
  110.   asection *dyninfo_sect;

  111.   /* If necessary call read_dynamic_info to extract the contents of the
  112.      .dynamic section from the shared library.  */
  113.   if (!dld_cache.is_valid)
  114.     {
  115.       if (symfile_objfile == NULL)
  116.         error (_("No object file symbols."));

  117.       dyninfo_sect = bfd_get_section_by_name (symfile_objfile->obfd,
  118.                                               ".dynamic");
  119.       if (!dyninfo_sect)
  120.         {
  121.           return 0;
  122.         }

  123.       if (!read_dynamic_info (dyninfo_sect, &dld_cache))
  124.         error (_("Unable to read in .dynamic section information."));
  125.     }

  126.   /* Read the load map pointer.  */
  127.   if (target_read_memory (dld_cache.load_map_addr,
  128.                           (char *) &dld_cache.load_map,
  129.                           sizeof (dld_cache.load_map))
  130.       != 0)
  131.     {
  132.       error (_("Error while reading in load map pointer."));
  133.     }

  134.   if (!dld_cache.load_map)
  135.     return 0;

  136.   /* Read in the dld load module descriptor.  */
  137.   if (dlgetmodinfo (-1,
  138.                     &dld_cache.dld_desc,
  139.                     sizeof (dld_cache.dld_desc),
  140.                     pa64_target_read_memory,
  141.                     0,
  142.                     dld_cache.load_map)
  143.       == 0)
  144.     {
  145.       error (_("Error trying to get information about dynamic linker."));
  146.     }

  147.   /* Indicate that we have loaded the dld descriptor.  */
  148.   dld_cache.have_read_dld_descriptor = 1;

  149.   return 1;
  150. }


  151. /* Read the .dynamic section and extract the information of interest,
  152.    which is stored in dld_cache.  The routine elf_locate_base in solib.c
  153.    was used as a model for this.  */

  154. static int
  155. read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p)
  156. {
  157.   char *buf;
  158.   char *bufend;
  159.   CORE_ADDR dyninfo_addr;
  160.   int dyninfo_sect_size;
  161.   CORE_ADDR entry_addr;

  162.   /* Read in .dynamic section, silently ignore errors.  */
  163.   dyninfo_addr = bfd_section_vma (symfile_objfile->obfd, dyninfo_sect);
  164.   dyninfo_sect_size = bfd_section_size (exec_bfd, dyninfo_sect);
  165.   buf = alloca (dyninfo_sect_size);
  166.   if (target_read_memory (dyninfo_addr, buf, dyninfo_sect_size))
  167.     return 0;

  168.   /* Scan the .dynamic section and record the items of interest.
  169.      In particular, DT_HP_DLD_FLAGS.  */
  170.   for (bufend = buf + dyninfo_sect_size, entry_addr = dyninfo_addr;
  171.        buf < bufend;
  172.        buf += sizeof (Elf64_Dyn), entry_addr += sizeof (Elf64_Dyn))
  173.     {
  174.       Elf64_Dyn *x_dynp = (Elf64_Dyn*)buf;
  175.       Elf64_Sxword dyn_tag;
  176.       CORE_ADDR        dyn_ptr;

  177.       dyn_tag = bfd_h_get_64 (symfile_objfile->obfd,
  178.                               (bfd_byte*) &x_dynp->d_tag);

  179.       /* We can't use a switch here because dyn_tag is 64 bits and HP's
  180.          lame comiler does not handle 64bit items in switch statements.  */
  181.       if (dyn_tag == DT_NULL)
  182.         break;
  183.       else if (dyn_tag == DT_HP_DLD_FLAGS)
  184.         {
  185.           /* Set dld_flags_addr and dld_flags in *dld_cache_p.  */
  186.           dld_cache_p->dld_flags_addr = entry_addr + offsetof(Elf64_Dyn, d_un);
  187.           if (target_read_memory (dld_cache_p->dld_flags_addr,
  188.                                     (char*) &dld_cache_p->dld_flags,
  189.                                   sizeof (dld_cache_p->dld_flags))
  190.               != 0)
  191.             {
  192.               error (_("Error while reading in "
  193.                        ".dynamic section of the program."));
  194.             }
  195.         }
  196.       else if (dyn_tag == DT_HP_LOAD_MAP)
  197.         {
  198.           /* Dld will place the address of the load map at load_map_addr
  199.              after it starts running.  */
  200.           if (target_read_memory (entry_addr + offsetof(Elf64_Dyn,
  201.                                                         d_un.d_ptr),
  202.                                   (char*) &dld_cache_p->load_map_addr,
  203.                                   sizeof (dld_cache_p->load_map_addr))
  204.               != 0)
  205.             {
  206.               error (_("Error while reading in "
  207.                        ".dynamic section of the program."));
  208.             }
  209.         }
  210.       else
  211.         {
  212.           /* Tag is not of interest.  */
  213.         }
  214.     }

  215.   /* Record other information and set is_valid to 1.  */
  216.   dld_cache_p->dyninfo_sect = dyninfo_sect;

  217.   /* Verify that we read in required info.  These fields are re-set to zero
  218.      in pa64_solib_restart.  */

  219.   if (dld_cache_p->dld_flags_addr != 0 && dld_cache_p->load_map_addr != 0)
  220.     dld_cache_p->is_valid = 1;
  221.   else
  222.     return 0;

  223.   return 1;
  224. }

  225. /* Helper function for gdb_bfd_lookup_symbol_from_symtab.  */

  226. static int
  227. cmp_name (asymbol *sym, void *data)
  228. {
  229.   return (strcmp (sym->name, (const char *) data) == 0);
  230. }

  231. /* This hook gets called just before the first instruction in the
  232.    inferior process is executed.

  233.    This is our opportunity to set magic flags in the inferior so
  234.    that GDB can be notified when a shared library is mapped in and
  235.    to tell the dynamic linker that a private copy of the library is
  236.    needed (so GDB can set breakpoints in the library).

  237.    We need to set DT_HP_DEBUG_CALLBACK to indicate that we want the
  238.    dynamic linker to call the breakpoint routine for significant events.
  239.    We used to set DT_HP_DEBUG_PRIVATE to indicate that shared libraries
  240.    should be mapped private.  However, this flag can be set using
  241.    "chatr +dbg enable".  Not setting DT_HP_DEBUG_PRIVATE allows debugging
  242.    with shared libraries mapped shareable.  */

  243. static void
  244. pa64_solib_create_inferior_hook (int from_tty)
  245. {
  246.   struct minimal_symbol *msymbol;
  247.   unsigned int dld_flags, status;
  248.   asection *shlib_info, *interp_sect;
  249.   struct objfile *objfile;
  250.   CORE_ADDR anaddr;

  251.   if (symfile_objfile == NULL)
  252.     return;

  253.   /* First see if the objfile was dynamically linked.  */
  254.   shlib_info = bfd_get_section_by_name (symfile_objfile->obfd, ".dynamic");
  255.   if (!shlib_info)
  256.     return;

  257.   /* It's got a .dynamic section, make sure it's not empty.  */
  258.   if (bfd_section_size (symfile_objfile->obfd, shlib_info) == 0)
  259.     return;

  260.   /* Read in the .dynamic section.  */
  261.   if (! read_dynamic_info (shlib_info, &dld_cache))
  262.     error (_("Unable to read the .dynamic section."));

  263.   /* If the libraries were not mapped private, warn the user.  */
  264.   if ((dld_cache.dld_flags & DT_HP_DEBUG_PRIVATE) == 0)
  265.     warning
  266.       (_("\
  267. Private mapping of shared library text was not specified\n\
  268. by the executable; setting a breakpoint in a shared library which\n\
  269. is not privately mapped will not work.  See the HP-UX 11i v3 chatr\n\
  270. manpage for methods to privately map shared library text."));

  271.   /* Turn on the flags we care about.  */
  272.   dld_cache.dld_flags |= DT_HP_DEBUG_CALLBACK;
  273.   status = target_write_memory (dld_cache.dld_flags_addr,
  274.                                 (char *) &dld_cache.dld_flags,
  275.                                 sizeof (dld_cache.dld_flags));
  276.   if (status != 0)
  277.     error (_("Unable to modify dynamic linker flags."));

  278.   /* Now we have to create a shared library breakpoint in the dynamic
  279.      linker.  This can be somewhat tricky since the symbol is inside
  280.      the dynamic linker (for which we do not have symbols or a base
  281.      load address!   Luckily I wrote this code for solib.c years ago.  */
  282.   interp_sect = bfd_get_section_by_name (exec_bfd, ".interp");
  283.   if (interp_sect)
  284.     {
  285.       unsigned int interp_sect_size;
  286.       char *buf;
  287.       CORE_ADDR load_addr;
  288.       bfd *tmp_bfd;
  289.       CORE_ADDR sym_addr = 0;

  290.       /* Read the contents of the .interp section into a local buffer;
  291.          the contents specify the dynamic linker this program uses.  */
  292.       interp_sect_size = bfd_section_size (exec_bfd, interp_sect);
  293.       buf = alloca (interp_sect_size);
  294.       bfd_get_section_contents (exec_bfd, interp_sect,
  295.                                 buf, 0, interp_sect_size);

  296.       /* Now we need to figure out where the dynamic linker was
  297.          loaded so that we can load its symbols and place a breakpoint
  298.          in the dynamic linker itself.

  299.          This address is stored on the stack.  However, I've been unable
  300.          to find any magic formula to find it for Solaris (appears to
  301.          be trivial on GNU/Linux).  Therefore, we have to try an alternate
  302.          mechanism to find the dynamic linker's base address.  */
  303.       tmp_bfd = gdb_bfd_open (buf, gnutarget, -1);
  304.       if (tmp_bfd == NULL)
  305.         return;

  306.       /* Make sure the dynamic linker's really a useful object.  */
  307.       if (!bfd_check_format (tmp_bfd, bfd_object))
  308.         {
  309.           warning (_("Unable to grok dynamic linker %s as an object file"),
  310.                    buf);
  311.           gdb_bfd_unref (tmp_bfd);
  312.           return;
  313.         }

  314.       /* We find the dynamic linker's base address by examining the
  315.          current pc (which point at the entry point for the dynamic
  316.          linker) and subtracting the offset of the entry point.

  317.          Also note the breakpoint is the second instruction in the
  318.          routine.  */
  319.       load_addr = regcache_read_pc (get_current_regcache ())
  320.                   - tmp_bfd->start_address;
  321.       sym_addr = gdb_bfd_lookup_symbol_from_symtab (tmp_bfd, cmp_name,
  322.                                                     "__dld_break");
  323.       sym_addr = load_addr + sym_addr + 4;

  324.       /* Create the shared library breakpoint.  */
  325.       {
  326.         struct breakpoint *b
  327.           = create_solib_event_breakpoint (target_gdbarch (), sym_addr);

  328.         /* The breakpoint is actually hard-coded into the dynamic linker,
  329.            so we don't need to actually insert a breakpoint instruction
  330.            there.  In fact, the dynamic linker's code is immutable, even to
  331.            ttrace, so we shouldn't even try to do that.  For cases like
  332.            this, we have "permanent" breakpoints.  */
  333.         make_breakpoint_permanent (b);
  334.       }

  335.       /* We're done with the temporary bfd.  */
  336.       gdb_bfd_unref (tmp_bfd);
  337.     }
  338. }

  339. static void
  340. pa64_special_symbol_handling (void)
  341. {
  342. }

  343. static struct so_list *
  344. pa64_current_sos (void)
  345. {
  346.   struct so_list *head = 0;
  347.   struct so_list **link_ptr = &head;
  348.   int dll_index;

  349.   /* Read in the load map pointer if we have not done so already.  */
  350.   if (! dld_cache.have_read_dld_descriptor)
  351.     if (! read_dld_descriptor ())
  352.       return NULL;

  353.   for (dll_index = -1; ; dll_index++)
  354.     {
  355.       struct load_module_desc dll_desc;
  356.       char *dll_path;
  357.       struct so_list *new;
  358.       struct cleanup *old_chain;

  359.       if (dll_index == 0)
  360.         continue;

  361.       /* Read in the load module descriptor.  */
  362.       if (dlgetmodinfo (dll_index, &dll_desc, sizeof (dll_desc),
  363.                         pa64_target_read_memory, 0, dld_cache.load_map)
  364.           == 0)
  365.         break;

  366.       /* Get the name of the shared library.  */
  367.       dll_path = (char *)dlgetname (&dll_desc, sizeof (dll_desc),
  368.                             pa64_target_read_memory,
  369.                             0, dld_cache.load_map);

  370.       new = (struct so_list *) xmalloc (sizeof (struct so_list));
  371.       memset (new, 0, sizeof (struct so_list));
  372.       new->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info));
  373.       memset (new->lm_info, 0, sizeof (struct lm_info));

  374.       strncpy (new->so_name, dll_path, SO_NAME_MAX_PATH_SIZE - 1);
  375.       new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
  376.       strcpy (new->so_original_name, new->so_name);

  377.       memcpy (&new->lm_info->desc, &dll_desc, sizeof (dll_desc));

  378. #ifdef SOLIB_PA64_DBG
  379.       {
  380.         struct load_module_desc *d = &new->lm_info->desc;

  381.         printf ("\n+ library \"%s\" is described at index %d\n", new->so_name,
  382.                 dll_index);
  383.         printf ("    text_base = %s\n", hex_string (d->text_base));
  384.         printf ("    text_size = %s\n", hex_string (d->text_size));
  385.         printf ("    data_base = %s\n", hex_string (d->data_base));
  386.         printf ("    data_size = %s\n", hex_string (d->data_size));
  387.         printf ("    unwind_base = %s\n", hex_string (d->unwind_base));
  388.         printf ("    linkage_ptr = %s\n", hex_string (d->linkage_ptr));
  389.         printf ("    phdr_base = %s\n", hex_string (d->phdr_base));
  390.         printf ("    tls_size = %s\n", hex_string (d->tls_size));
  391.         printf ("    tls_start_addr = %s\n", hex_string (d->tls_start_addr));
  392.         printf ("    unwind_size = %s\n", hex_string (d->unwind_size));
  393.         printf ("    tls_index = %s\n", hex_string (d->tls_index));
  394.       }
  395. #endif

  396.       /* Link the new object onto the list.  */
  397.       new->next = NULL;
  398.       *link_ptr = new;
  399.       link_ptr = &new->next;
  400.     }

  401.   return head;
  402. }

  403. static int
  404. pa64_open_symbol_file_object (void *from_ttyp)
  405. {
  406.   int from_tty = *(int *)from_ttyp;
  407.   struct load_module_desc dll_desc;
  408.   char *dll_path;

  409.   if (symfile_objfile)
  410.     if (!query (_("Attempt to reload symbols from process? ")))
  411.       return 0;

  412.   /* Read in the load map pointer if we have not done so already.  */
  413.   if (! dld_cache.have_read_dld_descriptor)
  414.     if (! read_dld_descriptor ())
  415.       return 0;

  416.   /* Read in the load module descriptor.  */
  417.   if (dlgetmodinfo (0, &dll_desc, sizeof (dll_desc),
  418.                     pa64_target_read_memory, 0, dld_cache.load_map) == 0)
  419.     return 0;

  420.   /* Get the name of the shared library.  */
  421.   dll_path = (char *)dlgetname (&dll_desc, sizeof (dll_desc),
  422.                                 pa64_target_read_memory,
  423.                                 0, dld_cache.load_map);

  424.   /* Have a pathname: read the symbol file.  */
  425.   symbol_file_add_main (dll_path, from_tty);

  426.   return 1;
  427. }

  428. /* Return nonzero if PC is an address inside the dynamic linker.  */
  429. static int
  430. pa64_in_dynsym_resolve_code (CORE_ADDR pc)
  431. {
  432.   asection *shlib_info;

  433.   if (symfile_objfile == NULL)
  434.     return 0;

  435.   if (!dld_cache.have_read_dld_descriptor)
  436.     if (!read_dld_descriptor ())
  437.       return 0;

  438.   return (pc >= dld_cache.dld_desc.text_base
  439.           && pc < dld_cache.dld_desc.text_base + dld_cache.dld_desc.text_size);
  440. }


  441. /* Return the GOT value for the shared library in which ADDR belongs.  If
  442.    ADDR isn't in any known shared library, return zero.  */

  443. static CORE_ADDR
  444. pa64_solib_get_got_by_pc (CORE_ADDR addr)
  445. {
  446.   struct so_list *so_list = master_so_list ();
  447.   CORE_ADDR got_value = 0;

  448.   while (so_list)
  449.     {
  450.       if (so_list->lm_info->desc.text_base <= addr
  451.           && ((so_list->lm_info->desc.text_base
  452.                + so_list->lm_info->desc.text_size)
  453.               > addr))
  454.         {
  455.           got_value = so_list->lm_info->desc.linkage_ptr;
  456.            break;
  457.         }
  458.       so_list = so_list->next;
  459.     }
  460.   return got_value;
  461. }

  462. /* Get some HPUX-specific data from a shared lib.  */
  463. static CORE_ADDR
  464. pa64_solib_thread_start_addr (struct so_list *so)
  465. {
  466.   return so->lm_info->desc.tls_start_addr;
  467. }


  468. /* Return the address of the handle of the shared library in which ADDR
  469.    belongs.  If ADDR isn't in any known shared library, return zero.  */

  470. static CORE_ADDR
  471. pa64_solib_get_solib_by_pc (CORE_ADDR addr)
  472. {
  473.   struct so_list *so_list = master_so_list ();
  474.   CORE_ADDR retval = 0;

  475.   while (so_list)
  476.     {
  477.       if (so_list->lm_info->desc.text_base <= addr
  478.           && ((so_list->lm_info->desc.text_base
  479.                + so_list->lm_info->desc.text_size)
  480.               > addr))
  481.         {
  482.           retval = so_list->lm_info->desc_addr;
  483.           break;
  484.         }
  485.       so_list = so_list->next;
  486.     }
  487.   return retval;
  488. }

  489. /* pa64 libraries do not seem to set the section offsets in a standard (i.e.
  490.    SVr4) way; the text section offset stored in the file doesn't correspond
  491.    to the place where the library is actually loaded into memory.  Instead,
  492.    we rely on the dll descriptor to tell us where things were loaded.  */
  493. static CORE_ADDR
  494. pa64_solib_get_text_base (struct objfile *objfile)
  495. {
  496.   struct so_list *so;

  497.   for (so = master_so_list (); so; so = so->next)
  498.     if (so->objfile == objfile)
  499.       return so->lm_info->desc.text_base;

  500.   return 0;
  501. }

  502. static struct target_so_ops pa64_so_ops;

  503. extern initialize_file_ftype _initialize_pa64_solib; /* -Wmissing-prototypes */

  504. void
  505. _initialize_pa64_solib (void)
  506. {
  507.   pa64_so_ops.relocate_section_addresses = pa64_relocate_section_addresses;
  508.   pa64_so_ops.free_so = pa64_free_so;
  509.   pa64_so_ops.clear_solib = pa64_clear_solib;
  510.   pa64_so_ops.solib_create_inferior_hook = pa64_solib_create_inferior_hook;
  511.   pa64_so_ops.special_symbol_handling = pa64_special_symbol_handling;
  512.   pa64_so_ops.current_sos = pa64_current_sos;
  513.   pa64_so_ops.open_symbol_file_object = pa64_open_symbol_file_object;
  514.   pa64_so_ops.in_dynsym_resolve_code = pa64_in_dynsym_resolve_code;
  515.   pa64_so_ops.bfd_open = solib_bfd_open;

  516.   memset (&dld_cache, 0, sizeof (dld_cache));
  517. }

  518. void pa64_solib_select (struct gdbarch *gdbarch)
  519. {
  520.   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);

  521.   set_solib_ops (gdbarch, &pa64_so_ops);
  522.   tdep->solib_thread_start_addr = pa64_solib_thread_start_addr;
  523.   tdep->solib_get_got_by_pc = pa64_solib_get_got_by_pc;
  524.   tdep->solib_get_solib_by_pc = pa64_solib_get_solib_by_pc;
  525.   tdep->solib_get_text_base = pa64_solib_get_text_base;
  526. }

  527. #else /* HAVE_ELF_HP_H */

  528. extern initialize_file_ftype _initialize_pa64_solib; /* -Wmissing-prototypes */

  529. void
  530. _initialize_pa64_solib (void)
  531. {
  532. }

  533. void pa64_solib_select (struct gdbarch *gdbarch)
  534. {
  535.   /* For a SOM-only target, there is no pa64 solib support.  This is needed
  536.      for hppa-hpux-tdep.c to build.  */
  537.   error (_("Cannot select pa64 solib support for this configuration."));
  538. }
  539. #endif