httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens-Uwe Mager <>
Subject Re: [PATCH] Expat patch #3
Date Fri, 21 May 1999 21:09:22 GMT
On Fri, May 21, 1999 at 10:37:00PM +0200, Ralf S. Engelschall wrote:

> Wait, let me understand it again. What you propose is to just export the
> symbols. Ok, but then doesn't mean that the Expat stuff is really all linked
> into the httpd, isn't it? When all(!) code is linked in, this exporting will
> work, of course. But when not all code gets linked in the exporting is useless
> AFAIK. We do the ap_xx() wrapper stuff not just because of exporting.  We've
> to still export the ap_xx(), of course. We do it to force the linker to
> include the whole(!) Expat into httpd so the whole Expat library is available
> to DSOs when we try to export the stuff.

The export of a symbol is equivalent to adding -u symbol on the command
line of the linker, e.g it forces the symbol into the executable. You
can also on most platforms not link against a library .a file but the
individual .o files, this will also force the routines to be included
(notable exception is AIX, but there the export file will do).  One has
to make sure that any DSO's or shared libraries do not link against the
static expat library themselves, that would defeat everything.

Renaming is only necessary with symbols that are also in the system
libraries, as with two symbols named the same the symbol resolution
gets system dependent. This was really visible with the regex stuff, as
this is both in the apache executable and the system C library if
HSREGEX is defined. The only choice then is to rename to make sure that
the symbol you call is really yours.

Similar problems plague other programs as well, the special malloc in
perl comes to mind. Defining your own malloc will only work reliable if
you link statically.

Jens-Uwe Mager

HELIOS Software GmbH
Steinriede 3
30827 Garbsen

Phone:		+49 5131 709320
FAX:		+49 5131 709325

View raw message