* target.h (struct section_table): Rename to ...
[deliverable/binutils-gdb.git] / gdb / solib-pa64.c
CommitLineData
419b8bfb
RC
1/* Handle PA64 shared libraries for GDB, the GNU Debugger.
2
0fb0cc75 3 Copyright (C) 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
419b8bfb
RC
4
5 This file is part of GDB.
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
a9762ec7 9 the Free Software Foundation; either version 3 of the License, or
419b8bfb
RC
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
a9762ec7 18 along with this program. If not, see <http://www.gnu.org/licenses/>.
419b8bfb
RC
19
20 HP in their infinite stupidity choose not to use standard ELF dynamic
21 linker interfaces. They also choose not to make their ELF dymamic
22 linker interfaces compatible with the SOM dynamic linker. The
23 net result is we can not use either of the existing somsolib.c or
24 solib.c. What a crock.
25
26 Even more disgusting. This file depends on functions provided only
27 in certain PA64 libraries. Thus this file is supposed to only be
28 used native. When will HP ever learn that they need to provide the
29 same functionality in all their libraries! */
30
31#include "defs.h"
419b8bfb
RC
32#include "symtab.h"
33#include "bfd.h"
34#include "symfile.h"
35#include "objfiles.h"
36#include "gdbcore.h"
37#include "target.h"
38#include "inferior.h"
fb14de7b 39#include "regcache.h"
419b8bfb
RC
40
41#include "hppa-tdep.h"
42#include "solist.h"
d542061a 43#include "solib.h"
419b8bfb
RC
44#include "solib-pa64.h"
45
46#undef SOLIB_PA64_DBG
47
d542061a
UW
48/* We can build this file only when running natively on 64-bit HP/UX.
49 We check for that by checking for the elf_hp.h header file. */
fb6d93b2 50#if defined(HAVE_ELF_HP_H) && defined(__LP64__)
419b8bfb 51
d0ac9ef8
MK
52/* FIXME: kettenis/20041213: These includes should be eliminated. */
53#include <dlfcn.h>
54#include <elf.h>
55#include <elf_hp.h>
56
419b8bfb
RC
57struct lm_info {
58 struct load_module_desc desc;
59 CORE_ADDR desc_addr;
60};
61
62/* When adding fields, be sure to clear them in _initialize_pa64_solib. */
63typedef struct
64 {
65 CORE_ADDR dld_flags_addr;
66 LONGEST dld_flags;
67 struct bfd_section *dyninfo_sect;
68 int have_read_dld_descriptor;
69 int is_valid;
70 CORE_ADDR load_map;
71 CORE_ADDR load_map_addr;
72 struct load_module_desc dld_desc;
73 }
74dld_cache_t;
75
76static dld_cache_t dld_cache;
77
78static int
79read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p);
80
81static void
82pa64_relocate_section_addresses (struct so_list *so,
0542c86d 83 struct target_section *sec)
419b8bfb 84{
45851e00
RC
85 asection *asec = sec->the_bfd_section;
86 CORE_ADDR load_offset;
87
88 /* Relocate all the sections based on where they got loaded. */
89
90 load_offset = bfd_section_vma (so->abfd, asec) - asec->filepos;
91
92 if (asec->flags & SEC_CODE)
93 {
94 sec->addr += so->lm_info->desc.text_base - load_offset;
95 sec->endaddr += so->lm_info->desc.text_base - load_offset;
96 }
97 else if (asec->flags & SEC_DATA)
98 {
99 sec->addr += so->lm_info->desc.data_base - load_offset;
100 sec->endaddr += so->lm_info->desc.data_base - load_offset;
101 }
419b8bfb
RC
102}
103
104static void
105pa64_free_so (struct so_list *so)
106{
107 xfree (so->lm_info);
108}
109
110static void
111pa64_clear_solib (void)
112{
113}
114
115/* Wrapper for target_read_memory for dlgetmodinfo. */
116
117static void *
118pa64_target_read_memory (void *buffer, CORE_ADDR ptr, size_t bufsiz, int ident)
119{
120 if (target_read_memory (ptr, buffer, bufsiz) != 0)
121 return 0;
122 return buffer;
123}
124
125/* Read the dynamic linker's internal shared library descriptor.
126
127 This must happen after dld starts running, so we can't do it in
128 read_dynamic_info. Record the fact that we have loaded the
6536cc32
DA
129 descriptor. If the library is archive bound or the load map
130 hasn't been setup, then return zero; else return nonzero. */
419b8bfb
RC
131
132static int
133read_dld_descriptor (void)
134{
135 char *dll_path;
136 asection *dyninfo_sect;
137
138 /* If necessary call read_dynamic_info to extract the contents of the
139 .dynamic section from the shared library. */
140 if (!dld_cache.is_valid)
141 {
142 if (symfile_objfile == NULL)
8a3fe4f8 143 error (_("No object file symbols."));
419b8bfb
RC
144
145 dyninfo_sect = bfd_get_section_by_name (symfile_objfile->obfd,
146 ".dynamic");
147 if (!dyninfo_sect)
148 {
149 return 0;
150 }
151
152 if (!read_dynamic_info (dyninfo_sect, &dld_cache))
8a3fe4f8 153 error (_("Unable to read in .dynamic section information."));
419b8bfb
RC
154 }
155
156 /* Read the load map pointer. */
157 if (target_read_memory (dld_cache.load_map_addr,
158 (char *) &dld_cache.load_map,
159 sizeof (dld_cache.load_map))
160 != 0)
161 {
8a3fe4f8 162 error (_("Error while reading in load map pointer."));
419b8bfb
RC
163 }
164
6536cc32
DA
165 if (!dld_cache.load_map)
166 return 0;
167
419b8bfb
RC
168 /* Read in the dld load module descriptor */
169 if (dlgetmodinfo (-1,
170 &dld_cache.dld_desc,
171 sizeof (dld_cache.dld_desc),
172 pa64_target_read_memory,
173 0,
174 dld_cache.load_map)
175 == 0)
176 {
8a3fe4f8 177 error (_("Error trying to get information about dynamic linker."));
419b8bfb
RC
178 }
179
180 /* Indicate that we have loaded the dld descriptor. */
181 dld_cache.have_read_dld_descriptor = 1;
182
183 return 1;
184}
185
186
187/* Read the .dynamic section and extract the information of interest,
188 which is stored in dld_cache. The routine elf_locate_base in solib.c
189 was used as a model for this. */
190
191static int
192read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p)
193{
194 char *buf;
195 char *bufend;
196 CORE_ADDR dyninfo_addr;
197 int dyninfo_sect_size;
198 CORE_ADDR entry_addr;
199
200 /* Read in .dynamic section, silently ignore errors. */
201 dyninfo_addr = bfd_section_vma (symfile_objfile->obfd, dyninfo_sect);
202 dyninfo_sect_size = bfd_section_size (exec_bfd, dyninfo_sect);
203 buf = alloca (dyninfo_sect_size);
204 if (target_read_memory (dyninfo_addr, buf, dyninfo_sect_size))
205 return 0;
206
207 /* Scan the .dynamic section and record the items of interest.
208 In particular, DT_HP_DLD_FLAGS */
209 for (bufend = buf + dyninfo_sect_size, entry_addr = dyninfo_addr;
210 buf < bufend;
211 buf += sizeof (Elf64_Dyn), entry_addr += sizeof (Elf64_Dyn))
212 {
213 Elf64_Dyn *x_dynp = (Elf64_Dyn*)buf;
214 Elf64_Sxword dyn_tag;
215 CORE_ADDR dyn_ptr;
216 char *pbuf;
217
819844ad 218 pbuf = alloca (gdbarch_ptr_bit (current_gdbarch) / HOST_CHAR_BIT);
419b8bfb
RC
219 dyn_tag = bfd_h_get_64 (symfile_objfile->obfd,
220 (bfd_byte*) &x_dynp->d_tag);
221
222 /* We can't use a switch here because dyn_tag is 64 bits and HP's
223 lame comiler does not handle 64bit items in switch statements. */
224 if (dyn_tag == DT_NULL)
225 break;
226 else if (dyn_tag == DT_HP_DLD_FLAGS)
227 {
228 /* Set dld_flags_addr and dld_flags in *dld_cache_p */
229 dld_cache_p->dld_flags_addr = entry_addr + offsetof(Elf64_Dyn, d_un);
230 if (target_read_memory (dld_cache_p->dld_flags_addr,
231 (char*) &dld_cache_p->dld_flags,
232 sizeof (dld_cache_p->dld_flags))
233 != 0)
234 {
8a3fe4f8 235 error (_("Error while reading in .dynamic section of the program."));
419b8bfb
RC
236 }
237 }
238 else if (dyn_tag == DT_HP_LOAD_MAP)
239 {
240 /* Dld will place the address of the load map at load_map_addr
241 after it starts running. */
242 if (target_read_memory (entry_addr + offsetof(Elf64_Dyn,
243 d_un.d_ptr),
244 (char*) &dld_cache_p->load_map_addr,
245 sizeof (dld_cache_p->load_map_addr))
246 != 0)
247 {
8a3fe4f8 248 error (_("Error while reading in .dynamic section of the program."));
419b8bfb
RC
249 }
250 }
251 else
252 {
253 /* tag is not of interest */
254 }
255 }
256
257 /* Record other information and set is_valid to 1. */
258 dld_cache_p->dyninfo_sect = dyninfo_sect;
259
260 /* Verify that we read in required info. These fields are re-set to zero
261 in pa64_solib_restart. */
262
263 if (dld_cache_p->dld_flags_addr != 0 && dld_cache_p->load_map_addr != 0)
264 dld_cache_p->is_valid = 1;
265 else
266 return 0;
267
268 return 1;
269}
270
271/*
272 bfd_lookup_symbol -- lookup the value for a specific symbol
273
274 An expensive way to lookup the value of a single symbol for
275 bfd's that are only temporary anyway. This is used by the
276 shared library support to find the address of the debugger
277 interface structures in the shared library.
278
279 Note that 0 is specifically allowed as an error return (no
280 such symbol).
281 */
282
283static CORE_ADDR
284bfd_lookup_symbol (bfd *abfd, char *symname)
285{
286 unsigned int storage_needed;
287 asymbol *sym;
288 asymbol **symbol_table;
289 unsigned int number_of_symbols;
290 unsigned int i;
291 struct cleanup *back_to;
292 CORE_ADDR symaddr = 0;
293
294 storage_needed = bfd_get_symtab_upper_bound (abfd);
295
296 if (storage_needed > 0)
297 {
298 symbol_table = (asymbol **) xmalloc (storage_needed);
299 back_to = make_cleanup (xfree, symbol_table);
300 number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
301
302 for (i = 0; i < number_of_symbols; i++)
303 {
304 sym = *symbol_table++;
305 if (strcmp (sym->name, symname) == 0)
306 {
307 /* Bfd symbols are section relative. */
308 symaddr = sym->value + sym->section->vma;
309 break;
310 }
311 }
312 do_cleanups (back_to);
313 }
314 return (symaddr);
315}
316
317
318/* This hook gets called just before the first instruction in the
319 inferior process is executed.
320
321 This is our opportunity to set magic flags in the inferior so
322 that GDB can be notified when a shared library is mapped in and
323 to tell the dynamic linker that a private copy of the library is
324 needed (so GDB can set breakpoints in the library).
325
7be67755
DA
326 We need to set DT_HP_DEBUG_CALLBACK to indicate that we want the
327 dynamic linker to call the breakpoint routine for significant events.
328 We used to set DT_HP_DEBUG_PRIVATE to indicate that shared libraries
329 should be mapped private. However, this flag can be set using
330 "chatr +dbg enable". Not setting DT_HP_DEBUG_PRIVATE allows debugging
331 with shared libraries mapped shareable. */
419b8bfb
RC
332
333static void
334pa64_solib_create_inferior_hook (void)
335{
336 struct minimal_symbol *msymbol;
337 unsigned int dld_flags, status;
338 asection *shlib_info, *interp_sect;
339 char buf[4];
340 struct objfile *objfile;
341 CORE_ADDR anaddr;
342
343 /* First, remove all the solib event breakpoints. Their addresses
344 may have changed since the last time we ran the program. */
345 remove_solib_event_breakpoints ();
346
347 if (symfile_objfile == NULL)
348 return;
349
350 /* First see if the objfile was dynamically linked. */
351 shlib_info = bfd_get_section_by_name (symfile_objfile->obfd, ".dynamic");
352 if (!shlib_info)
353 return;
354
355 /* It's got a .dynamic section, make sure it's not empty. */
356 if (bfd_section_size (symfile_objfile->obfd, shlib_info) == 0)
357 return;
358
359 /* Read in the .dynamic section. */
360 if (! read_dynamic_info (shlib_info, &dld_cache))
8a3fe4f8 361 error (_("Unable to read the .dynamic section."));
419b8bfb 362
7be67755
DA
363 /* If the libraries were not mapped private, warn the user. */
364 if ((dld_cache.dld_flags & DT_HP_DEBUG_PRIVATE) == 0)
365 warning
366 (_("Private mapping of shared library text was not specified\n"
367 "by the executable; setting a breakpoint in a shared library which\n"
368 "is not privately mapped will not work. See the HP-UX 11i v3 chatr\n"
369 "manpage for methods to privately map shared library text."));
370
419b8bfb 371 /* Turn on the flags we care about. */
419b8bfb
RC
372 dld_cache.dld_flags |= DT_HP_DEBUG_CALLBACK;
373 status = target_write_memory (dld_cache.dld_flags_addr,
374 (char *) &dld_cache.dld_flags,
375 sizeof (dld_cache.dld_flags));
376 if (status != 0)
8a3fe4f8 377 error (_("Unable to modify dynamic linker flags."));
419b8bfb
RC
378
379 /* Now we have to create a shared library breakpoint in the dynamic
380 linker. This can be somewhat tricky since the symbol is inside
381 the dynamic linker (for which we do not have symbols or a base
382 load address! Luckily I wrote this code for solib.c years ago. */
383 interp_sect = bfd_get_section_by_name (exec_bfd, ".interp");
384 if (interp_sect)
385 {
386 unsigned int interp_sect_size;
387 char *buf;
388 CORE_ADDR load_addr;
389 bfd *tmp_bfd;
390 CORE_ADDR sym_addr = 0;
391
392 /* Read the contents of the .interp section into a local buffer;
393 the contents specify the dynamic linker this program uses. */
394 interp_sect_size = bfd_section_size (exec_bfd, interp_sect);
395 buf = alloca (interp_sect_size);
396 bfd_get_section_contents (exec_bfd, interp_sect,
397 buf, 0, interp_sect_size);
398
399 /* Now we need to figure out where the dynamic linker was
400 loaded so that we can load its symbols and place a breakpoint
401 in the dynamic linker itself.
402
403 This address is stored on the stack. However, I've been unable
404 to find any magic formula to find it for Solaris (appears to
405 be trivial on GNU/Linux). Therefore, we have to try an alternate
406 mechanism to find the dynamic linker's base address. */
407 tmp_bfd = bfd_openr (buf, gnutarget);
408 if (tmp_bfd == NULL)
409 return;
410
411 /* Make sure the dynamic linker's really a useful object. */
412 if (!bfd_check_format (tmp_bfd, bfd_object))
413 {
8a3fe4f8 414 warning (_("Unable to grok dynamic linker %s as an object file"), buf);
419b8bfb
RC
415 bfd_close (tmp_bfd);
416 return;
417 }
418
419 /* We find the dynamic linker's base address by examining the
420 current pc (which point at the entry point for the dynamic
421 linker) and subtracting the offset of the entry point.
422
423 Also note the breakpoint is the second instruction in the
424 routine. */
fb14de7b
UW
425 load_addr = regcache_read_pc (get_current_regcache ())
426 - tmp_bfd->start_address;
419b8bfb
RC
427 sym_addr = bfd_lookup_symbol (tmp_bfd, "__dld_break");
428 sym_addr = load_addr + sym_addr + 4;
429
430 /* Create the shared library breakpoint. */
431 {
432 struct breakpoint *b
433 = create_solib_event_breakpoint (sym_addr);
434
435 /* The breakpoint is actually hard-coded into the dynamic linker,
436 so we don't need to actually insert a breakpoint instruction
437 there. In fact, the dynamic linker's code is immutable, even to
438 ttrace, so we shouldn't even try to do that. For cases like
439 this, we have "permanent" breakpoints. */
440 make_breakpoint_permanent (b);
441 }
442
443 /* We're done with the temporary bfd. */
444 bfd_close (tmp_bfd);
445 }
446}
447
448static void
449pa64_special_symbol_handling (void)
450{
451}
452
453static struct so_list *
454pa64_current_sos (void)
455{
456 struct so_list *head = 0;
457 struct so_list **link_ptr = &head;
458 int dll_index;
459
460 /* Read in the load map pointer if we have not done so already. */
461 if (! dld_cache.have_read_dld_descriptor)
462 if (! read_dld_descriptor ())
463 return NULL;
464
45851e00 465 for (dll_index = -1; ; dll_index++)
419b8bfb
RC
466 {
467 struct load_module_desc dll_desc;
468 char *dll_path;
469 struct so_list *new;
470 struct cleanup *old_chain;
471
45851e00
RC
472 if (dll_index == 0)
473 continue;
474
419b8bfb
RC
475 /* Read in the load module descriptor. */
476 if (dlgetmodinfo (dll_index, &dll_desc, sizeof (dll_desc),
477 pa64_target_read_memory, 0, dld_cache.load_map)
478 == 0)
479 break;
480
481 /* Get the name of the shared library. */
482 dll_path = (char *)dlgetname (&dll_desc, sizeof (dll_desc),
483 pa64_target_read_memory,
484 0, dld_cache.load_map);
485
419b8bfb
RC
486 new = (struct so_list *) xmalloc (sizeof (struct so_list));
487 memset (new, 0, sizeof (struct so_list));
488 new->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info));
489 memset (new->lm_info, 0, sizeof (struct lm_info));
490
491 strncpy (new->so_name, dll_path, SO_NAME_MAX_PATH_SIZE - 1);
492 new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
493 strcpy (new->so_original_name, new->so_name);
494
495 memcpy (&new->lm_info->desc, &dll_desc, sizeof (dll_desc));
496
497#ifdef SOLIB_PA64_DBG
498 {
499 struct load_module_desc *d = &new->lm_info->desc;
500 printf ("\n+ library \"%s\" is described at index %d\n", new->so_name,
501 dll_index);
502 printf (" text_base = 0x%llx\n", d->text_base);
503 printf (" text_size = 0x%llx\n", d->text_size);
504 printf (" data_base = 0x%llx\n", d->data_base);
505 printf (" data_size = 0x%llx\n", d->data_size);
506 printf (" unwind_base = 0x%llx\n", d->unwind_base);
507 printf (" linkage_ptr = 0x%llx\n", d->linkage_ptr);
508 printf (" phdr_base = 0x%llx\n", d->phdr_base);
509 printf (" tls_size = 0x%llx\n", d->tls_size);
510 printf (" tls_start_addr = 0x%llx\n", d->tls_start_addr);
511 printf (" unwind_size = 0x%llx\n", d->unwind_size);
512 printf (" tls_index = 0x%llx\n", d->tls_index);
513 }
514#endif
515
516 /* Link the new object onto the list. */
517 new->next = NULL;
518 *link_ptr = new;
519 link_ptr = &new->next;
520 }
521
522 return head;
523}
524
525static int
526pa64_open_symbol_file_object (void *from_ttyp)
527{
528 int from_tty = *(int *)from_ttyp;
529 char buf[4];
530 struct load_module_desc dll_desc;
531 char *dll_path;
532
533 if (symfile_objfile)
9e2f0ad4 534 if (!query (_("Attempt to reload symbols from process? ")))
419b8bfb
RC
535 return 0;
536
537 /* Read in the load map pointer if we have not done so already. */
538 if (! dld_cache.have_read_dld_descriptor)
539 if (! read_dld_descriptor ())
540 return 0;
541
542 /* Read in the load module descriptor. */
543 if (dlgetmodinfo (0, &dll_desc, sizeof (dll_desc),
544 pa64_target_read_memory, 0, dld_cache.load_map) == 0)
545 return 0;
546
547 /* Get the name of the shared library. */
548 dll_path = (char *)dlgetname (&dll_desc, sizeof (dll_desc),
549 pa64_target_read_memory,
550 0, dld_cache.load_map);
551
552 /* Have a pathname: read the symbol file. */
553 symbol_file_add_main (dll_path, from_tty);
554
555 return 1;
556}
557
558/* Return nonzero if PC is an address inside the dynamic linker. */
559static int
560pa64_in_dynsym_resolve_code (CORE_ADDR pc)
561{
562 asection *shlib_info;
563
564 if (symfile_objfile == NULL)
565 return 0;
566
567 if (!dld_cache.have_read_dld_descriptor)
568 if (!read_dld_descriptor ())
569 return 0;
570
571 return (pc >= dld_cache.dld_desc.text_base
572 && pc < dld_cache.dld_desc.text_base + dld_cache.dld_desc.text_size);
573}
574
575
576/* Return the GOT value for the shared library in which ADDR belongs. If
577 ADDR isn't in any known shared library, return zero. */
578
579static CORE_ADDR
580pa64_solib_get_got_by_pc (CORE_ADDR addr)
581{
582 struct so_list *so_list = master_so_list ();
583 CORE_ADDR got_value = 0;
584
585 while (so_list)
586 {
587 if (so_list->lm_info->desc.text_base <= addr
588 && ((so_list->lm_info->desc.text_base
589 + so_list->lm_info->desc.text_size)
590 > addr))
45851e00 591 {
419b8bfb 592 got_value = so_list->lm_info->desc.linkage_ptr;
45851e00 593 break;
419b8bfb
RC
594 }
595 so_list = so_list->next;
596 }
597 return got_value;
598}
599
600/* Get some HPUX-specific data from a shared lib. */
601static CORE_ADDR
602pa64_solib_thread_start_addr (struct so_list *so)
603{
604 return so->lm_info->desc.tls_start_addr;
605}
606
607
608/* Return the address of the handle of the shared library in which ADDR
45851e00 609 belongs. If ADDR isn't in any known shared library, return zero. */
419b8bfb
RC
610
611static CORE_ADDR
612pa64_solib_get_solib_by_pc (CORE_ADDR addr)
613{
614 struct so_list *so_list = master_so_list ();
615 CORE_ADDR retval = 0;
616
617 while (so_list)
618 {
619 if (so_list->lm_info->desc.text_base <= addr
620 && ((so_list->lm_info->desc.text_base
621 + so_list->lm_info->desc.text_size)
622 > addr))
623 {
624 retval = so_list->lm_info->desc_addr;
625 break;
626 }
627 so_list = so_list->next;
628 }
629 return retval;
630}
631
45851e00
RC
632/* pa64 libraries do not seem to set the section offsets in a standard (i.e.
633 SVr4) way; the text section offset stored in the file doesn't correspond
634 to the place where the library is actually loaded into memory. Instead,
635 we rely on the dll descriptor to tell us where things were loaded. */
636static CORE_ADDR
637pa64_solib_get_text_base (struct objfile *objfile)
638{
639 struct so_list *so;
640
641 for (so = master_so_list (); so; so = so->next)
642 if (so->objfile == objfile)
643 return so->lm_info->desc.text_base;
644
645 return 0;
646}
647
419b8bfb
RC
648static struct target_so_ops pa64_so_ops;
649
650extern initialize_file_ftype _initialize_pa64_solib; /* -Wmissing-prototypes */
651
652void
653_initialize_pa64_solib (void)
654{
655 pa64_so_ops.relocate_section_addresses = pa64_relocate_section_addresses;
656 pa64_so_ops.free_so = pa64_free_so;
657 pa64_so_ops.clear_solib = pa64_clear_solib;
658 pa64_so_ops.solib_create_inferior_hook = pa64_solib_create_inferior_hook;
659 pa64_so_ops.special_symbol_handling = pa64_special_symbol_handling;
660 pa64_so_ops.current_sos = pa64_current_sos;
661 pa64_so_ops.open_symbol_file_object = pa64_open_symbol_file_object;
662 pa64_so_ops.in_dynsym_resolve_code = pa64_in_dynsym_resolve_code;
663
664 memset (&dld_cache, 0, sizeof (dld_cache));
665}
666
d542061a 667void pa64_solib_select (struct gdbarch *gdbarch)
419b8bfb 668{
d542061a
UW
669 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
670 set_solib_ops (gdbarch, &pa64_so_ops);
419b8bfb
RC
671
672 tdep->solib_thread_start_addr = pa64_solib_thread_start_addr;
673 tdep->solib_get_got_by_pc = pa64_solib_get_got_by_pc;
674 tdep->solib_get_solib_by_pc = pa64_solib_get_solib_by_pc;
45851e00 675 tdep->solib_get_text_base = pa64_solib_get_text_base;
419b8bfb
RC
676}
677
d542061a 678#else /* HAVE_ELF_HP_H */
419b8bfb
RC
679
680extern initialize_file_ftype _initialize_pa64_solib; /* -Wmissing-prototypes */
681
682void
683_initialize_pa64_solib (void)
684{
685}
686
d542061a 687void pa64_solib_select (struct gdbarch *gdbarch)
419b8bfb
RC
688{
689 /* For a SOM-only target, there is no pa64 solib support. This is needed
690 for hppa-hpux-tdep.c to build. */
8a3fe4f8 691 error (_("Cannot select pa64 solib support for this configuration."));
419b8bfb
RC
692}
693#endif
This page took 0.388156 seconds and 4 git commands to generate.