Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jan 1998 17:28:54 -0600 (CST)
From:      Damon Anton Permezel <dap@damon.com>
To:        tlambert@primenet.com (Terry Lambert)
Cc:        hasty@rah.star-gate.com, tlambert@primenet.com, dap@damon.com, nate@mt.sri.com, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Motif question
Message-ID:  <199801082328.RAA20128@damon.com>
In-Reply-To: <199801081815.LAA15148@usr08.primenet.com> from Terry Lambert at "Jan 8, 98 06:15:59 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
"Terry Lambert sez: "
> > > Heh.  My main issue was the infernal "dladdr" that the FreeBSD dynamic
> > > loading code doesn't provide.  The 1.1.5 stuff uses it to get the path
> > > of the shared library that's calling it so that it can go up two
> > > directories and down one to find where it left it's classes.zip.  8-(.
> > > Stupid way to do it...
> > 
> > Terry, all you need to do is replace the dladdr kludge with argv[0] 8)
> 
> You mean the path you get back from dladdr, right?
> 
> The dladdr call is tricky.  What it's actually looking for is the
> path to the shared library, NOT the path to the java program.  If
> you create a program with a dladdr call for the address of a
> function in libc, you'll actually get back something other than what
> you expect; the path won't be filled out because the program image
> is not mapped in by the shared library -- and the name reference will
> actually reference a stub linked into your program.

In general, this is true, but it also appears that, if the address passed in
is within the exec image, it returns the path to the exec image.
Thats what I was rambling about.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801082328.RAA20128>