Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Nov 2008 04:18:22 -0800
From:      Jeremy Chadwick <koitsu@FreeBSD.org>
To:        Markus Hoenicka <markus.hoenicka@mhoenicka.de>
Cc:        freebsd-questions@FreeBSD.org
Subject:   Re: dlsym can't use handle returned by dlopen?
Message-ID:  <20081113121822.GA20600@icarus.home.lan>
In-Reply-To: <20081113082402.GA14906@icarus.home.lan>
References:  <18715.28127.306511.577084@yeti.mininet> <20081113042912.GA10018@icarus.home.lan> <20081113090021.less3h5iwwsgwsg4@webmail.df.eu> <20081113081456.GA14564@icarus.home.lan> <20081113092059.gjjufgrxss0gwww0@webmail.df.eu> <20081113082402.GA14906@icarus.home.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 13, 2008 at 12:24:02AM -0800, Jeremy Chadwick wrote:
> On Thu, Nov 13, 2008 at 09:20:59AM +0100, Markus Hoenicka wrote:
> > Quoting Jeremy Chadwick <koitsu@FreeBSD.org>:
> >
> >> When I looked at the resulting symbol names using nm or objdump, certain
> >> characters were prepended to them.  There's a gcc or ld flag which
> >> disables this behaviour.  I'll have to dig around to remind myself what
> >> it is.  Once I read about it, it made perfect sense.
> >>
> >> Again, if you want me to write some code and provide some output of
> >> what I'm talking about, I can do so.
> >>
> >
> > I'd greatly appreciate any help here. I feel what I'm doing now is  
> > writing ugly hacks to make things work somehow. I'd prefer to do it  
> > properly.
> 
> No problem.  I'll try to get something small/simple written up tonight
> (I'm at work right now) and send it out.

As promised: http://www.malkavian.com/~jdc/myprog.tar.gz

I couldn't figure out what the gcc flag was that I needed to keep
certain characters from getting prepended to the symbol names.  I
believe the char added was an underscore, but I could be wrong.

Either way, the example should help you, I think.  (You can change
RTLD_LAZY to RTLD_NOW and it still functions as expected)

-- 
| Jeremy Chadwick                                jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |




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