From owner-freebsd-hackers Fri Jun 8 10:14: 0 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id 82D9D37B403 for ; Fri, 8 Jun 2001 10:13:53 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 52634 invoked by uid 1000); 8 Jun 2001 17:12:32 -0000 Date: Fri, 8 Jun 2001 20:12:32 +0300 From: Peter Pentchev To: Kevin Day Cc: hackers@freebsd.org Subject: Re: Access to symbol table(including dynamics) at runtime Message-ID: <20010608201232.G535@ringworld.oblivion.bg> Mail-Followup-To: Kevin Day , hackers@freebsd.org References: <200106081709.MAA42527@temphost.dragondata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200106081709.MAA42527@temphost.dragondata.com>; from toasty@temphost.dragondata.com on Fri, Jun 08, 2001 at 12:09:39PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Jun 08, 2001 at 12:09:39PM -0500, Kevin Day wrote: > > > Is there a simple way that I can lookup a symbol name(by address) during > runtime? > > I know I can exec nm, look up for the address I need, and get local > symbols, but it would be really nice if I could get addresses of functions > in dynamic libraries as well. I know I could use ldd to get offsets of each > .so and calculate from there, but I'm starting to think I'm reproducing work > that was done somewhere else. > > If someone could point me at a man page to something that can do what I > need, tell me of a library that does something similar, or tell me why this > can't be done, i'd be very thankful. :) OK, you asked for it, here's a minimalistic answer: dlopen(3) :) G'luck, Peter -- If wishes were fishes, the antecedent of this conditional would be true. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message