[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dlopen question...



On Wednesday 04 June 2003 21:28, Martin Preuss wrote:
> Hi,
>
> Am Mittwoch, 4. Juni 2003 21:13 schrieb Peter Valchev:
> > > I'm not sure but I had some problems looking up symbols, too
> > > (with Libchipcard).
> > >
> > > The problem there was that symbols have the prefix "_"
> > > (underscore) in OpenBSD.
> >
> > ..
> > This statement is wrong.
> >
> > The underscore prefix is an a.out thing, and affects only a.out
> > platforms.  So OpenBSD needs it only for few architectures
> > (especially since i386 switched to ELF, even fewer)
>
> I'm using OpenBSD on a i386 platform, and dlsym does NOT work without
> that prefix.
> I verified this with two projects I participate in.
>
> So when it works WITH the underscrore (and it does), how can I be
> wrong ?
>
> regards
> Martin

Some names (at least in C++) with a certain prefix is reserved for 
implementors of libraries/compilers. A __ is such a prefix, and as far 
as I know, a single _ is pretty much the same. Using your own names 
with those kind of prefxies is asking for trouble. Macroes don't 
respect scope.

Cheers,
Sigfred.