Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jul 2000 12:09:16 +0200 (CEST)
From:      Raymond Wiker <Raymond.Wiker@fast.no>
To:        freebsd-hackers@freebsd.org, freebsd-stable@freebsd.org
Subject:   Re: dlopen() and friends from a statically-linked binary?
Message-ID:  <14712.8524.305147.704022@raw.gren.fast.no>

next in thread | raw e-mail | index | archive | help
> raw : ~ $ gcc dltest.c -o dltest
> raw : ~ $ ./dltest
> Handle: 0x2805e000, main: 0x0
> Handle: 0x0, main: 0x0
> 
> [ Note: this seems wrong; according to the manpage for dlsym, the
> second call should give the same output as the first. ]

	Sorry about the confusion... the "main" symbol does not appear
to work for this illustration (possibly because it doesn't come from a
dynamic library?). If I try with "errno" instead, I get

raw : ~ $ ./dltest 
Handle: 0x2805e000, errno: 0x280f5cd4
Handle: 0x0, errno: 0x0
raw : ~ $ 

--- according to the manpage for dlsym(), passing 0 for handle should
have the same effect as passing 0 as the path to dlopen; i.e, to
access the symbol table for the running program.

-- 
Raymond Wiker


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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