code review - br-msk-reduce-symbols

From: Daniel Black <daniel.subs_at_internode.on.net>
Date: Fri, 6 Nov 2009 13:54:03 +1100

good news its working in that its hiding symbols.

nm -g --defined-only ./libopendkim/.libs/libopendkim.so | fgrep -v dkim_
(empty)

The bits like 00000000002182e8 d policyflags
from that seem to be there are harmless. I tried the following test.

test.c:
extern int policyflags;

int main(int arc, char **argv)
{
        return policyflags+2;
}
correctly fails to link against policyflags:
 gcc -o test test.c libopendkim/.libs/libopendkim.so

/tmp/cc4S0pOP.o: In function `main':
test.c:(.text+0xd): undefined reference to `policy_flags'
collect2: ld returned 1 exit status

bad news is the string functions dkim_str* don't link in opendkim (they aren't
in dkim.h):
....
cvs/libar/.libs/libar.so -lssl -lcrypto -pthread
opendkim_stats-opendkim-db.o: In function `dkimf_db_strerror':
/home/dan/software_projects/opendkim-cvs/opendkim/opendkim-db.c:1732:
undefined reference to `dkim_strlcpy'
/home/dan/software_projects/opendkim-cvs/opendkim/opendkim-db.c:1739:
undefined reference to `dkim_strlcpy'
opendkim_stats-opendkim-db.o: In function `dkimf_db_walk':

to add them or not? Not sure here.

As per the patch attached, I think the generation could be handled with a
little less indirection however that's just personal preference.

I checked libar and its fine with exports.

libvbr seems to have more in vbr.h than nm -g --defined-only
./libvbr/.libs/libvbr.so
don't know why - didn't look that hard.

$ fgrep _P libvbr/vbr.h
#define VBR_PREFIX "_vouch"
extern VBR * vbr_init __P((void *(*caller_mallocf)(void *closure,
extern void vbr_close __P((VBR *));
extern const char *vbr_geterror __P((VBR *));
extern VBR_STAT vbr_getheader __P((VBR *, char *, size_t));
extern void vbr_setcert __P((VBR *, char *));
extern void vbr_settype __P((VBR *, char *));
extern void vbr_setdomain __P((VBR *, char *));
extern void vbr_trustedcerts __P((VBR *, char **));
extern VBR_STAT vbr_query __P((VBR *, char **, char **));
extern void vbr_settimeout __P((VBR *, u_int));
extern void vbr_setcallbackint __P((VBR *, u_int));
extern void vbr_setcallbackctx __P((VBR *, void *));
extern VBR_STAT vbr_setdnscallback __P((VBR *vbr,

$ nm -g --defined-only ./libvbr/.libs/libvbr.so
0000000000202088 A __bss_start
0000000000202088 A _edata
0000000000202098 A _end
0000000000001918 T _fini
0000000000000a68 T _init
00000000000011a0 T vbr_close
0000000000000df0 T vbr_geterror
00000000000010b0 T vbr_getheader
0000000000001200 T vbr_init
0000000000001310 T vbr_query
0000000000000d30 T vbr_setcert
0000000000000d90 T vbr_setdomain
0000000000000cd0 T vbr_settype
0000000000001290 T vbr_strlcpy
0000000000000c70 T vbr_trustedcerts

all for now....



Received on Fri Nov 06 2009 - 02:54:40 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:32:29 PST