From: Paul Koning <pkoning@equallogic.com>
To: kevinb@redhat.com
Cc: kewarken@qnx.com, gdb@sources.redhat.com
Subject: Re: relocation of shared libs not based at 0
Date: Tue, 17 Dec 2002 16:47:00 -0000 [thread overview]
Message-ID: <15871.50596.942339.277490@pkoning.akdesign.com> (raw)
In-Reply-To: <1021218002802.ZM4459@localhost.localdomain>
>>>>> "Kevin" == Kevin Buettner <kevinb@redhat.com> writes:
Kevin> ...
Kevin> So, as I understand it, the "base address" is *not* an
Kevin> absolute location, but is actually the difference between
Kevin> where the segment ended up and the location assigned to it in
Kevin> the executable file. Thus the "base address" is the proper
Kevin> value to use to relocate the segment's start and end
Kevin> addresses.
That interpretation certainly matches the code. The document you
quoted is not all that clearly worded, but it seems to take the same
view of things.
On the other hand, the shared library loader in NetBSD doesn't. It
sets the "base address" in the link_map to the load address of the
section, not the bias from the link address to the load address.
That's why I changed solib-svr4.c in my copy of gdb.
Perhaps a better fix is to change the loader in NetBSD to set "base
address" to match gdb's expectations.
Kevin> Now, it's possible that my understanding is flawed. If so, I
Kevin> await enlightenment. I think it's also possible that the
Kevin> shared library implementation that you're using might not
Kevin> conform to the above definition of "base address". If that's
Kevin> the case, then you can either attempt to get it fixed in the
Kevin> code which implements the dynamic loader, or, if that's not
Kevin> possible, create a new solib backend for gdb which implements
Kevin> support for your shared library machinery. I suspect it would
Kevin> be very similar to solib-svr4.c.
Kevin> With regard to the two patches that have been posted for
Kevin> fixing this problem, I don't think that either one is correct
Kevin> in light of the above definition of "base address".
It would be interesting to hear from a NetBSD wizard. I'd be happy
with any fix that makes shared libs work in gdb for my platform.
Part of the reason why I patched gdb rather than ldd.elf_so is so I
could process coredumps from already shipped systems. Then again,
there are few enough of those that this isn't a big consideration.
paul
next prev parent reply other threads:[~2002-12-18 0:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-17 12:23 Kris Warkentin
2002-12-17 12:31 ` Paul Koning
2002-12-17 13:36 ` Kris Warkentin
2002-12-17 16:28 ` Kevin Buettner
2002-12-17 16:47 ` Paul Koning [this message]
2003-01-08 21:52 ` Kris Warkentin
2003-01-08 22:24 ` Kevin Buettner
2003-01-09 14:35 ` Colin Burgess
2003-01-09 15:06 ` Kris Warkentin
2003-02-05 18:40 ` Paul Koning
2003-02-05 19:08 ` Kris Warkentin
2003-02-05 19:11 ` Kevin Buettner
2003-02-10 21:45 ` Paul Koning
2003-02-12 18:06 ` Kevin Buettner
2003-02-12 18:19 ` Kris Warkentin
2002-12-17 13:39 David Anderson
2003-02-12 18:37 Peter van der Veen
2004-01-05 17:39 Paul Koning
2004-01-09 22:48 ` Kevin Buettner
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=15871.50596.942339.277490@pkoning.akdesign.com \
--to=pkoning@equallogic.com \
--cc=gdb@sources.redhat.com \
--cc=kevinb@redhat.com \
--cc=kewarken@qnx.com \
/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