Bug 32764 - zlib shared library exposes too many symbols
Bug#: 32764 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: azarah@gentoo.org Reported By: duvall@comfychair.org
Component: Library
URL: 
Summary: zlib shared library exposes too many symbols
Keywords:  
Status Whiteboard: 
Opened: 2003-11-04 20:16 0000
Description:   Opened: 2003-11-04 20:16 0000
I sent the following bug report to the maintainers, too, but thought I'd file
it here for good measure.

When building zlib as a shared library, it is possible on a number of
platforms to make symbols which are entirely internal to the library
invisible to anything linking to it.  Solaris uses what it calls a
mapfile, and GNU ld uses a version script, but they're exactly the same
thing (for these purposes, at any rate).

This came up because a recent build of zsh broke due to it defining a
function, zcalloc(), which was duplicated in zlib, even though it's not
part of the official zlib interface.

The attached patch works on Linux and Solaris, and "make test" passes.
The version of zlib shipped in Solaris uses the exact same mapfile, so
it should be well tested.

(For completeness, the Solaris version uses an LDSHARED set to

    -G -KPIC -h libz.so.1 -z defs -z text -z combreloc -M mapfile -L.  -lc

but that's somewhat beyond the scope of this bug report.)

------- Comment #1 From Danek Duvall 2003-11-04 20:17:16 0000 -------
Created an attachment (id=20277) [details]
Aforementioned patch

------- Comment #2 From Martin Schlemmer (RETIRED) 2003-11-06 13:59:53 0000 -------
Did you receive any feedback from the zlib guys yet ?

------- Comment #3 From Danek Duvall 2003-11-06 14:02:33 0000 -------
Nope.  I'll follow-up when I do, but I don't have any sense for how responsive
they are, so no guarantees on when that might be.  :)

------- Comment #4 From Martin Schlemmer (RETIRED) 2003-11-06 14:45:11 0000 -------
Ok, added in -r4.