From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
To: drow@false.org (Daniel Jacobowitz)
Cc: gdb-patches@sourceware.org, randolph@tausq.org
Subject: [patch] Fix shared library handling in solib-pa64.c (take 2)
Date: Wed, 06 Aug 2008 18:20:00 -0000 [thread overview]
Message-ID: <20080806181952.5D99A431A@hiauly1.hia.nrc.ca> (raw)
In-Reply-To: <20080806142017.GA27139@caradoc.them.org> from "Daniel Jacobowitz" at Aug 6, 2008 10:20:17 am
> Does this really do what you want it to?
>
> Looking at that HP man page, it looks like dlmodinfo will use "its own
> data structures" - i.e. GDB's load map, not the debugged program's.
Here's take 2. This one actually works. This shows the result
for a simple program.
...
This GDB was configured as "hppa64-hp-hpux11.00"...
(gdb) info shared
No shared libraries loaded at this time.
(gdb) break main
Breakpoint 1 at 0x40000000000029c8: file main.c, line 4.
(gdb) r
Starting program: /home/gnu/gdb/objdir64/main
warning: Loadable segment ".tbss" outside of ELF segments
warning: Loadable segment ".tbss" outside of ELF segments
Breakpoint 1, main () at main.c:4
4 return 0;
(gdb) info shared
From To Syms Read Shared Object Library
0xc00000000000ac80 0xc0000000000419b4 Yes /usr/lib/pa20_64/dld.sl
0x800003ffeff23538 0x800003ffeffe67f8 Yes /lib/pa20_64/libc.2
0x800003ffefec7150 0x800003ffefec8578 Yes /usr/lib/pa20_64/libdl.1
0x800003ffefec2574 0x800003ffefec2574 Yes /opt/graphics/OpenGL/lib/pa20_64/libogltls.sl
One thing that I have noticed is that the shared libraries are always
forced private which makes them writeable. I recently had a program
which dropped core when the library code was shared but not when they
were private.
On hpux 11, the chatr "+dbg" can be used to make libraries private or
shareable. Possibly, it's not a great idea to always force private
libraries. Detection of this is broken for the som target. The
information is now in the shared library header and not __dld_flags.
On hpux 10, I guess we are stuck with forcing private libraries.
Ok?
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2008-08-06 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* solib-pa64.c (read_dld_descriptor): Return zero if load map is not
setup.
Index: solib-pa64.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-pa64.c,v
retrieving revision 1.10
diff -u -3 -p -r1.10 solib-pa64.c
--- solib-pa64.c 1 Jan 2008 22:53:13 -0000 1.10
+++ solib-pa64.c 6 Aug 2008 17:19:39 -0000
@@ -125,8 +125,8 @@ pa64_target_read_memory (void *buffer, C
This must happen after dld starts running, so we can't do it in
read_dynamic_info. Record the fact that we have loaded the
- descriptor. If the library is archive bound, then return zero, else
- return nonzero. */
+ descriptor. If the library is archive bound or the load map
+ hasn't been setup, then return zero; else return nonzero. */
static int
read_dld_descriptor (void)
@@ -161,6 +161,9 @@ read_dld_descriptor (void)
error (_("Error while reading in load map pointer."));
}
+ if (!dld_cache.load_map)
+ return 0;
+
/* Read in the dld load module descriptor */
if (dlgetmodinfo (-1,
&dld_cache.dld_desc,
next prev parent reply other threads:[~2008-08-06 18:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-05 22:12 [patch] Fixed shared library handling in solib-pa64.c John David Anglin
2008-08-06 13:06 ` Randolph Chung
2008-08-06 14:21 ` Daniel Jacobowitz
2008-08-06 14:59 ` John David Anglin
2008-08-06 18:20 ` John David Anglin [this message]
2008-08-06 19:26 ` [patch] Fix shared library handling in solib-pa64.c (take 2) Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080806181952.5D99A431A@hiauly1.hia.nrc.ca \
--to=dave@hiauly1.hia.nrc.ca \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=randolph@tausq.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox