Bug#413602: exim4: 50_localscan_dlopen.patch: Reduce dynamic symbol table

Magnus Holmgren holmgren at lysator.liu.se
Tue Mar 6 01:37:38 CET 2007

Source: exim4
Severity: wishlist
Tags: patch

I think this should be a pretty good idea:

1. Add -fvisibility=hidden to CFLAGS, e.g. right after where LFLAGS is set 
to -rdynamic.

CFLAGS += -fvisibility=hidden

1a. Change LFLAGS to LDFLAGS above, i.e.

LDFLAGS += -rdynamic
CFLAGS += -fvisibility=hidden

$(LDFLAGS) is only applied to the main exim binary, not the utilities.

2. Add the following hunk:

--- exim4-4.66/build-tree/src/local_scan.h	2007-03-05 19:46:40.853429411 +0100
+++ exim4-4.66/build-tree/src/local_scan.h	2007-03-05 19:46:42.673669439 +0100
@@ -18,6 +18,7 @@
 settings, and the store functions. */
 #include <sys/types.h>
+#pragma GCC visibility push(default)
 #include "config.h"
 #include "mytypes.h"
 #include "store.h"
@@ -188,4 +189,6 @@
 extern uschar *string_copyn(uschar *, int);
 extern uschar *string_sprintf(char *, ...);
+#pragma GCC visibility pop
 /* End of local_scan.h */

The result should be that only those symbols declared in local_scan.h and its 
included files are included in the dynamic symbol table.

Magnus Holmgren        holmgren at lysator.liu.se
                       (No Cc of list mail needed, thanks)

  "Exim is better at being younger, whereas sendmail is better for 
   Scrabble (50 point bonus for clearing your rack)" -- Dave Evans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-exim4-maintainers/attachments/20070306/e79d147b/attachment.pgp

More information about the Pkg-exim4-maintainers mailing list