1 /* Handle SOM shared libraries.
3 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
5 This file is part of GDB.
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.
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.
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., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA. */
32 #include "hppa-tdep.h"
37 /* These ought to be defined in some public interface, but aren't. They
38 define the meaning of the various bits in the distinguished __dld_flags
39 variable that is declared in every debuggable a.out on HP-UX, and that
40 is shared between the debugger and the dynamic linker.
42 #define DLD_FLAGS_MAPPRIVATE 0x1
43 #define DLD_FLAGS_HOOKVALID 0x2
44 #define DLD_FLAGS_LISTVALID 0x4
45 #define DLD_FLAGS_BOR_ENABLE 0x8
49 /* Version of this structure (it is expected to change again in hpux10). */
50 unsigned char struct_version
;
52 /* Binding mode for this library. */
53 unsigned char bind_mode
;
55 /* Version of this library. */
56 short library_version
;
58 /* Start of text address,
59 link-time text location (length of text area),
60 end of text address. */
62 CORE_ADDR text_link_addr
;
65 /* Start of data, start of bss and end of data. */
70 /* Value of linkage pointer (%r19). */
73 /* Address in target of offset from thread-local register of
74 start of this thread's data. I.e., the first thread-local
75 variable in this shared library starts at *(tsd_start_addr)
76 from that area pointed to by cr27 (mpsfu_hi).
78 We do the indirection as soon as we read it, so from then
79 on it's the offset itself. */
80 CORE_ADDR tsd_start_addr
;
82 /* Address of the link map entry in the loader. */
86 /* These addresses should be filled in by som_solib_create_inferior_hook.
87 They are also used elsewhere in this module.
92 struct unwind_table_entry
*unwind
;
96 /* When adding fields, be sure to clear them in _initialize_som_solib. */
100 addr_and_unwind_t hook
;
101 addr_and_unwind_t hook_stub
;
102 addr_and_unwind_t load
;
103 addr_and_unwind_t load_stub
;
104 addr_and_unwind_t unload
;
105 addr_and_unwind_t unload2
;
106 addr_and_unwind_t unload_stub
;
111 som_relocate_section_addresses (struct so_list
*so
,
112 struct section_table
*sec
)
114 flagword aflag
= bfd_get_section_flags(so
->abfd
, sec
->the_bfd_section
);
116 /* solib.c does something similar, but it only recognizes ".text", SOM calls
117 the text section "$CODE$". */
118 if (strcmp (sec
->the_bfd_section
->name
, "$CODE$") == 0)
120 so
->textsection
= sec
;
123 if (aflag
& SEC_CODE
)
125 sec
->addr
+= so
->lm_info
->text_addr
- so
->lm_info
->text_link_addr
;
126 sec
->endaddr
+= so
->lm_info
->text_addr
- so
->lm_info
->text_link_addr
;
128 else if (aflag
& SEC_DATA
)
130 sec
->addr
+= so
->lm_info
->data_start
;
131 sec
->endaddr
+= so
->lm_info
->data_start
;
137 /* This hook gets called just before the first instruction in the
138 inferior process is executed.
140 This is our opportunity to set magic flags in the inferior so
141 that GDB can be notified when a shared library is mapped in and
142 to tell the dynamic linker that a private copy of the library is
143 needed (so GDB can set breakpoints in the library).
145 __dld_flags is the location of the magic flags; as of this implementation
146 there are 3 flags of interest:
148 bit 0 when set indicates that private copies of the libraries are needed
149 bit 1 when set indicates that the callback hook routine is valid
150 bit 2 when set indicates that the dynamic linker should maintain the
151 __dld_list structure when loading/unloading libraries.
153 Note that shared libraries are not mapped in at this time, so we have
154 run the inferior until the libraries are mapped in. Typically this
155 means running until the "_start" is called. */
158 som_solib_create_inferior_hook (void)
160 struct minimal_symbol
*msymbol
;
161 unsigned int dld_flags
, status
, have_endo
;
162 asection
*shlib_info
;
166 /* First, remove all the solib event breakpoints. Their addresses
167 may have changed since the last time we ran the program. */
168 remove_solib_event_breakpoints ();
170 if (symfile_objfile
== NULL
)
173 /* First see if the objfile was dynamically linked. */
174 shlib_info
= bfd_get_section_by_name (symfile_objfile
->obfd
, "$SHLIB_INFO$");
178 /* It's got a $SHLIB_INFO$ section, make sure it's not empty. */
179 if (bfd_section_size (symfile_objfile
->obfd
, shlib_info
) == 0)
183 /* Slam the pid of the process into __d_pid.
185 We used to warn when this failed, but that warning is only useful
186 on very old HP systems (hpux9 and older). The warnings are an
187 annoyance to users of modern systems and foul up the testsuite as
188 well. As a result, the warnings have been disabled. */
189 msymbol
= lookup_minimal_symbol ("__d_pid", NULL
, symfile_objfile
);
193 anaddr
= SYMBOL_VALUE_ADDRESS (msymbol
);
194 store_unsigned_integer (buf
, 4, PIDGET (inferior_ptid
));
195 status
= target_write_memory (anaddr
, buf
, 4);
199 Unable to write __d_pid.\n\
200 Suggest linking with /opt/langtools/lib/end.o.\n\
201 GDB will be unable to track shl_load/shl_unload calls"));
205 /* Get the value of _DLD_HOOK (an export stub) and put it in __dld_hook;
206 This will force the dynamic linker to call __d_trap when significant
209 Note that the above is the pre-HP-UX 9.0 behaviour. At 9.0 and above,
210 the dld provides an export stub named "__d_trap" as well as the
211 function named "__d_trap" itself, but doesn't provide "_DLD_HOOK".
212 We'll look first for the old flavor and then the new.
214 msymbol
= lookup_minimal_symbol ("_DLD_HOOK", NULL
, symfile_objfile
);
216 msymbol
= lookup_minimal_symbol ("__d_trap", NULL
, symfile_objfile
);
220 Unable to find _DLD_HOOK symbol in object file.\n\
221 Suggest linking with /opt/langtools/lib/end.o.\n\
222 GDB will be unable to track shl_load/shl_unload calls"));
225 anaddr
= SYMBOL_VALUE_ADDRESS (msymbol
);
226 dld_cache
.hook
.address
= anaddr
;
228 /* Grrr, this might not be an export symbol! We have to find the
230 msymbol
= hppa_lookup_stub_minimal_symbol (SYMBOL_LINKAGE_NAME (msymbol
),
234 anaddr
= SYMBOL_VALUE (msymbol
);
235 dld_cache
.hook_stub
.address
= anaddr
;
237 store_unsigned_integer (buf
, 4, anaddr
);
239 msymbol
= lookup_minimal_symbol ("__dld_hook", NULL
, symfile_objfile
);
243 Unable to find __dld_hook symbol in object file.\n\
244 Suggest linking with /opt/langtools/lib/end.o.\n\
245 GDB will be unable to track shl_load/shl_unload calls"));
248 anaddr
= SYMBOL_VALUE_ADDRESS (msymbol
);
249 status
= target_write_memory (anaddr
, buf
, 4);
251 /* Now set a shlib_event breakpoint at __d_trap so we can track
252 significant shared library events. */
253 msymbol
= lookup_minimal_symbol ("__d_trap", NULL
, symfile_objfile
);
257 Unable to find __dld_d_trap symbol in object file.\n\
258 Suggest linking with /opt/langtools/lib/end.o.\n\
259 GDB will be unable to track shl_load/shl_unload calls"));
262 create_solib_event_breakpoint (SYMBOL_VALUE_ADDRESS (msymbol
));
264 /* We have all the support usually found in end.o, so we can track
265 shl_load and shl_unload calls. */
270 /* Get the address of __dld_flags, if no such symbol exists, then we can
271 not debug the shared code. */
272 msymbol
= lookup_minimal_symbol ("__dld_flags", NULL
, NULL
);
275 error (_("Unable to find __dld_flags symbol in object file."));
278 anaddr
= SYMBOL_VALUE_ADDRESS (msymbol
);
280 /* Read the current contents. */
281 status
= target_read_memory (anaddr
, buf
, 4);
283 error (_("Unable to read __dld_flags."));
284 dld_flags
= extract_unsigned_integer (buf
, 4);
286 /* Turn on the flags we care about. */
287 dld_flags
|= DLD_FLAGS_MAPPRIVATE
;
289 dld_flags
|= DLD_FLAGS_HOOKVALID
;
290 store_unsigned_integer (buf
, 4, dld_flags
);
291 status
= target_write_memory (anaddr
, buf
, 4);
293 error (_("Unable to write __dld_flags."));
295 /* Now find the address of _start and set a breakpoint there.
296 We still need this code for two reasons:
298 * Not all sites have /opt/langtools/lib/end.o, so it's not always
299 possible to track the dynamic linker's events.
301 * At this time no events are triggered for shared libraries
302 loaded at startup time (what a crock). */
304 msymbol
= lookup_minimal_symbol ("_start", NULL
, symfile_objfile
);
306 error (_("Unable to find _start symbol in object file."));
308 anaddr
= SYMBOL_VALUE_ADDRESS (msymbol
);
310 /* Make the breakpoint at "_start" a shared library event breakpoint. */
311 create_solib_event_breakpoint (anaddr
);
313 clear_symtab_users ();
317 som_special_symbol_handling (void)
322 som_solib_desire_dynamic_linker_symbols (void)
324 struct objfile
*objfile
;
325 struct unwind_table_entry
*u
;
326 struct minimal_symbol
*dld_msymbol
;
328 /* Do we already know the value of these symbols? If so, then
331 (If you add clauses to this test, be sure to likewise update the
332 test within the loop.)
334 if (dld_cache
.is_valid
)
337 ALL_OBJFILES (objfile
)
339 dld_msymbol
= lookup_minimal_symbol ("shl_load", NULL
, objfile
);
340 if (dld_msymbol
!= NULL
)
342 dld_cache
.load
.address
= SYMBOL_VALUE (dld_msymbol
);
343 dld_cache
.load
.unwind
= find_unwind_entry (dld_cache
.load
.address
);
346 dld_msymbol
= lookup_minimal_symbol_solib_trampoline ("shl_load",
348 if (dld_msymbol
!= NULL
)
350 if (SYMBOL_TYPE (dld_msymbol
) == mst_solib_trampoline
)
352 u
= find_unwind_entry (SYMBOL_VALUE (dld_msymbol
));
353 if ((u
!= NULL
) && (u
->stub_unwind
.stub_type
== EXPORT
))
355 dld_cache
.load_stub
.address
= SYMBOL_VALUE (dld_msymbol
);
356 dld_cache
.load_stub
.unwind
= u
;
361 dld_msymbol
= lookup_minimal_symbol ("shl_unload", NULL
, objfile
);
362 if (dld_msymbol
!= NULL
)
364 dld_cache
.unload
.address
= SYMBOL_VALUE (dld_msymbol
);
365 dld_cache
.unload
.unwind
= find_unwind_entry (dld_cache
.unload
.address
);
367 /* ??rehrauer: I'm not sure exactly what this is, but it appears
368 that on some HPUX 10.x versions, there's two unwind regions to
369 cover the body of "shl_unload", the second being 4 bytes past
370 the end of the first. This is a large hack to handle that
371 case, but since I don't seem to have any legitimate way to
372 look for this thing via the symbol table...
374 if (dld_cache
.unload
.unwind
!= NULL
)
376 u
= find_unwind_entry (dld_cache
.unload
.unwind
->region_end
+ 4);
379 dld_cache
.unload2
.address
= u
->region_start
;
380 dld_cache
.unload2
.unwind
= u
;
385 dld_msymbol
= lookup_minimal_symbol_solib_trampoline ("shl_unload",
387 if (dld_msymbol
!= NULL
)
389 if (SYMBOL_TYPE (dld_msymbol
) == mst_solib_trampoline
)
391 u
= find_unwind_entry (SYMBOL_VALUE (dld_msymbol
));
392 if ((u
!= NULL
) && (u
->stub_unwind
.stub_type
== EXPORT
))
394 dld_cache
.unload_stub
.address
= SYMBOL_VALUE (dld_msymbol
);
395 dld_cache
.unload_stub
.unwind
= u
;
400 /* Did we find everything we were looking for? If so, stop. */
401 if ((dld_cache
.load
.address
!= 0)
402 && (dld_cache
.load_stub
.address
!= 0)
403 && (dld_cache
.unload
.address
!= 0)
404 && (dld_cache
.unload_stub
.address
!= 0))
406 dld_cache
.is_valid
= 1;
411 dld_cache
.hook
.unwind
= find_unwind_entry (dld_cache
.hook
.address
);
412 dld_cache
.hook_stub
.unwind
= find_unwind_entry (dld_cache
.hook_stub
.address
);
414 /* We're prepared not to find some of these symbols, which is why
415 this function is a "desire" operation, and not a "require".
420 som_in_dynsym_resolve_code (CORE_ADDR pc
)
422 struct unwind_table_entry
*u_pc
;
424 /* Are we in the dld itself?
426 ??rehrauer: Large hack -- We'll assume that any address in a
427 shared text region is the dld's text. This would obviously
428 fall down if the user attached to a process, whose shlibs
429 weren't mapped to a (writeable) private region. However, in
430 that case the debugger probably isn't able to set the fundamental
431 breakpoint in the dld callback anyways, so this hack should be
434 if ((pc
& (CORE_ADDR
) 0xc0000000) == (CORE_ADDR
) 0xc0000000)
437 /* Cache the address of some symbols that are part of the dynamic
438 linker, if not already known.
440 som_solib_desire_dynamic_linker_symbols ();
442 /* Are we in the dld callback? Or its export stub? */
443 u_pc
= find_unwind_entry (pc
);
447 if ((u_pc
== dld_cache
.hook
.unwind
) || (u_pc
== dld_cache
.hook_stub
.unwind
))
450 /* Or the interface of the dld (i.e., "shl_load" or friends)? */
451 if ((u_pc
== dld_cache
.load
.unwind
)
452 || (u_pc
== dld_cache
.unload
.unwind
)
453 || (u_pc
== dld_cache
.unload2
.unwind
)
454 || (u_pc
== dld_cache
.load_stub
.unwind
)
455 || (u_pc
== dld_cache
.unload_stub
.unwind
))
458 /* Apparently this address isn't part of the dld's text. */
463 som_clear_solib (void)
471 char text_link_addr
[4];
478 char tsd_start_addr_ptr
[4];
482 link_map_start (void)
484 struct minimal_symbol
*sym
;
487 unsigned int dld_flags
;
489 sym
= lookup_minimal_symbol ("__dld_flags", NULL
, NULL
);
491 error (_("Unable to find __dld_flags symbol in object file."));
492 addr
= SYMBOL_VALUE_ADDRESS (sym
);
493 read_memory (addr
, buf
, 4);
494 dld_flags
= extract_unsigned_integer (buf
, 4);
495 if ((dld_flags
& DLD_FLAGS_LISTVALID
) == 0)
496 error (_("__dld_list is not valid according to __dld_flags."));
498 /* If the libraries were not mapped private, warn the user. */
499 if ((dld_flags
& DLD_FLAGS_MAPPRIVATE
) == 0)
500 warning (_("The shared libraries were not privately mapped; setting a\n"
501 "breakpoint in a shared library will not work until you rerun the "
504 sym
= lookup_minimal_symbol ("__dld_list", NULL
, NULL
);
507 /* Older crt0.o files (hpux8) don't have __dld_list as a symbol,
508 but the data is still available if you know where to look. */
509 sym
= lookup_minimal_symbol ("__dld_flags", NULL
, NULL
);
512 error (_("Unable to find dynamic library list."));
515 addr
= SYMBOL_VALUE_ADDRESS (sym
) - 8;
518 addr
= SYMBOL_VALUE_ADDRESS (sym
);
520 read_memory (addr
, buf
, 4);
521 addr
= extract_unsigned_integer (buf
, 4);
525 read_memory (addr
, buf
, 4);
526 return extract_unsigned_integer (buf
, 4);
529 /* Does this so's name match the main binary? */
531 match_main (const char *name
)
533 return strcmp (name
, symfile_objfile
->name
) == 0;
536 static struct so_list
*
537 som_current_sos (void)
540 struct so_list
*head
= 0;
541 struct so_list
**link_ptr
= &head
;
543 for (lm
= link_map_start (); lm
; )
548 struct cleanup
*old_chain
;
550 struct dld_list dbuf
;
553 new = (struct so_list
*) xmalloc (sizeof (struct so_list
));
554 old_chain
= make_cleanup (xfree
, new);
556 memset (new, 0, sizeof (*new));
557 new->lm_info
= xmalloc (sizeof (struct lm_info
));
558 make_cleanup (xfree
, new->lm_info
);
560 read_memory (lm
, (gdb_byte
*)&dbuf
, sizeof (struct dld_list
));
562 addr
= extract_unsigned_integer ((gdb_byte
*)&dbuf
.name
,
564 target_read_string (addr
, &namebuf
, SO_NAME_MAX_PATH_SIZE
- 1, &errcode
);
566 warning (_("Can't read pathname for load map: %s."),
567 safe_strerror (errcode
));
570 strncpy (new->so_name
, namebuf
, SO_NAME_MAX_PATH_SIZE
- 1);
571 new->so_name
[SO_NAME_MAX_PATH_SIZE
- 1] = '\0';
573 strcpy (new->so_original_name
, new->so_name
);
576 if (new->so_name
[0] && !match_main (new->so_name
))
578 struct lm_info
*lmi
= new->lm_info
;
583 #define EXTRACT(_fld) \
584 extract_unsigned_integer ((gdb_byte *)&dbuf._fld, sizeof (dbuf._fld));
586 lmi
->text_addr
= EXTRACT (text_addr
);
587 tmp
= EXTRACT (info
);
588 lmi
->library_version
= (tmp
>> 16) & 0xffff;
589 lmi
->bind_mode
= (tmp
>> 8) & 0xff;
590 lmi
->struct_version
= tmp
& 0xff;
591 lmi
->text_link_addr
= EXTRACT (text_link_addr
);
592 lmi
->text_end
= EXTRACT (text_end
);
593 lmi
->data_start
= EXTRACT (data_start
);
594 lmi
->bss_start
= EXTRACT (bss_start
);
595 lmi
->data_end
= EXTRACT (data_end
);
596 lmi
->got_value
= EXTRACT (got_value
);
597 tmp
= EXTRACT (tsd_start_addr_ptr
);
598 read_memory (tmp
, tsdbuf
, 4);
599 lmi
->tsd_start_addr
= extract_unsigned_integer (tsdbuf
, 4);
602 printf ("\n+ library \"%s\" is described at 0x%s\n", new->so_name
,
604 printf (" 'version' is %d\n", new->lm_info
->struct_version
);
605 printf (" 'bind_mode' is %d\n", new->lm_info
->bind_mode
);
606 printf (" 'library_version' is %d\n",
607 new->lm_info
->library_version
);
608 printf (" 'text_addr' is 0x%s\n",
609 paddr_nz (new->lm_info
->text_addr
));
610 printf (" 'text_link_addr' is 0x%s\n",
611 paddr_nz (new->lm_info
->text_link_addr
));
612 printf (" 'text_end' is 0x%s\n",
613 paddr_nz (new->lm_info
->text_end
));
614 printf (" 'data_start' is 0x%s\n",
615 paddr_nz (new->lm_info
->data_start
));
616 printf (" 'bss_start' is 0x%s\n",
617 paddr_nz (new->lm_info
->bss_start
));
618 printf (" 'data_end' is 0x%s\n",
619 paddr_nz (new->lm_info
->data_end
));
620 printf (" 'got_value' is %s\n",
621 paddr_nz (new->lm_info
->got_value
));
622 printf (" 'tsd_start_addr' is 0x%s\n",
623 paddr_nz (new->lm_info
->tsd_start_addr
));
626 /* Link the new object onto the list. */
629 link_ptr
= &new->next
;
637 discard_cleanups (old_chain
);
641 /* TODO: The original somsolib code has logic to detect and eliminate
642 duplicate entries. Do we need that? */
648 som_open_symbol_file_object (void *from_ttyp
)
650 CORE_ADDR lm
, l_name
;
653 int from_tty
= *(int *)from_ttyp
;
657 if (!query ("Attempt to reload symbols from process? "))
660 /* First link map member should be the executable. */
661 if ((lm
= link_map_start ()) == 0)
662 return 0; /* failed somehow... */
664 /* Read address of name from target memory to GDB. */
665 read_memory (lm
+ offsetof (struct dld_list
, name
), buf
, 4);
667 /* Convert the address to host format. Assume that the address is
669 l_name
= extract_unsigned_integer (buf
, 4);
672 return 0; /* No filename. */
674 /* Now fetch the filename from target memory. */
675 target_read_string (l_name
, &filename
, SO_NAME_MAX_PATH_SIZE
- 1, &errcode
);
679 warning (_("failed to read exec filename from attached file: %s"),
680 safe_strerror (errcode
));
684 make_cleanup (xfree
, filename
);
685 /* Have a pathname: read the symbol file. */
686 symbol_file_add_main (filename
, from_tty
);
692 som_free_so (struct so_list
*so
)
698 som_solib_thread_start_addr (struct so_list
*so
)
700 return so
->lm_info
->tsd_start_addr
;
703 /* Return the GOT value for the shared library in which ADDR belongs. If
704 ADDR isn't in any known shared library, return zero. */
707 som_solib_get_got_by_pc (CORE_ADDR addr
)
709 struct so_list
*so_list
= master_so_list ();
710 CORE_ADDR got_value
= 0;
714 if (so_list
->lm_info
->text_addr
<= addr
715 && so_list
->lm_info
->text_end
> addr
)
717 got_value
= so_list
->lm_info
->got_value
;
720 so_list
= so_list
->next
;
725 /* Return the address of the handle of the shared library in which ADDR belongs.
726 If ADDR isn't in any known shared library, return zero. */
727 /* this function is used in initialize_hp_cxx_exception_support in
731 som_solib_get_solib_by_pc (CORE_ADDR addr
)
733 struct so_list
*so_list
= master_so_list ();
737 if (so_list
->lm_info
->text_addr
<= addr
738 && so_list
->lm_info
->text_end
> addr
)
742 so_list
= so_list
->next
;
745 return so_list
->lm_info
->lm_addr
;
751 static struct target_so_ops som_so_ops
;
753 extern initialize_file_ftype _initialize_som_solib
; /* -Wmissing-prototypes */
756 _initialize_som_solib (void)
758 som_so_ops
.relocate_section_addresses
= som_relocate_section_addresses
;
759 som_so_ops
.free_so
= som_free_so
;
760 som_so_ops
.clear_solib
= som_clear_solib
;
761 som_so_ops
.solib_create_inferior_hook
= som_solib_create_inferior_hook
;
762 som_so_ops
.special_symbol_handling
= som_special_symbol_handling
;
763 som_so_ops
.current_sos
= som_current_sos
;
764 som_so_ops
.open_symbol_file_object
= som_open_symbol_file_object
;
765 som_so_ops
.in_dynsym_resolve_code
= som_in_dynsym_resolve_code
;
768 void som_solib_select (struct gdbarch_tdep
*tdep
)
770 current_target_so_ops
= &som_so_ops
;
772 tdep
->solib_thread_start_addr
= som_solib_thread_start_addr
;
773 tdep
->solib_get_got_by_pc
= som_solib_get_got_by_pc
;
774 tdep
->solib_get_solib_by_pc
= som_solib_get_solib_by_pc
;
777 /* The rest of these functions are not part of the solib interface; they
778 are used by somread.c or hppa-hpux-tdep.c */
781 som_solib_section_offsets (struct objfile
*objfile
,
782 struct section_offsets
*offsets
)
784 struct so_list
*so_list
= master_so_list ();
788 /* Oh what a pain! We need the offsets before so_list->objfile
789 is valid. The BFDs will never match. Make a best guess. */
790 if (strstr (objfile
->name
, so_list
->so_name
))
792 asection
*private_section
;
794 /* The text offset is easy. */
795 offsets
->offsets
[SECT_OFF_TEXT (objfile
)]
796 = (so_list
->lm_info
->text_addr
797 - so_list
->lm_info
->text_link_addr
);
798 offsets
->offsets
[SECT_OFF_RODATA (objfile
)]
799 = ANOFFSET (offsets
, SECT_OFF_TEXT (objfile
));
801 /* We should look at presumed_dp in the SOM header, but
802 that's not easily available. This should be OK though. */
803 private_section
= bfd_get_section_by_name (objfile
->obfd
,
805 if (!private_section
)
807 warning (_("Unable to find $PRIVATE$ in shared library!"));
808 offsets
->offsets
[SECT_OFF_DATA (objfile
)] = 0;
809 offsets
->offsets
[SECT_OFF_BSS (objfile
)] = 0;
812 offsets
->offsets
[SECT_OFF_DATA (objfile
)]
813 = (so_list
->lm_info
->data_start
- private_section
->vma
);
814 offsets
->offsets
[SECT_OFF_BSS (objfile
)]
815 = ANOFFSET (offsets
, SECT_OFF_DATA (objfile
));
818 so_list
= so_list
->next
;