public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* dynamic linking question
@ 2004-09-03 16:37 Jim Norris
  2004-09-03 18:14 ` Joe Buck
  2004-09-04  0:42 ` James E Wilson
  0 siblings, 2 replies; 3+ messages in thread
From: Jim Norris @ 2004-09-03 16:37 UTC (permalink / raw)
  To: gcc

I'm trying to find documentation on how to dynamically link to a shared
object at run time. I found something that describes how to do it in C
using gcc but that's not exactly what I need.

I need to know the steps gcc takes to compile code to open the library,
get the address of the function from it's name, call the function, and
close the library. Is there a standard proceedure for dynamically linking
to a shared object?

Can you point me in the right direction please or to the person who wrote
the code? (Begs)

I'm guessing there are functions in either the ldd or bfd library for
these purposes?

I'm trying to convert a Forth interpreter I wrote to run on Unix and need
to be able to do these things at run time when the user prompts the Forth
interpreter to do them. I also need a way to get the list of function
names from the shared object elf file if they are in there.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dynamic linking question
  2004-09-03 16:37 dynamic linking question Jim Norris
@ 2004-09-03 18:14 ` Joe Buck
  2004-09-04  0:42 ` James E Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Buck @ 2004-09-03 18:14 UTC (permalink / raw)
  To: Jim Norris; +Cc: gcc

On Fri, Sep 03, 2004 at 12:37:06PM -0400, Jim Norris wrote:
> I'm trying to find documentation on how to dynamically link to a shared
> object at run time. I found something that describes how to do it in C
> using gcc but that's not exactly what I need.

Wrong list.

> I need to know the steps gcc takes to compile code to open the library,
> get the address of the function from it's name, call the function, and
> close the library. Is there a standard proceedure for dynamically linking
> to a shared object?

For Solaris, BSD, GNU/Linux, etc, type "man dlopen"


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dynamic linking question
  2004-09-03 16:37 dynamic linking question Jim Norris
  2004-09-03 18:14 ` Joe Buck
@ 2004-09-04  0:42 ` James E Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: James E Wilson @ 2004-09-04  0:42 UTC (permalink / raw)
  To: fromfast; +Cc: gcc

Jim Norris wrote:
> I'm trying to find documentation on how to dynamically link to a shared
> object at run time. I found something that describes how to do it in C
> using gcc but that's not exactly what I need.

GCC doesn't do any of this stuff.  Try looking at the static linker 
(binutils) and the dynamic linker (glibc for linux).

Also, you might want to look at the target ABI documentation, but since 
you didn't mention the target, I can't point you at it.  Every target 
does this differently.  Assuming this is linux, you might start at
   http://www.linuxbase.org
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-09-04  0:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-03 16:37 dynamic linking question Jim Norris
2004-09-03 18:14 ` Joe Buck
2004-09-04  0:42 ` James E Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).