libsmbclient for Samba4: initial design issues

James Peach jpeach at samba.org
Sat Aug 13 09:31:42 GMT 2005


On Sat, 2005-08-13 at 19:03 +1000, Andrew Bartlett wrote:
> On Sat, 2005-08-13 at 08:16 +0200, Stefan (metze) Metzmacher wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > tridge at samba.org schrieb:
> > > Derrell,
> > > 
> > > yes, I understand what you're trying to achieve, you want all symbols
> > > in any Samba supplied libs to hide behind a single part of the
> > > namespace. My objection is that it adds another level of prefix to
> > > every single function, which I think makes the code less readable.
> > > 
> > > Perhaps we could look at a different technical solution? I believe
> > > that gcc and the GNU binutils has a way of marking functions as being
> > > public when the code is in a library, thus allowing C code to specify
> > > a 3 level scoping of "public", "internal" and "file", instead of the
> > > usual 2 level scoping of "public" and "file" given by
> > > static/non-static.
> > 
> > yes, that's also the idea I had,
> > on some platforms it's also possible to tell the linker which symbols it should
> > make public, I don't know all details.
> 
> I strongly agree:  Using linker macros or other foo is a much better way
> to achieve this, and avoids driving us all batty in the process.

Yep, this is also the only way to stop people using internal, private
symbols. The IRIX MIPSPro suite supports this, and I'm positive that
most other toolchains will too. On IRIX, this is very simple .. you just
list the symbols you want to export in a file (usually called
common.exports) and pass the filename to the linker. All the non-static
symbols you didn't list become local to the shared library.

-- 
James Peach | jpeach at samba.org



More information about the samba-technical mailing list