This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: shared library support


On Thu, 20 May 2004 11:04:45 -0700
"Stephen P. Smith" <ischis2@cox.net> wrote:

> ./gdb/solib-svr4.c
>       warning ("no shared library support for this OS / ABI");

Thanks for tracking this down.

If you truly want SVR4 shared library support for your target, you'll
need to supply some link map offsets for it to work.  See, e.g.,
ppc_linux_svr4_fetch_link_map_offsets() in ppc-linux-tdep.c.

Since you've implemented your own shared library support for your
target, my guess is that you don't want SVR4 shared library support
at all.  Exactly where we go next depends on how you've implemented
your shared library support.  Ideally, you would have written it
as a solib.c backend.  If you had, we could add some machinery for
enabling your backend in favor of the svr4 backend.  (Actually, the
machinery for switching amongst the various backends is long overdue,
so I'm kind of hoping this is what's needed.)

My recollection of the matter is that you didn't do it this way.  Did
you at least define SOLIB_ADD for your shared library support?  If so,
and if defined at the proper point, this definition will override the
solib.c infrastructure.  This is the mechanism that native AIX uses to
enable AIX shared library support in favor of that in solib.c /
solib-svr4.c.

Assuming that I'm right about my guesses thus far, probably the
easiest course is for you to define your own target (mytarget-tm.h /
mytarget.mt) such that your homebrew shared library support is listed
on the TDEPFILES line in the .mt file and some sort of SOLIB_ADD
define (even a null one) is made before the include of whatever ppc
target you're basing your homebrew target on.  If you use a null (or
otherwise bogus) SOLIB_ADD define, you'll want to #undef it after the
#include of tm-rs6000.h or similar.

The easiest course and the preferred course are not the same though. 
The preferred course is to write your shared library support as a
solib.c backend, add some OSABI recognition code for your target along
with a suitable OSABI-specific tdep.c file for your target.  In this
(latter) file, you would call some as yet to be written machinery in
solib.c which'd enable your target's shared library support.  This is
just a thumbnail sketch; if you choose to go this route, I'm willing
to go into much more detail and even assist with writing the necessary
solib.c support.

Kevin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]