summaryrefslogtreecommitdiff
path: root/tc/static-syms.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-11-06 06:09:22 -0500
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-11-10 10:44:20 -0800
commitf2e27cfb016e2465cd3f07e0b556058060702578 (patch)
treec8f111902c95f4d8624408e36aa35acdc3176cc9 /tc/static-syms.c
parenta7a9ddbb675b7fbd184c3ab40817265b0b207a23 (diff)
downloadiproute2-f2e27cfb016e2465cd3f07e0b556058060702578.tar.gz
support static-only systems
The iptables code supports a "no shared libs" mode where it can be used without requiring dlfcn related functionality. This adds similar support to iproute2 so that it can easily be used on systems like nommu Linux (but obviously with a few limitations -- no dynamic plugins). Rather than modify every location that uses dlfcn.h, I hooked the dlfcn.h header with stub functions when shared library support is disabled. Then symbol lookup is done via a local static lookup table (which is generated automatically at build time) so that internal symbols can be found. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tc/static-syms.c')
-rw-r--r--tc/static-syms.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tc/static-syms.c b/tc/static-syms.c
new file mode 100644
index 00000000..1ed3a8a9
--- /dev/null
+++ b/tc/static-syms.c
@@ -0,0 +1,6 @@
+#include <string.h>
+void *_dlsym(const char *sym)
+{
+#include "static-syms.h"
+ return NULL;
+}